Skip to content

Make tile service GoogleMaps-Compatible when the cog file is GoogleMapsCompatible #1637

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

Closed
wants to merge 8 commits into from

Conversation

sharkAndshark
Copy link
Collaborator

@sharkAndshark sharkAndshark commented Dec 30, 2024

GDAL provides an interesting option when creating COG, TILING_SCHEME=[CUSTOM​/​GoogleMapsCompatible​/​...]

The goal of this PR is to allow frontend could use the googlemaps-compatible cog without extra steps(like make a custom tile grid), as google tilling schema seems is the most widely used schema, almost every JS lib support it( even only support it.)

LIke if we hanve a tiff file which is from zoom 0 - zoom 5 and it's googlemaps-compatible.

So there is a mapping from tiff-internal-xyz to google-map-xyz, I'm wondering if we could take this mapping and pretending that it's a tile source which use google tilling schema.

A sample like below:

tiff ifd number zoom level zoom level in google maps
0 5 14
1 4 13
2 3 12
3 2 11
.... .... ....

Update the tilejson

To implement this, we could update the tilejson

{
    ...,
    // tell user the zoom level is  from 9-14 instead of 0-5 
   "min_zoom": 9, 
   "max_zoom": 14,
    ...
}

Convert the user requested zxy internally

To implement this, we could transform the resquested xyz to the actuall xyz of tiff tile

user requested the actual zxy internally
/14/0/0 /5/4/3
.... ....

@sharkAndshark
Copy link
Collaborator Author

Still a concept proofing draft.

@maplibre maplibre locked and limited conversation to collaborators Dec 30, 2024
@maplibre maplibre unlocked this conversation Dec 30, 2024
@sharkAndshark sharkAndshark changed the title Make COG GoogleMaps-Compatible when it's GoogleMapsCompatible Make tile service GoogleMaps-Compatible when the cog file is GoogleMapsCompatible Dec 30, 2024
@sharkAndshark
Copy link
Collaborator Author

More tests should be added and a lot of cleanup is needed.

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.

1 participant