For storing geospatial data, the geometry field is used in SQL Server or Oracle Spatial. I want to know is there any way where we can convert this geometry field into a set of latitudes and longitudes.

  • 1
    It depends on what SRID your data is in SQL/Oracle not all projections can be converted in Lat/Lng but most will be able to. What datum/projection are you intending to use? – Mapperz Feb 1 '12 at 14:44

'Yes' is the short answer. The way you do it depends on what you want to use the data for.

The simplest way is to re-project your data into a Lat/Lon coordinate system using ST_Transform() (I think it is just 'Transform()' in SpatiaLite and something weird in Oracle). Alternatively, follow one of these recipes, perhaps using Proj4. Once you have re-projected your data you can either use it normally or pull out the sets of coordinates (it's not clear from your question what your end-result should be).

Your choice of Lat/Lon projection will depend on what you are going to do with the data next. Google uses EPSG: 900913 (Spherical Mercator) but probably the most common is WGS84 (EPSG: 4326). The EPSG code is (outside of ArcGIS) possibly the most common way of referencing your Spatial Reference System (SRS) and you can look up the codes here for whatever Lat/Lon system you need.

| improve this answer | |

In Oracle, there is the SDO_CS package to perform transforms. If your table is registered properly with the coordinate system that it is in, the transform should do your transformation properly. Check out SDO_CS.TRANSFORM.

Oracle Spatial SDO_CS Package

This existed in earlier Oracle Spatial. As for SQL Server, spatial data didn't exist until version 2008. It seems that they are only going to provide the data storage capabilities in SQL Server and rely on programmers to perform the coordinate transformation.

| improve this answer | |

Use one of many online converters such as http://www.hamstermap.com - it allows conversion of DM,DMS & UTM into Google lat/long, which are in decimal format.

| improve this answer | |

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.