Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 4 down vote accepted

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."

share|improve this answer
I agree - the ST_AsGeoJSONfunction is what you can use for this. – djq Mar 27 '12 at 16:34

There is also a simple option,

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.