Created
April 13, 2011 04:20
-
-
Save ashaw/916957 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
def self.wb_gp_geojson | |
self.find_by_sql( | |
"SELECT z.zonedist,ST_AsGeoJSON(z.the_geom) | |
FROM zones AS z JOIN districts AS d ON | |
ST_Contains(d.the_geom, z.the_geom) | |
OR ST_Overlaps(d.the_geom,z.the_geom) | |
WHERE d.cd = 301;" | |
).map {|r| | |
{ :geojson => JSON.parse(r.st_asgeojson), :zonedist => r.zonedist } | |
}.to_json | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment