Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key-error when requesting map in non supported crs code #1648

Closed
pvgenuchten opened this issue May 11, 2024 · 2 comments
Closed

key-error when requesting map in non supported crs code #1648

pvgenuchten opened this issue May 11, 2024 · 2 comments
Labels
enhancement New feature or request stale Issue marked stale by stale-bot

Comments

@pvgenuchten
Copy link
Contributor

pvgenuchten commented May 11, 2024

Is your feature request related to a problem? Please describe.

When requesting a map in epsg:3857 http://localhost:5000/collections/mapserver_world_map/map?f=png&bbox-crs=EPSG:3857&
the follwoing error is displayed:

File "/mnt/c/projects/geopython/lib/python3.10/site-packages/pygeoapi-0.17.dev0-py3.10.egg/pygeoapi/flask_app.py", line 160, in execute_from_flask
headers, status, content = api_function(api_, api_request, *args)
File "/mnt/c/projects/geopython/lib/python3.10/site-packages/pygeoapi-0.17.dev0-py3.10.egg/pygeoapi/api/maps.py", line 160, in get_collection_map
data = p.query(**query_args)
File "/mnt/c/projects/geopython/lib/python3.10/site-packages/pygeoapi-0.17.dev0-py3.10.egg/pygeoapi/provider/wms_facade.py", line 93, in query
LOGGER.debug(f'Output CRS: {CRS_CODES[crs]}')
KeyError: 'EPSG:3857'

the reason is clear, i'm requesting a map in non supported projection, however would be nice to have a better error discription. Seems the bbox is expected as http://www.opengis.net/def/crs/EPSG/0/3857. However when I run this request, a nill image is returned:

https://demo.pygeoapi.io/master/collections/mapserver_world_map/map?f=png&bbox-crs=http://www.opengis.net/def/crs/EPSG/0/3857&service=WMS&request=GetMap&layers=&styles=&format=image%2Fjpeg&transparent=false&version=1.1.1&width=256&height=256&srs=EPSG%3A3857&bbox=-3757032.814272984,3757032.8142729844,-2504688.5428486555,5009377.085697314

in logs the following error is displayed:

[2024-05-11T15:48:02Z] {/mnt/c/projects/geopython/lib/python3.10/site-packages/pygeoapi-0.17.dev0-py3.10.egg/pygeoapi/api/__init__.py:1393} ERROR - query error (check logs)
Traceback (most recent call last):
  File "/mnt/c/projects/geopython/lib/python3.10/site-packages/pygeoapi-0.17.dev0-py3.10.egg/pygeoapi/api/maps.py", line 160, in get_collection_map
    data = p.query(**query_args)
  File "/mnt/c/projects/geopython/lib/python3.10/site-packages/pygeoapi-0.17.dev0-py3.10.egg/pygeoapi/provider/wms_facade.py", line 138, in query
    raise ProviderQueryError(msg)
pygeoapi.provider.base.ProviderQueryError: WMS error: b'<?xml version=\'1.0\' encoding="UTF-8" standalone="no" ?>\n<ServiceExceptionReport version="1.3.0" xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd">\n<ServiceException>\nmsWMSLoadGetMapParams(): WMS server error. Invalid values for BBOX.\n</ServiceException>\n</ServiceExceptionReport>\n'

the wms backend seems to not support the 3857 projection, suggestion here would be to return an error in stead of an empty image

@pvgenuchten pvgenuchten added the enhancement New feature or request label May 11, 2024
Copy link

This Issue has been inactive for 90 days. As per RFC4, in order to manage maintenance burden, it will be automatically closed in 7 days.

@github-actions github-actions bot added the stale Issue marked stale by stale-bot label Aug 11, 2024
Copy link

As per RFC4, this Issue has been closed due to there being no activity for more than 90 days.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale Issue marked stale by stale-bot
Projects
None yet
Development

No branches or pull requests

1 participant