-
Notifications
You must be signed in to change notification settings - Fork 25
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 support for variable TMS #131
Conversation
@cached_property | ||
def is_quadtree(self) -> bool: | ||
"""Check for quadtree support.""" | ||
return check_quadkey_support(self.tileMatrices) |
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.
using cached property is recommended by pydantic
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.
Also, this decorator requires that the dict attribute on each instance be a mutable mapping. This means it will not work with some types, such as metaclasses (since the dict attributes on type instances are read-only proxies for the class namespace), and those that specify slots without including dict as one of the defined slots (as such classes don’t provide a dict attribute at all).
Maybe we should check ☝️
origin_y = ( | ||
matrix.pointOfOrigin[0] if self._invert_axis else matrix.pointOfOrigin[1] | ||
) | ||
return Coords(origin_x, origin_y) |
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.
reduce code duplication
xcoord = origin_x + t.x * res * matrix.tileWidth | ||
ycoord = origin_y - t.y * res * matrix.tileHeight | ||
return Coords(xcoord, ycoord) | ||
def _lr(self, *tile: Tile) -> Coords: |
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.
it's better to use lower-right
coordinates than upper-right
of tile + 1
closes #115
ToDo