Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to PostGIS, Spatial Reference Systems and projections and want to store lat/lng coordinates retrieved from Google Maps and Openstreetmap and its services like the Geocoder/Nominatim. I'm working with data in America and the main calculations are for nearest neighbors. Results will be plotted back on a web map (eg: via Google maps API or leaflet)

Question: What spatial reference system is Google map using? I figured out so far that its the WGS 84 datum with the Mercator projection in the geographic coordinate system. Should I store the location data as it is, or transform to US National Atlas Equal Area EPSG:2163?

Since I will be calculating distances and finding nearest neighbors, if I guess correctly that doing nearest neighbor search requires transforming the entire table to EPSG:2163, then will the solution be to store the data in both Mercator and EPGS:2163?

share|improve this question

Google uses epsg:3857 crs, sometimes known as epsg:900913. I think your strategy for storing coordinates in both systems is okay, however, you could also store the in epsg 4326 with a geography data type, this would give you precise measurements with latlng coordinates (thats the reason behind geography data type compared to geometry data type)

share|improve this answer
remember, you need convert data to 4326 using st_transform(geom,srid)- function – simplexio Apr 2 '13 at 7:55

While the Google map is displayed in Web Mercator (EPSG:3857), when you want to plot things on it, you would use geographical coordinates (and google will automatically convert that to display correctly on their web mercator maps).

Thus, I'd recommend storing them in EPSG:4326 (and not in web mercator).

Whether or not you should also store them in EPSG:2163 depends on how you are doing your nearest neighbor calculations.

share|improve this answer
Am I right to say that the Lat/Lng coordinates that we use when interacting with Google Maps API is in EPSG:4326 (unprojected), and Google maps projects them to EPSG:3857 to plot on the map (which is using the web mercator projection) – Nyxynyx Apr 2 '13 at 3:42
Yes, that is right. – Bjorn Svensson Apr 2 '13 at 11:35
I tried to to exactly that (Generate a shape in QGIS using 4326 and then let the JS API draw it, but it looks stretched? Do I need to pass the CRS somehow to google maps API? – Dave Feb 17 at 17:42

Your Answer


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.