From 533151831cac3790de0c478a9e009a6ec517dc1c Mon Sep 17 00:00:00 2001 From: Benjamin Webb <40066515+webb-ben@users.noreply.github.com> Date: Tue, 16 Jul 2024 12:42:33 -0400 Subject: [PATCH] Add CRS transform to remaining providers (#1729) * Add CRS transform to remaining providers * Update tinydb_.py --------- Co-authored-by: Tom Kralidis --- docs/source/data-publishing/ogcapi-features.rst | 4 ++-- pygeoapi/provider/erddap.py | 3 +++ pygeoapi/provider/tinydb_.py | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/source/data-publishing/ogcapi-features.rst b/docs/source/data-publishing/ogcapi-features.rst index 32e657de7..ad84adea1 100644 --- a/docs/source/data-publishing/ogcapi-features.rst +++ b/docs/source/data-publishing/ogcapi-features.rst @@ -21,7 +21,7 @@ parameters. `CSV`_,✅/✅,results/hits,❌,❌,❌,✅,❌,❌,✅ `Elasticsearch`_,✅/✅,results/hits,✅,✅,✅,✅,✅,✅,✅ - `ERDDAP Tabledap Service`_,❌/❌,results/hits,✅,✅,❌,❌,❌,❌,❌ + `ERDDAP Tabledap Service`_,❌/❌,results/hits,✅,✅,❌,❌,❌,❌,✅ `ESRI Feature Service`_,✅/✅,results/hits,✅,✅,✅,✅,❌,❌,✅ `GeoJSON`_,✅/✅,results/hits,❌,❌,❌,✅,❌,❌,✅ `MongoDB`_,✅/❌,results,✅,✅,✅,✅,❌,❌,✅ @@ -31,7 +31,7 @@ parameters. `SQLiteGPKG`_,✅/❌,results/hits,✅,❌,❌,✅,❌,❌,✅ `SensorThings API`_,✅/✅,results/hits,✅,✅,✅,✅,❌,❌,✅ `Socrata`_,✅/✅,results/hits,✅,✅,✅,✅,❌,❌,✅ - `TinyDB`_,✅/✅,results/hits,✅,✅,✅,✅,❌,✅,❌ + `TinyDB`_,✅/✅,results/hits,✅,✅,✅,✅,❌,✅,✅ .. note:: diff --git a/pygeoapi/provider/erddap.py b/pygeoapi/provider/erddap.py index a81876e1f..392ad24ec 100644 --- a/pygeoapi/provider/erddap.py +++ b/pygeoapi/provider/erddap.py @@ -51,6 +51,7 @@ from pygeoapi.provider.base import ( BaseProvider, ProviderNotFoundError, ProviderQueryError) +from pygeoapi.util import crs_transform LOGGER = logging.getLogger(__name__) @@ -80,6 +81,7 @@ def get_fields(self): return properties + @crs_transform def query(self, offset=0, limit=10, resulttype='results', bbox=[], datetime_=None, properties=[], sortby=[], select_properties=[], skip_geometry=False, q=None, @@ -164,6 +166,7 @@ def query(self, offset=0, limit=10, resulttype='results', 'numberReturned': returned } + @crs_transform def get(self, identifier, **kwargs): query_params = [] diff --git a/pygeoapi/provider/tinydb_.py b/pygeoapi/provider/tinydb_.py index e46730aba..393ed2108 100644 --- a/pygeoapi/provider/tinydb_.py +++ b/pygeoapi/provider/tinydb_.py @@ -38,7 +38,7 @@ from pygeoapi.provider.base import (BaseProvider, ProviderConnectionError, ProviderItemNotFoundError) -from pygeoapi.util import get_typed_value +from pygeoapi.util import crs_transform, get_typed_value LOGGER = logging.getLogger(__name__) @@ -116,6 +116,7 @@ def get_fields(self): return fields + @crs_transform def query(self, offset=0, limit=10, resulttype='results', bbox=[], datetime_=None, properties=[], sortby=[], select_properties=[], skip_geometry=False, q=None, **kwargs): @@ -234,6 +235,7 @@ def query(self, offset=0, limit=10, resulttype='results', return feature_collection + @crs_transform def get(self, identifier, **kwargs): """ Get TinyDB document by id