Skip to content

Commit e161684

Browse files
Buck HerouxBuck Heroux
authored andcommitted
added to/from on QuadKey
1 parent b54bca7 commit e161684

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

quadkey/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ def area(self):
5454
def to_tile(self):
5555
return TileSystem.quadkey_to_tile(self.key)
5656

57+
def to_geo(self):
58+
ret = TileSystem.quadkey_to_tile(self.key)
59+
tile = ret[0]
60+
lvl = ret[1]
61+
pixel = TileSystem.tile_to_pixel(tile)
62+
return TileSystem.pixel_to_geo(pixel, lvl)
63+
5764
def __eq__(self, other):
5865
return self.key == other.key
5966

@@ -79,3 +86,7 @@ def from_geo(geo, level):
7986
tile = TileSystem.pixel_to_tile(pixel)
8087
key = TileSystem.tile_to_quadkey(tile, level)
8188
return QuadKey(key)
89+
90+
@staticmethod
91+
def from_tile(tile, level):
92+
return QuadKey(TileSystem.tile_to_quadkey(tile, level))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from setuptools import setup
44

55
setup(name="quadkey",
6-
version="0.0.1",
6+
version="0.0.3",
77
description="Python Implementation for Geospatial Quadkeys",
88
author="Buck Heroux",
99
url="https://github.com/buckheroux/QuadKey",

0 commit comments

Comments
 (0)