diff --git a/README.md b/README.md index 76de15f..e4f5bae 100644 --- a/README.md +++ b/README.md @@ -36,8 +36,8 @@ Pip installation is only tested for Linux and Mac, yet. If you encounter problem ### From archive ```bash -$ wget https://github.com/muety/pyquadkey2/releases/download/0.3.0/pyquadkey2-0.3.0.tar.gz -$ pip install pyquadkey2-0.3.0.tar.gz +$ wget https://github.com/muety/pyquadkey2/releases/download/0.3.1/pyquadkey2-0.3.1.tar.gz +$ pip install pyquadkey2-0.3.1.tar.gz ``` ### From source diff --git a/docs/installation.md b/docs/installation.md index fcae2c7..c8a41a8 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -12,8 +12,8 @@ Pip installation is only tested for Linux and Mac, yet. If you encounter problem ### From archive ```bash -$ wget https://github.com/muety/pyquadkey2/releases/download/0.3.0/pyquadkey2-0.3.0.tar.gz -$ pip install pyquadkey2-0.3.0.tar.gz +$ wget https://github.com/muety/pyquadkey2/releases/download/0.3.1/pyquadkey2-0.3.1.tar.gz +$ pip install pyquadkey2-0.3.1.tar.gz ``` ### From source diff --git a/setup.py b/setup.py index a932936..264d8d8 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ setup( name='pyquadkey2', - version='0.3.0', + version='0.3.1', description='Python implementation of geographical tiling using QuadKeys as proposed by Microsoft', long_description=long_description, long_description_content_type='text/markdown', diff --git a/src/pyquadkey2/quadkey/tilesystem/tilesystem.pyx b/src/pyquadkey2/quadkey/tilesystem/tilesystem.pyx index ca57d8d..35e5f76 100644 --- a/src/pyquadkey2/quadkey/tilesystem/tilesystem.pyx +++ b/src/pyquadkey2/quadkey/tilesystem/tilesystem.pyx @@ -60,7 +60,7 @@ cpdef (double, double) pixel_to_geo((double, double) pixel, const long level): y = 0.5 - (clip(pixel_y, (0, ms - 1)) / ms) lat = 90 - 360 * math.atan(math.exp(-y * 2 * math.pi)) / math.pi lon = 360 * x - return math.round(lat * 1e12) / 1e12, math.round(lon * 1e12) / 1e12 + return int(lat * 1e12) / 1e12, int(lon * 1e12) / 1e12 cpdef (long, long) pixel_to_tile(const (long, long) pixel): return pixel[0] // 256, pixel[1] // 256 diff --git a/tests/test_quadkey.py b/tests/test_quadkey.py index 846d65f..9f058b7 100644 --- a/tests/test_quadkey.py +++ b/tests/test_quadkey.py @@ -26,6 +26,7 @@ def testInitInvalidKey(self): def testFromGeo(self): self.assertEqual('1202032333311320', quadkey.from_geo((49.014205, 8.420025), 16).key) + self.assertEqual('311213', quadkey.from_geo((-27.052395, 152.97702), 6).key) # https://github.com/muety/pyquadkey2/issues/13 def testFromGeoInvalidLevel(self): with self.assertRaises(AssertionError):