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

Add tms parameter to cli for MosaicJSON #233

Merged
merged 11 commits into from
Oct 4, 2024

Conversation

AndrewAnnex
Copy link
Contributor

I've added the TMS as an optional string parameter (either a path to json or an id morecantile can look up) to most of the mosaic json cli functions. This also now changes the default tms to always be specified to at least WebMercatorQuad although I haven't worked out the best option for serialization of the the tms in the mosaic json output, but likely dumping the full tms to json is best. Likely a lot of corner cases are present here I haven't thought of so consider this a WIP and I would love help getting this in.

features = get_footprints(urls, max_threads=max_threads, quiet=quiet)
features = get_footprints(
urls, max_threads=max_threads, tms=tilematrixset, quiet=quiet
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tms will default to WebMercatorQuad directly in the get_footprints method

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure what you wanted changed here and in related comments. Do you want to add an inline comment?

features,
minzoom=minzoom,
maxzoom=maxzoom,
tilematrixset=tilematrixset,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if None, tms will default to WebMercatorQuad directly in the _create_mosaic method

@vincentsarago
Copy link
Member

The tests fails because now the CLI will add tilematrixset into the MosaicJSON (while before we were not setting it in the mosaicJSON, assuming None meant WebMercatorQuad)

I need to think a bit more about this

@@ -92,6 +108,7 @@ def create(
quadkey_zoom=quadkey_zoom,
minimum_tile_cover=min_tile_cover,
tile_cover_sort=tile_cover_sort,
tilematrixset=tilematrixset,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the default will be None and will only be set when passing --tms ...

internally, cogeo-mosaic will default to WebMercatorQuad but without setting it in the MosaicJSON file

@vincentsarago
Copy link
Member

@AndrewAnnex I've made some change to keep it compatible with older version.

It would be nice to have some tests with non-Earth TMS to validate things 🙏

@AndrewAnnex
Copy link
Contributor Author

@AndrewAnnex I've made some change to keep it compatible with older version.

It would be nice to have some tests with non-Earth TMS to validate things 🙏

will do

@vincentsarago vincentsarago merged commit b862d48 into developmentseed:main Oct 4, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants