5

I am attempting to take a shape file and display it on a map:

I can do something like this:

SELECT ST_AsText((ST_Dump(the_geom)).geom) as the_geom FROM shapes;

But the problem is I still have to do a lot of parsing of the data to get it to display on a google map. Is there a way to do this easily via google's javascript api?

underdark
  • 84,148
  • 21
  • 231
  • 413
Chris Muench
  • 659
  • 2
  • 8
  • 12

2 Answers2

4

GeoJSON seems to be a good way to deliver what your asking.

enter image description here

"This simple demo shows mountain backdrop preservation areas. We're using the showAll parameter since there are only a handful of features and there's no sense re-fetching features with each map pan or zoom."

http://geojason.info/google-vector-layers/demos/postgis-restful-web-service-framework/

Mapperz
  • 49,701
  • 9
  • 73
  • 132
4

There is also a simple option, http://postgis.net/docs/ST_AsKML.html

Paul Ramsey
  • 19,865
  • 1
  • 47
  • 57
relet
  • 1,459
  • 12
  • 19