[GIS] How to convert geometry coordinates into Google lat/lons

geoserverlatitude longitudeoracle-spatialsql server

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.

Best Answer

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