8
$\begingroup$

To illustrate my problem, let's say I have lattitude and longitude coordinates, such as 38.871105, -77.056042. I want to be able to calculate the new lattitude and longitude if, say, I moved 300m eastwords, or 400m northwards, in a way that google maps will like. Now, from what I can understand, this would mean converting it from lat/long to mercator pixel coordinates, getting new mercator pixel coordinates then converting back to lat/long...

Here's what Wikipedia has to say on Google's Mercator projection:

Wikipedia's formula Why do the above equations not actually take into account the longitude? And what is a? If I could understand these equations then theoretically the rest should be easy... Thanks! -B

$\endgroup$
  • 5
    $\begingroup$ Your problem is not projection dependent. The map projection relates spherical coordinate system to some other (this may be pixel coordinates, physical space etc.). Since Google Maps API will handle lat/lon input, you just need to calculate your travel distance. Distance (in meters) northward is linearly proportional to distance in degrees latitude. Distance (in meters) eastward will depend on a cosine of latitude besides being linearly proportional to distance in longitude. Also, look into great circle distances and Haversine formula and others for higher accuracy calculations. $\endgroup$ – milancurcic Nov 5 '14 at 14:07
  • 2
    $\begingroup$ I think it would be good if you post what you found as the answer. $\endgroup$ – milancurcic Nov 6 '14 at 16:06
  • $\begingroup$ a = semimajor axis of the ellipsoid or sphere used for the model of the Earth. $\endgroup$ – mkennedy Dec 18 '14 at 23:22
-1
$\begingroup$

The theory or purpose behind the Web Mercator projection is to project the globe into a rectangle made up of equally sized tiles at any zoom level. It's accuracy is highly suspect for calculating area's and distance; it is used because it makes it fast and easy to cache tiles to serve imagery and other basemaps. Rather than use the formula on Wikipedia i would look up EPSG:3857 (Mercator). As for using Google maps, it lets you toggle the reference system in the viewer from decimal to lat/long.

$\endgroup$
  • 4
    $\begingroup$ "it is horribly inaccurate for modeling or processing data". This statement is false. Mercator projection is commonly used in ocean and atmosphere modeling, curvilinear grids facilitating high accuracy on arbitrary projections. $\endgroup$ – milancurcic Nov 5 '14 at 15:07
  • $\begingroup$ I'll caveat by saying its horribly inaccurate at modeling or geoprocessing for use in landscape or watershed and/or terrestrial land planning as is distorts the relationship between distance between features.. I'm talking specifically about the web Mercator projection used by Google and other basemap services. That said I stand by the statement $\endgroup$ – user33290 Nov 5 '14 at 15:20
  • $\begingroup$ Heh, it seems I wasn't sure what I was looking for now. Done a bit more research now, and in conjunction with the answer above I realize that use of the Mercator projection is completely unnecessary (even if it is fascinating stuff). Thankoo! <3 $\endgroup$ – bmus Nov 6 '14 at 14:48
  • $\begingroup$ In EPSG:3857 aka "Web Mercator", the world is a square, not a rectangle, because it's cut off at approximately +/-85.05 degrees. $\endgroup$ – mkennedy Dec 18 '14 at 23:17
  • $\begingroup$ @milancurcic I think the point that user33290 is making is that Google Maps does not use Mercator projection. It uses a simplified version called "Web Mercator", which saves on processing time. $\endgroup$ – Semidiurnal Simon Dec 19 '14 at 10:45

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.