Permalink
Browse files

Working map/geojson after database tweaks.

  • Loading branch information...
talltom committed Dec 10, 2012
1 parent f12ea70 commit 42098983bb3470c7ca9a172c94953a3730ffa7f0
Showing with 1 addition and 1 deletion.
  1. +1 −1 get_geojson.py
View
@@ -35,7 +35,7 @@
cur = conn.cursor()
# Query
-cur.execute('SELECT row_to_json(fc) FROM ( SELECT \'FeatureCollection\' As type, array_to_json(array_agg(f)) As features FROM (SELECT \'Feature\' As type, ST_AsGeoJSON(ST_Transform(lg.geom,4326))::json As geometry, row_to_json((SELECT l FROM (SELECT height) As l)) As properties FROM "3DLondonBuildings" As lg WHERE ST_Within(lg.geom, ST_GeomFromText(%s,4326)) LIMIT 100000 ) As f ) As fc;',[bbox_wkt])
+cur.execute('SELECT row_to_json(fc) FROM ( SELECT \'FeatureCollection\' As type, array_to_json(array_agg(f)) As features FROM (SELECT \'Feature\' As type, ST_AsGeoJSON(ST_Transform(lg.the_geom,4326))::json As geometry, row_to_json((SELECT l FROM (SELECT height) As l)) As properties FROM "3DLondon" As lg WHERE ST_Within(lg.the_geom, ST_Transform(ST_GeomFromText(%s,4326),27700)) LIMIT 100000) As f ) As fc;',[bbox_wkt])
array = cur.fetchall()
# Return data as GeoJSON

0 comments on commit 4209898

Please sign in to comment.