-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
U-NORTHAMERICA\taheroux
authored and
U-NORTHAMERICA\taheroux
committed
Apr 4, 2014
1 parent
d43b2c0
commit b54bca7
Showing
2 changed files
with
15 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
QuadKey | ||
======= | ||
|
||
Quad key object used for Geospatial segmentation | ||
Quad key object used for Geospatial segmentation. Based off the idea of a quadtree and used as the Bing Maps tile system. | ||
|
||
Given a (lat, lon) and level produce a quadkey to be used in Bing Maps. | ||
Can also supply methods to generate a Google Maps TileXYZ | ||
|
||
Built off of the TileSystem static class outlined here: http://msdn.microsoft.com/en-us/library/bb259689.aspx | ||
|
||
Converts a lat,lon to pixel space to tile space to a quadkey | ||
|
||
|
||
from quadkey import QuadKey | ||
|
||
qk = QuadKey((-105, 40) 17) | ||
qk = QuadKey.from_geo((-105, 40), 17) | ||
print qk.key # => 02310101232121212 | ||
assert qk.level is 17 | ||
copy = QuadKey.from_str(qk.key) | ||
tile = qk.to_tile() # => [(x, y), z] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters