diff --git a/quadkey/__init__.py b/quadkey/__init__.py index 4998190..7090252 100644 --- a/quadkey/__init__.py +++ b/quadkey/__init__.py @@ -54,6 +54,13 @@ def area(self): def to_tile(self): return TileSystem.quadkey_to_tile(self.key) + def to_geo(self): + ret = TileSystem.quadkey_to_tile(self.key) + tile = ret[0] + lvl = ret[1] + pixel = TileSystem.tile_to_pixel(tile) + return TileSystem.pixel_to_geo(pixel, lvl) + def __eq__(self, other): return self.key == other.key @@ -79,3 +86,7 @@ def from_geo(geo, level): tile = TileSystem.pixel_to_tile(pixel) key = TileSystem.tile_to_quadkey(tile, level) return QuadKey(key) + + @staticmethod + def from_tile(tile, level): + return QuadKey(TileSystem.tile_to_quadkey(tile, level)) diff --git a/setup.py b/setup.py index 24ffdae..9276af4 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup setup(name="quadkey", - version="0.0.1", + version="0.0.3", description="Python Implementation for Geospatial Quadkeys", author="Buck Heroux", url="https://github.com/buckheroux/QuadKey",