0

I have a point layer (shapefile) insert to PostGIS. I'm using MapServer and OpenLayers to display layer on map. Now, I want get lon/lat of all features of the layer.

Hope somebody can help me.

1
  • 1
    Please clarify your answer. Do you want to get the points in PostGIS or on the web using openlayers ? Commented Aug 8, 2017 at 11:14

1 Answer 1

5

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?)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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