Skip to content

Instantly share code, notes, and snippets.

@bmount
Created October 20, 2013 08:13
Show Gist options
  • Select an option

  • Save bmount/7066320 to your computer and use it in GitHub Desktop.

Select an option

Save bmount/7066320 to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{"type":"FeatureCollection", "features":[{"geometry": {"type": "Polygon", "coordinates": [[[-122.504339996888,
37.7193767126492], [-122.495497432195, 37.7193767126492], [-122.495497432195, 37.7082107884885], [-122.502484000973,
37.7081320002221], [-122.504339996888, 37.7193767126492]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.507021268094, 37.7356214271046], [-122.495497432195, 37.7356214271046],
[-122.495497432195, 37.7193767126492], [-122.504339996888, 37.7193767126492], [-122.507021268094, 37.7356214271046]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.509702539301,
37.75186614156], [-122.495497432195, 37.75186614156], [-122.495497432195, 37.7356214271046], [-122.507021268094,
37.7356214271046], [-122.509702539301, 37.75186614156]]]}, "type": "Feature", "properties": null}, {"geometry": {"type":
"Polygon", "coordinates": [[[-122.512383810508, 37.7681108560153], [-122.495497432195, 37.7681108560153],
[-122.495497432195, 37.75186614156], [-122.509702539301, 37.75186614156], [-122.512383810508, 37.7681108560153]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.504155188697,
37.7843555704707], [-122.495497432195, 37.7843555704707], [-122.495497432195, 37.7681108560153], [-122.512383810508,
37.7681108560153], [-122.514483003624, 37.7808289998102], [-122.504155188697, 37.7843555704707]]]}, "type": "Feature",
"properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.495497432195, 37.7873118773255],
[-122.495497432195, 37.7843555704707], [-122.504155188697, 37.7843555704707], [-122.495497432195, 37.7873118773255]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "GeometryCollection", "geometries": []}, "type":
"Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.495497432195, 37.7082107884885],
[-122.495497432195, 37.7193767126492], [-122.471511860767, 37.7193767126492], [-122.471511860767, 37.7084812762846],
[-122.495497432195, 37.7082107884885]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon",
"coordinates": [[[-122.495497432195, 37.7193767126492], [-122.495497432195, 37.7356214271046], [-122.471511860767,
37.7356214271046], [-122.471511860767, 37.7193767126492], [-122.495497432195, 37.7193767126492]]]}, "type": "Feature",
"properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.495497432195, 37.7356214271046],
[-122.495497432195, 37.75186614156], [-122.471511860767, 37.75186614156], [-122.471511860767, 37.7356214271046],
[-122.495497432195, 37.7356214271046]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon",
"coordinates": [[[-122.495497432195, 37.75186614156], [-122.495497432195, 37.7681108560153], [-122.471511860767,
37.7681108560153], [-122.471511860767, 37.75186614156], [-122.495497432195, 37.75186614156]]]}, "type": "Feature",
"properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.495497432195, 37.7681108560153],
[-122.495497432195, 37.7843555704707], [-122.471511860767, 37.7843555704707], [-122.471511860767, 37.7681108560153],
[-122.495497432195, 37.7681108560153]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon",
"coordinates": [[[-122.399555146481, 37.8006002849261], [-122.399555146481, 37.8030369180729], [-122.396763303819,
37.8006002849261], [-122.399555146481, 37.8006002849261]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.495497432195, 37.7843555704707], [-122.495497432195, 37.7873118773255],
[-122.485783002612, 37.7906289993494], [-122.481676977767, 37.8006002849261], [-122.471511860767, 37.8006002849261],
[-122.471511860767, 37.7843555704707], [-122.495497432195, 37.7843555704707]]]}, "type": "Feature", "properties": null},
{"geometry": {"type": "Polygon", "coordinates": [[[-122.471511860767, 37.8082651089193], [-122.471511860767,
37.8006002849261], [-122.481676977767, 37.8006002849261], [-122.477383002752, 37.8110279985324], [-122.471511860767,
37.8082651089193]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates":
[[[-122.471511860767, 37.7084812762846], [-122.471511860767, 37.7193767126492], [-122.447526289338, 37.7193767126492],
[-122.447526289338, 37.7087517640807], [-122.471511860767, 37.7084812762846]]]}, "type": "Feature", "properties": null},
{"geometry": {"type": "Polygon", "coordinates": [[[-122.471511860767, 37.7193767126492], [-122.471511860767,
37.7356214271046], [-122.447526289338, 37.7356214271046], [-122.447526289338, 37.7193767126492], [-122.471511860767,
37.7193767126492]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates":
[[[-122.471511860767, 37.7356214271046], [-122.471511860767, 37.75186614156], [-122.447526289338, 37.75186614156],
[-122.447526289338, 37.7356214271046], [-122.471511860767, 37.7356214271046]]]}, "type": "Feature", "properties": null},
{"geometry": {"type": "Polygon", "coordinates": [[[-122.471511860767, 37.75186614156], [-122.471511860767,
37.7681108560153], [-122.447526289338, 37.7681108560153], [-122.447526289338, 37.75186614156], [-122.471511860767,
37.75186614156]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates":
[[[-122.471511860767, 37.7681108560153], [-122.471511860767, 37.7843555704707], [-122.447526289338, 37.7843555704707],
[-122.447526289338, 37.7681108560153], [-122.471511860767, 37.7681108560153]]]}, "type": "Feature", "properties": null},
{"geometry": {"type": "Polygon", "coordinates": [[[-122.471511860767, 37.7843555704707], [-122.471511860767,
37.8006002849261], [-122.447526289338, 37.8006002849261], [-122.447526289338, 37.7843555704707], [-122.471511860767,
37.7843555704707]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates":
[[[-122.471511860767, 37.8006002849261], [-122.471511860767, 37.8082651089193], [-122.463783002031, 37.8046279998907],
[-122.447526289338, 37.8064505996308], [-122.447526289338, 37.8006002849261], [-122.471511860767, 37.8006002849261]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.447526289338,
37.7087517640807], [-122.447526289338, 37.7193767126492], [-122.42354071791, 37.7193767126492], [-122.42354071791,
37.7090222518768], [-122.447526289338, 37.7087517640807]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.447526289338, 37.7193767126492], [-122.447526289338, 37.7356214271046],
[-122.42354071791, 37.7356214271046], [-122.42354071791, 37.7193767126492], [-122.447526289338, 37.7193767126492]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.447526289338,
37.7356214271046], [-122.447526289338, 37.75186614156], [-122.42354071791, 37.75186614156], [-122.42354071791,
37.7356214271046], [-122.447526289338, 37.7356214271046]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.447526289338, 37.75186614156], [-122.447526289338, 37.7681108560153],
[-122.42354071791, 37.7681108560153], [-122.42354071791, 37.75186614156], [-122.447526289338, 37.75186614156]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.447526289338,
37.7681108560153], [-122.447526289338, 37.7843555704707], [-122.42354071791, 37.7843555704707], [-122.42354071791,
37.7681108560153], [-122.447526289338, 37.7681108560153]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.447526289338, 37.7843555704707], [-122.447526289338, 37.8006002849261],
[-122.42354071791, 37.8006002849261], [-122.42354071791, 37.7843555704707], [-122.447526289338, 37.7843555704707]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.447526289338,
37.8006002849261], [-122.447526289338, 37.8064505996308], [-122.42354071791, 37.8091397100972], [-122.42354071791,
37.8006002849261], [-122.447526289338, 37.8006002849261]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.42354071791, 37.7090222518768], [-122.42354071791, 37.7193767126492],
[-122.399555146481, 37.7193767126492], [-122.399555146481, 37.7092927396728], [-122.42354071791, 37.7090222518768]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.42354071791,
37.7193767126492], [-122.42354071791, 37.7356214271046], [-122.399555146481, 37.7356214271046], [-122.399555146481,
37.7193767126492], [-122.42354071791, 37.7193767126492]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.42354071791, 37.7356214271046], [-122.42354071791, 37.75186614156],
[-122.399555146481, 37.75186614156], [-122.399555146481, 37.7356214271046], [-122.42354071791, 37.7356214271046]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.42354071791,
37.75186614156], [-122.42354071791, 37.7681108560153], [-122.399555146481, 37.7681108560153], [-122.399555146481,
37.75186614156], [-122.42354071791, 37.75186614156]]]}, "type": "Feature", "properties": null}, {"geometry": {"type":
"Polygon", "coordinates": [[[-122.42354071791, 37.7681108560153], [-122.42354071791, 37.7843555704707],
[-122.399555146481, 37.7843555704707], [-122.399555146481, 37.7681108560153], [-122.42354071791, 37.7681108560153]]]},
"type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.42354071791,
37.7843555704707], [-122.42354071791, 37.8006002849261], [-122.399555146481, 37.8006002849261], [-122.399555146481,
37.7843555704707], [-122.42354071791, 37.7843555704707]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.42354071791, 37.8006002849261], [-122.42354071791, 37.8091397100972],
[-122.408482001027, 37.8108279981291], [-122.399555146481, 37.8030369180729], [-122.399555146481, 37.8006002849261],
[-122.42354071791, 37.8006002849261]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon",
"coordinates": [[[-122.399555146481, 37.7092927396728], [-122.399555146481, 37.7193767126492], [-122.382462746513,
37.7193767126492], [-122.375569575053, 37.7096606538367], [-122.375569575053, 37.7095632274689], [-122.399555146481,
37.7092927396728]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates":
[[[-122.399555146481, 37.7193767126492], [-122.399555146481, 37.7356214271046], [-122.375569575053, 37.7356214271046],
[-122.375569575053, 37.7250587555544], [-122.376417003054, 37.7256609985103], [-122.38548100067, 37.7236310003987],
[-122.382462746513, 37.7193767126492], [-122.399555146481, 37.7193767126492]]]}, "type": "Feature", "properties": null},
{"geometry": {"type": "Polygon", "coordinates": [[[-122.399555146481, 37.7356214271046], [-122.399555146481,
37.75186614156], [-122.380858592216, 37.75186614156], [-122.380781000905, 37.7503299998635], [-122.392781003251,
37.7476300007487], [-122.376481004289, 37.7475300008014], [-122.375569575053, 37.7386110300632], [-122.375569575053,
37.7356214271046], [-122.399555146481, 37.7356214271046]]]}, "type": "Feature", "properties": null}, {"geometry":
{"type": "Polygon", "coordinates": [[[-122.399555146481, 37.75186614156], [-122.399555146481, 37.7681108560153],
[-122.386786530478, 37.7681108560153], [-122.386881002647, 37.7635289981434], [-122.381281004538, 37.7602290004188],
[-122.380858592216, 37.75186614156], [-122.399555146481, 37.75186614156]]]}, "type": "Feature", "properties": null},
{"geometry": {"type": "Polygon", "coordinates": [[[-122.399555146481, 37.7681108560153], [-122.399555146481,
37.7843555704707], [-122.384235679334, 37.7843555704707], [-122.381480999539, 37.7718289998987], [-122.386681000718,
37.773229002105], [-122.386786530478, 37.7681108560153], [-122.399555146481, 37.7681108560153]]]}, "type": "Feature",
"properties": null}, {"geometry": {"type": "Polygon", "coordinates": [[[-122.399555146481, 37.7843555704707],
[-122.399555146481, 37.8006002849261], [-122.396763303819, 37.8006002849261], [-122.385681001632, 37.7909279974365],
[-122.384235679334, 37.7843555704707], [-122.399555146481, 37.7843555704707]]]}, "type": "Feature", "properties": null},
{"geometry": {"type": "MultiPolygon", "coordinates": [[[[-122.375569575053, 37.7095632274689], [-122.375569575053,
37.7096606538367], [-122.375501003397, 37.7095640007587], [-122.375569575053, 37.7095632274689]]], [[[-122.367574259846,
37.7193767126492], [-122.359200316023, 37.7193767126492], [-122.360486999075, 37.7143399981802], [-122.367574259846,
37.7193767126492]]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "Polygon", "coordinates":
[[[-122.375569575053, 37.7250587555544], [-122.375569575053, 37.7356214271046], [-122.375264067655, 37.7356214271046],
[-122.375081001544, 37.7338299975391], [-122.369822292681, 37.7356214271046], [-122.364295990154, 37.7356214271046],
[-122.356581003456, 37.7296299987911], [-122.359200316023, 37.7193767126492], [-122.367574259846, 37.7193767126492],
[-122.375569575053, 37.7250587555544]]]}, "type": "Feature", "properties": null}, {"geometry": {"type": "MultiPolygon",
"coordinates": [[[[-122.375569575053, 37.7356214271046], [-122.375569575053, 37.7386110300632], [-122.375264067655,
37.7356214271046], [-122.375569575053, 37.7356214271046]]], [[[-122.364295990154, 37.7356214271046], [-122.369822292681,
37.7356214271046], [-122.365981001024, 37.7369299999162], [-122.364295990154, 37.7356214271046]]]]}, "type": "Feature",
"properties": null}]}
@bmount
Copy link
Author

bmount commented Oct 23, 2013

Note for defining boundaries of boxes (4x grid example):

create table sf_tight_grid as SELECT cells.geom FROM ST_CreateFishnet(14, 14, (122.51948 - 122.3515810)/14, (37.8168449993815 - 37.7031319981938)/14, -122.519483003624, 37.7031319981938) AS cells;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment