A table Oracle have a Shape field of type SDE.ST_GEOMETRY, I want to convert it to latitude and longitude.

I need the Latitude and Longitude to build dynamic maps on Google Maps.

I saw on the Internet this tip, I tried this:

SELECT sde.ST_X(shape) x, sde.ST_Y(shape) y FROM pontes;

But returned this:

              X | Y

692789,990308064 | 7020476,32990657

I think these are coordinates (XY) ArcGIS, but I need the latitude and longitude.

How to convert a Shape (SDE.ST_GEOMETRY) to Latitude and Longitude?

  • I hope your data isn't versioned on the Arc/front end! – DPSSpatial May 13 '16 at 17:10
  • If the table is versioned, a versioned view could be used to perform the same query, so this is a non-issue – Vince May 14 '16 at 10:14

This is giving you the lat/long for your geometry, but it looks like your data is in some sort of feet-based projection like state plane. If you're wanting to display the coordinates in a system that's readable by Google Maps, you'll need to transform the point. Not sure about the syntax for SDE in Oracle, but in PostGIS it's something similar to:

    select st_astext(st_transform(shape, 4326))

For additional information see the help page.

  • This is close, but your parens are out of alignment, and it doesn't address geodetic transformation (geogtrans use) if the projected data is not based on GCS_WGS_1984. – Vince May 13 '16 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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