-
Notifications
You must be signed in to change notification settings - Fork 3
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
WMTSCapabilitiesGenerator (fix for various CRS default values) #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great @alonakos ! I couldn't getting it working with either of the following tests:
generator = WMTSCapabilitiesGenerator(
title="This is the title",
base_url="https://example.com",
doi="doi:10.0000/00000000",
layer_title="layer_title",
layer_identifier="layer_identifier",
bounding_box=None,
tile_format=".png",
tile_matrix_set_id="WorldCRS84Quad",
tile_width=128,
tile_height=128,
max_z_level=3
)
generator = WMTSCapabilitiesGenerator(
title="This is the title",
base_url="https://example.com",
doi="doi:10.5066/F7VQ30RM",
layer_title="layer_title",
layer_identifier="layer_identifier",
bounding_box=None,
tile_format=".png",
tile_matrix_set_id="WorldCRS84Quad",
tile_width=128,
tile_height=128,
max_z_level=3
)
I see the error:
Traceback (most recent call last):
File "/Users/robyn/.vscode/extensions/ms-python.python-2024.22.2-darwin-arm64/python_files/python_server.py", line 133, in exec_user_input
retval = callable_(user_input, user_globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 1, in <module>
File "<string>", line 99, in __init__
File "/Users/robyn/code/viz-raster/.venv/lib/python3.12/site-packages/pydantic/main.py", line 891, in __getattr__
raise AttributeError(f'{type(self).__name__!r} object has no attribute {item!r}')
AttributeError: 'TileMatrixSet' object has no attribute 'supportedCRS'
Is there something I'm doing wrong?
tile_width=128, | ||
tile_height=128, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we decided that tile width and height should come from the TMS definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thank you! I updated it to use morecantile
tms values
title="This is the title", | ||
base_url="https://example.com", | ||
doi="doi:10.5066/F7VQ30RM", | ||
layer_title="layer_title", | ||
layer_identifier="layer_identifier", | ||
bounding_box=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that you changed the example to hard-coded values 👍🏻 ! Makes it much more useful for people reading the docs.
This is the |
updated the code for the latest morecantile version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to make a couple follow-up issues for some potential improvements but otherwise LGTM! 👍🏻
switched wellKnownScaleSet and crs_url from defaults to morecantile values