Get Latitude and Longitude from Geometry Point in PostGres

random

Get Latitude and Longitude from Geometry Point in PostGres

Get Latitude and Longitude from Geometry Point in PostGres Reviewed by Ravi Kumar on 2:58 PM Rating: 5

4 comments:

  1. Hi. Just starting out with this, so bear with me. Could you explain what ST_Y and ST_X are?

    ReplyDelete
  2. hello david,

    ST_Y: It returns the Y coordinate of the point, or NULL if not available.

    and ST_X: It return the X coordinate of the point, or NULL if not available.

    ReplyDelete
  3. HI there how are you ? I am new to this and I managed to get my data and map to work but I don't know how to navigate through the map because I don't have the LongLat I tried your query but I am have an error with the (from "Site" ) part when I put my table name can you please help me? thank you a lot

    ReplyDelete
    Replies
    1. Hello sadeer!

      I am fine, thank you. and hope you are fine as well. Try the below query with your table name:-

      Select ST_Y(s."sp_geometry") as latitude, ST_X(s."sp_geometry") as longitude from "site" s

      Delete

All Rights Reserved by Etechpulse © 2012 - 2017

Contact Form

Name

Email *

Message *

Powered by Blogger.