diff --git a/pygeoapi/provider/azure_.py b/pygeoapi/provider/azure_.py index e8a1052..42bd5c1 100644 --- a/pygeoapi/provider/azure_.py +++ b/pygeoapi/provider/azure_.py @@ -277,7 +277,11 @@ def _describe_file(filepath): with MemoryFile(filepath) as memfile: with memfile.open() as d: scrs = CRS(d.crs) - if scrs.to_epsg() not in [None, 4326]: + LOGGER.debug(f'CRS: {d.crs}') + LOGGER.debug(f'bounds: {d.bounds}') + LOGGER.debug(f'Is geographic: {scrs.is_geographic}') + if not scrs.is_geographic: + LOGGER.debug('Reprojecting coordinates') tcrs = CRS.from_epsg(4326) bnds = transform_bounds(scrs, tcrs, d.bounds[0], d.bounds[1], @@ -309,7 +313,11 @@ def _describe_file(filepath): LOGGER.debug('Testing vector data detection') d = fiona.open(filepath) scrs = CRS(d.crs) - if scrs.to_epsg() not in [None, 4326]: + LOGGER.debug(f'CRS: {d.crs}') + LOGGER.debug(f'bounds: {d.bounds}') + LOGGER.debug(f'Is geographic: {scrs.is_geographic}') + if not scrs.is_geographic: + LOGGER.debug('Reprojecting coordinates') tcrs = CRS.from_epsg(4326) bnds = transform_bounds(scrs, tcrs, d.bounds[0], d.bounds[1], diff --git a/pygeoapi/provider/elasticsearch_.py b/pygeoapi/provider/elasticsearch_.py index 3aaf01a..fc026af 100644 --- a/pygeoapi/provider/elasticsearch_.py +++ b/pygeoapi/provider/elasticsearch_.py @@ -359,7 +359,7 @@ class ElasticsearchProvider(BaseProvider): result = self.es.get(index=self.index_name, id=identifier) LOGGER.debug('Serializing feature') feature_ = self.esdoc2geojson(result) - except exceptions.NotFoundError as err: + except Exception as err: LOGGER.debug(f'Not found via ES id query: {err}') LOGGER.debug('Trying via a real query') @@ -368,13 +368,14 @@ class ElasticsearchProvider(BaseProvider): 'bool': { 'filter': [{ 'match_phrase': { - 'id': identifier + '_id': identifier } }] } } } + LOGGER.debug(f'Query: {query}') try: result = self.es.search(index=self.index_name, **query) if len(result['hits']['hits']) == 0: diff --git a/pygeoapi/provider/filesystem.py b/pygeoapi/provider/filesystem.py index 139c868..db2a824 100644 --- a/pygeoapi/provider/filesystem.py +++ b/pygeoapi/provider/filesystem.py @@ -271,7 +271,11 @@ def _describe_file(filepath): LOGGER.debug('Testing raster data detection') d = rasterio.open(filepath) scrs = CRS(d.crs) - if scrs.to_epsg() not in [None, 4326]: + LOGGER.debug(f'CRS: {d.crs}') + LOGGER.debug(f'bounds: {d.bounds}') + LOGGER.debug(f'Is geographic: {scrs.is_geographic}') + if not scrs.is_geographic: + LOGGER.debug('Reprojecting coordinates') tcrs = CRS.from_epsg(4326) bnds = transform_bounds(scrs, tcrs, d.bounds[0], d.bounds[1], @@ -301,8 +305,14 @@ def _describe_file(filepath): try: LOGGER.debug('Testing vector data detection') d = fiona.open(filepath) + LOGGER.debug(f'CRS: {d.crs}') + LOGGER.debug(f'bounds: {d.bounds}') scrs = CRS(d.crs) - if scrs.to_epsg() not in [None, 4326]: + LOGGER.debug(f'CRS: {d.crs}') + LOGGER.debug(f'bounds: {d.bounds}') + LOGGER.debug(f'Is geographic: {scrs.is_geographic}') + if not scrs.is_geographic: + LOGGER.debug('Reprojecting coordinates') tcrs = CRS.from_epsg(4326) bnds = transform_bounds(scrs, tcrs, d.bounds[0], d.bounds[1],