Created
February 5, 2014 19:39
-
-
Save awentzonline/8831416 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class SpaceS(PolymorphicS): | |
| def process_filter_geo_polygon(self, key, val, action): | |
| return { | |
| "geo_polygon": { | |
| key: { | |
| "points":[dict(lat=y, lon=x) for x, y in val] | |
| } | |
| } | |
| } | |
| def process_filter_geo_quad(self, key, val, action): | |
| x0, y0, size = val | |
| return self.process_filter_geo_polygon( | |
| key, | |
| ((x0, y0), (x0 + size, y0), (x0 + size, y0 + size), (x0, y0 + size)), | |
| action | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment