Skip to content

Commit 3bdeefe

Browse files
authored
Properly support int variables of any width (geopython#1829)
1 parent 179c90f commit 3bdeefe

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pygeoapi/provider/rasterio_.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ def get_fields(self):
8080
dtype2 = dtype
8181
if dtype.startswith('float'):
8282
dtype2 = 'number'
83+
elif dtype.startswith('int'):
84+
dtype2 = 'integer'
8385

8486
self._fields[i2] = {
8587
'title': name,

pygeoapi/provider/xarray_.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def get_fields(self):
112112
dtype = value.dtype
113113
if dtype.name.startswith('float'):
114114
dtype = 'number'
115+
elif dtype.name.startswith('int'):
116+
dtype = 'integer'
115117

116118
self._fields[key] = {
117119
'type': dtype,

0 commit comments

Comments
 (0)