Skip to content

Commit

Permalink
Properly support int variables of any width (geopython#1829)
Browse files Browse the repository at this point in the history
  • Loading branch information
barbuz authored Oct 15, 2024
1 parent 179c90f commit 3bdeefe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pygeoapi/provider/rasterio_.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def get_fields(self):
dtype2 = dtype
if dtype.startswith('float'):
dtype2 = 'number'
elif dtype.startswith('int'):
dtype2 = 'integer'

self._fields[i2] = {
'title': name,
Expand Down
2 changes: 2 additions & 0 deletions pygeoapi/provider/xarray_.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ def get_fields(self):
dtype = value.dtype
if dtype.name.startswith('float'):
dtype = 'number'
elif dtype.name.startswith('int'):
dtype = 'integer'

self._fields[key] = {
'type': dtype,
Expand Down

0 comments on commit 3bdeefe

Please sign in to comment.