From 3bdeefe4e778ff5a0fd55637fc82a57a00bd0326 Mon Sep 17 00:00:00 2001 From: Leo Ghignone Date: Wed, 16 Oct 2024 06:49:15 +1100 Subject: [PATCH] Properly support int variables of any width (#1829) --- pygeoapi/provider/rasterio_.py | 2 ++ pygeoapi/provider/xarray_.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pygeoapi/provider/rasterio_.py b/pygeoapi/provider/rasterio_.py index 261754c1d..3b0fbc2c7 100644 --- a/pygeoapi/provider/rasterio_.py +++ b/pygeoapi/provider/rasterio_.py @@ -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, diff --git a/pygeoapi/provider/xarray_.py b/pygeoapi/provider/xarray_.py index ba835f033..9ed2726b1 100644 --- a/pygeoapi/provider/xarray_.py +++ b/pygeoapi/provider/xarray_.py @@ -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,