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'm hava a problem I have a point layer (shapefile) insert to postgis! I'm using MapServer and OpenLayer to display layer on map! Now, i want get lon/lat all feature of layer! Hope somebody can help me! Thanks!

share|improve this question

To extract lon/lat in text format from a database table, you can do something like:

SELECT ST_X(geom), ST_Y(geom) FROM yourgeospatialtable; 

Where geom is the spatially enabled column.

There probably is also an OpenLayers function to do that, but I am not exactly sure where you want to do it (server/client?)

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.