Created
October 28, 2014 00:07
-
-
Save kapadia/a4f0b1d7e5300a309f39 to your computer and use it in GitHub Desktop.
geojson.sql
This file contains 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
psql -Atc "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(box2d(ST_Buffer(ST_Transform(lg.wkb_geometry, 3857), 300)))::json As geometry, row_to_json((scene_id, created)) As properties FROM scenes As lg WHERE scene_id='$sceneid') As f ) As fc;" > $bounds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment