This question already has an answer here:
I'd like to do a GeoJSON dump of a PostGIS table, but I want to export features (the geometry and the properties) not just the geometry. I've been digging into the
ST_AsGeoJSON function but it looks like I can only get the coordinate information (which makes sense since it's a geometry function).
select st_asgeojson(the_geom) from street_centerline limit 1;
I'm curious if anyone knows of a simple way to get the property information as well. Has anyone written a
pgsql2geojson script yet?