Skip to content

Instantly share code, notes, and snippets.

@awentzonline
Created February 5, 2014 19:39
Show Gist options
  • Select an option

  • Save awentzonline/8831416 to your computer and use it in GitHub Desktop.

Select an option

Save awentzonline/8831416 to your computer and use it in GitHub Desktop.
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