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

Error in tile metadata during exercise 4 #106

Closed
richardcornelissen opened this issue Nov 14, 2023 · 3 comments
Closed

Error in tile metadata during exercise 4 #106

richardcornelissen opened this issue Nov 14, 2023 · 3 comments

Comments

@richardcornelissen
Copy link

What version of Python are you using? Whatever is installed on docker image geopython/pygeoapi:latest
What operating system are you using? Windows 11 64 bit
Which version or versions of the software are you using?

  • Docker version 24.0.6, build ed223bc
  • Docker Compose version v2.22.0-desktop.2

How can the we recreate your problem? Imagine that we have never used the Diving into pygeoapi workshop before and have downloaded it for the first time. Exactly what steps do we need to take to reproduce your problem?

C:\Projects\pygeoapi-trial\workshop\exercises> docker run -it --rm -v .\data:/data emotionalcities/tippecanoe tippecanoe --output-to-directory=/data/tiles/ --force --maximum-zoom=16 --drop-densest-as-needed --extend-zooms-if-still-dropping --no-tile-compression /data/cycle-lanes-firenze.geojson
For layer 0, using name "cyclelanesfirenze"
/data/cycle-lanes-firenze.geojson:6: ignoring dimensions beyond two
In JSON object [11.305009255881071,43.752250927369978,58.216000765673471]
In JSON object {"type":"Feature","properties":{"accicid":"acCicId_342","acciccon":"01","acciccon_d":"reale","accic_c":"AcCic-c_1","accicpos":"02","accicpos_d":"su sede stradale","accic_lung":227.77324830329036},"geometry":{"type":"MultiLineString","coordinates":[[[11.305009255881071,43.752250927369978,58.216000765673471],[11.304913042439582,43.751854850642324,58.304001725240354],[11.304897435922136,43.751789349404881,58.354004998991527],[11.304879939854354,43.751717340730373,58.432001301945533],[11.30485693...
1093 features, 89236 bytes of geometry, 62 bytes of separate metadata, 36022 bytes of string pool
  99.9%  16/34824/23890

After restarting pygeoapi, opening http://localhost:5000/collections/Cycle/tiles/WorldCRS84Quad/metadata results in an HTTP 500 Internal server error. Pygeoapi logs the following errors:

pygeoapi  | [2023-11-14T14:09:00Z] {/usr/local/lib/python3.10/dist-packages/flask/app.py:825} ERROR - Exception on /collections/Cycle/tiles/WorldCRS84Quad/metadata [GET]
pygeoapi  | Traceback (most recent call last):
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1455, in wsgi_app
pygeoapi  |     response = self.full_dispatch_request()
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 869, in full_dispatch_request
pygeoapi  |     rv = self.handle_user_exception(e)
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask_cors/extension.py", line 176, in wrapped_function
pygeoapi  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 867, in full_dispatch_request
pygeoapi  |     rv = self.dispatch_request()
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 852, in dispatch_request
pygeoapi  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
pygeoapi  |   File "/pygeoapi/pygeoapi/flask_app.py", line 298, in get_collection_tiles_metadata
pygeoapi  |     return get_response(api_.get_collection_tiles_metadata(
pygeoapi  |   File "/pygeoapi/pygeoapi/api.py", line 221, in inner
pygeoapi  |     headers, status, content = func(*args, **kwargs)
pygeoapi  |   File "/pygeoapi/pygeoapi/api.py", line 203, in inner
pygeoapi  |     return func(cls, req_out, *args[2:])
pygeoapi  |   File "/pygeoapi/pygeoapi/linked_data.py", line 60, in inner
pygeoapi  |     return func(*args, **kwargs)
pygeoapi  |   File "/pygeoapi/pygeoapi/api.py", line 2970, in get_collection_tiles_metadata
pygeoapi  |     tiles_metadata = p.get_metadata(
pygeoapi  |   File "/pygeoapi/pygeoapi/provider/mvt.py", line 283, in get_metadata
pygeoapi  |     content = MVTTilesJson(**metadata_json_content)
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/pydantic/main.py", line 164, in __init__
pygeoapi  |     __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pygeoapi  | pydantic_core._pydantic_core.ValidationError: 3 validation errors for MVTTilesJson
pygeoapi  | tiles
pygeoapi  |   Field required [type=missing, input_value={'name': '/data/tiles/', ... sede stradale"]}]}]}}'}, input_type=dict]
pygeoapi  |     For further information visit https://errors.pydantic.dev/2.4/v/missing
pygeoapi  | attribution
pygeoapi  |   Field required [type=missing, input_value={'name': '/data/tiles/', ... sede stradale"]}]}]}}'}, input_type=dict]
pygeoapi  |     For further information visit https://errors.pydantic.dev/2.4/v/missing
pygeoapi  | vector_layers
pygeoapi  |   Field required [type=missing, input_value={'name': '/data/tiles/', ... sede stradale"]}]}]}}'}, input_type=dict]
pygeoapi  |     For further information visit https://errors.pydantic.dev/2.4/v/missing
pygeoapi  | [2023-11-14T14:15:02Z] {/usr/local/lib/python3.10/dist-packages/flask/app.py:825} ERROR - Exception on /collections/Cycle/tiles/WorldCRS84Quad/metadata [GET]
pygeoapi  | Traceback (most recent call last):
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 1455, in wsgi_app
pygeoapi  |     response = self.full_dispatch_request()
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 869, in full_dispatch_request
pygeoapi  |     rv = self.handle_user_exception(e)
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask_cors/extension.py", line 176, in wrapped_function
pygeoapi  |     return cors_after_request(app.make_response(f(*args, **kwargs)))
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 867, in full_dispatch_request
pygeoapi  |     rv = self.dispatch_request()
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/flask/app.py", line 852, in dispatch_request
pygeoapi  |     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
pygeoapi  |   File "/pygeoapi/pygeoapi/flask_app.py", line 298, in get_collection_tiles_metadata
pygeoapi  |     return get_response(api_.get_collection_tiles_metadata(
pygeoapi  |   File "/pygeoapi/pygeoapi/api.py", line 221, in inner
pygeoapi  |     headers, status, content = func(*args, **kwargs)
pygeoapi  |   File "/pygeoapi/pygeoapi/api.py", line 203, in inner
pygeoapi  |     return func(cls, req_out, *args[2:])
pygeoapi  |   File "/pygeoapi/pygeoapi/linked_data.py", line 60, in inner
pygeoapi  |     return func(*args, **kwargs)
pygeoapi  |   File "/pygeoapi/pygeoapi/api.py", line 2970, in get_collection_tiles_metadata
pygeoapi  |     tiles_metadata = p.get_metadata(
pygeoapi  |   File "/pygeoapi/pygeoapi/provider/mvt.py", line 283, in get_metadata
pygeoapi  |     content = MVTTilesJson(**metadata_json_content)
pygeoapi  |   File "/usr/local/lib/python3.10/dist-packages/pydantic/main.py", line 164, in __init__
pygeoapi  |     __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pygeoapi  | pydantic_core._pydantic_core.ValidationError: 3 validation errors for MVTTilesJson
pygeoapi  | tiles
pygeoapi  |   Field required [type=missing, input_value={'name': '/data/tiles/', ... sede stradale"]}]}]}}'}, input_type=dict]
pygeoapi  |     For further information visit https://errors.pydantic.dev/2.4/v/missing
pygeoapi  | attribution
pygeoapi  |   Field required [type=missing, input_value={'name': '/data/tiles/', ... sede stradale"]}]}]}}'}, input_type=dict]
pygeoapi  |     For further information visit https://errors.pydantic.dev/2.4/v/missing
pygeoapi  | vector_layers
pygeoapi  |   Field required [type=missing, input_value={'name': '/data/tiles/', ... sede stradale"]}]}]}}'}, input_type=dict]
pygeoapi  |     For further information visit https://errors.pydantic.dev/2.4/v/missing

Screenshot

image

@pvgenuchten
Copy link
Contributor

thanx for reporting @richardcornelissen, we'll have a look

@doublebyte1
Copy link
Contributor

doublebyte1 commented Dec 7, 2023

@richardcornelissen thanks for flagging this! It is, in fact a regression and it should be addressed with this PR: geopython/pygeoapi#1421

@doublebyte1
Copy link
Contributor

@richardcornelissen I will close this as solved. Feel free to open it, if the PR did not fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants