-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
support 'tms' tile scheme #2565
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Hi, I'm using mbtiles, but i find the tool i used to translate google xyz to tms schema does not use
Math.pow(2, this.z) - this.y - 1
, butMath.pow(2, this.z - 1) - this.y - 1
. I konw that tms's original is (-180, -90), and xyz's original is (-180, 90), so it is easy to understandMath.pow(2, this.z - 1) - this.y - 1
.Can somebody tell me how does
Math.pow(2, this.z) - this.y - 1
works and which is right method?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.
Can you provide a link to the tool you are using?
With quick websearch I only found the transformation in use:
https://gist.github.com/tmcw/4954720
http://bl.ocks.org/lennepkade/b6fe9e4862668b2d19fe26f6c2d7cbef
https://alastaira.wordpress.com/2011/07/06/converting-tms-tile-coordinates-to-googlebingosm-tile-coordinates/
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've red the 3rd blog and learned that i misunderstood the map tile method. So we transfer the world to a square using Web Mercator system, and we can get the total tile number which can be described as (1 << zoom - 1).
Now I guess it is the coordinate system i'm using cause the problem. In fact, i transformed a map to mbtiles which is projected to
EPSG:4326
(WGS84) . But as we know mbtiles spec using tms and mercator projection. That might need to be supported by a projection-customized mapbox-gl.Thanks for your help! :) 👍