Add support for bottomLeft cornerOfOrigin #173
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_ll
ul
andlr
since those are new origin points.origin_coords
_origin_coords
,origin_coords_across
, and_origin_coords_across
ul
for any code that makes use of morecantile when figuring out where to start their tile placement fromtranslate_cornerOfOrigin_Tile
toTileMatrix
Functions api changed
TileMatrixSet.custom
point_of_origin
andcorner_of_origin
as optional kwargs which were previously being ignored