Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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.

share|improve this question
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
add comment

3 Answers

up vote 3 down vote accepted

'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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

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.