fix various deprecation warnings (#1761)

This commit is contained in:
Tom Kralidis
2024-07-25 14:13:20 -04:00
committed by GitHub
parent b712cb2695
commit 0a7bb7f5f4
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ from http import HTTPStatus
import logging
from typing import Tuple
from shapely.errors import WKTReadingError
from shapely.errors import ShapelyError
from shapely.wkt import loads as shapely_loads
from pygeoapi.plugin import load_plugin, PLUGINS
@@ -124,7 +124,7 @@ def get_collection_edr_query(api: API, request: APIRequest,
if wkt:
try:
wkt = shapely_loads(wkt)
except WKTReadingError:
except ShapelyError:
msg = 'invalid coords parameter'
return api.get_exception(
HTTPStatus.BAD_REQUEST, headers, request.format,
+4 -4
View File
@@ -81,14 +81,14 @@ class XarrayEDRProvider(BaseEDRProvider, XarrayProvider):
wkt = kwargs.get('wkt')
if wkt is not None:
LOGGER.debug('Processing WKT')
LOGGER.debug(f'Geometry type: {wkt.type}')
if wkt.type == 'Point':
LOGGER.debug(f'Geometry type: {wkt.geom_type}')
if wkt.geom_type == 'Point':
query_params[self._coverage_properties['x_axis_label']] = wkt.x
query_params[self._coverage_properties['y_axis_label']] = wkt.y
elif wkt.type == 'LineString':
elif wkt.geom_type == 'LineString':
query_params[self._coverage_properties['x_axis_label']] = wkt.xy[0] # noqa
query_params[self._coverage_properties['y_axis_label']] = wkt.xy[1] # noqa
elif wkt.type == 'Polygon':
elif wkt.geom_type == 'Polygon':
query_params[self._coverage_properties['x_axis_label']] = slice(wkt.bounds[0], wkt.bounds[2]) # noqa
query_params[self._coverage_properties['y_axis_label']] = slice(wkt.bounds[1], wkt.bounds[3]) # noqa
pass