Add support for bottomLeft cornerOfOrigin#173
Closed
gdh12 wants to merge 2 commits intodevelopmentseed:mainfrom
Closed
Add support for bottomLeft cornerOfOrigin#173gdh12 wants to merge 2 commits intodevelopmentseed:mainfrom
gdh12 wants to merge 2 commits intodevelopmentseed:mainfrom
Conversation
Member
|
Hi @gdh12 I hope you understand 🙏 |
Closed
| top = origin_y + (t.y + 1) * matrix.cellSize * matrix.tileHeight | ||
| else: | ||
| top = origin_y - t.y * matrix.cellSize * matrix.tileHeight | ||
| bottom = origin_y - (t.y + 1) * matrix.cellSize * matrix.tileHeight |
Member
There was a problem hiding this comment.
in #191 I didn't implement this because I'm not sure to understand why it was needed
Member
|
done in #191 🙏 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds support for bottomLeft cornerOfOrigin.
cornerOfOrigin is specified in the OGC Two Dimensional Tile Matrix Set 2.0 specification and within the TileMatrix object model but is not currently handled anywhere in the morecantile code. This could be supported potentially "better" by through a refactor of the code that takes into account direction the matrix is heading instead of using if statements everywhere but instead I opted to add onto the API instead of introducing breaking changes.
This is tested by adding a bunch of unit tests for various zoom levels and tiles but also by creating a new TileMatrixSet I called "WebMercatorQuadBottomLeft" which is just WebMercatorQuad but starts bottom left. WebMercatorQuadBottomLeft is loaded automatically using a session autouse=True fixture to load it into the tms registry. Testing this required adding arguments a bunch of tests to taken in the tile identifier as an pytest argument so as not to duplicate code too much.
I would not consider myself an expert on the OGC tile specification so any feedback or concerns would be appreciated.
Functions added
ur,_ur,ll, and_llulandlrsince those are new origin points.origin_coords_origin_coords,origin_coords_across, and_origin_coords_acrossulfor any code that makes use of morecantile when figuring out where to start their tile placement fromtranslate_cornerOfOrigin_TiletoTileMatrixFunctions api changed
TileMatrixSet.custompoint_of_originandcorner_of_originas optional kwargs which were previously being ignored