Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select st_asgeojson(the_geom) from street_centerline limit 1;
- {"type":"MultiLineString","coordinates":[[[-65.591776562805038,41.682190576167052],[-65.591998971284028,41.682082119060382],[-65.592001213509064,41.682081025737766],[-65.593689871787177,41.681257533373952],[-65.595415661879244,41.680415888937219],[-65.595440519465640,41.680403765889309],[-65.595603134242481,41.680324459445771]]]}
- ogr2ogr -f GeoJSON out.json
- "PG:host=localhost dbname=gis user=ubuntu password=toomanysecrets"
- -sql "select way,name,amenity from planet_osm_point a where a.amenity is not null"
- GRANT SELECT ON geometry_columns to ubuntu;
- GRANT SELECT ON geography_columns to ubuntu;
- GRANT SELECT ON spatial_ref_sys to ubuntu;
- SELECT jsonb_build_object(
- 'type', 'FeatureCollection',
- 'features', jsonb_agg(feature)
- )
- FROM (
- SELECT jsonb_build_object(
- 'type', 'Feature',
- 'id', gid,
- 'geometry', ST_AsGeoJSON(geom)::jsonb,
- 'properties', to_jsonb(row) - 'gid' - 'geom'
- ) AS feature
- FROM (SELECT * FROM input_table) row) features;
Add Comment
Please, Sign In to add comment