Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Turn projected coordinates in geographical coordinates

    Hello all,

    Is there a way to turn projected coordinates in geographical coordinates (basically the inverse of what geo2xy does)?

    Many thanks!

  • #2
    See #2 : https://www.statalist.org/forums/for...-with-lat-long

    Comment


    • #3
      Many thanks. However, I am running this on a local machine that can't install python. Is there any other way?

      Comment


      • #4
        Yes, if you take a look at the code inside -geo2xy- you can see how the transformations are performed. For example, for the spherical Mercator the transformation is:

        Code:
                // Snyder, p. 41, equation 7-1; R = 1
                `genrep' `x' = (`lon' * `d2r' - `lambda0') if `touse'
                
                // Snyder, p. 41, equation 7-2; R = 1
                `genrep' `y' = log(tan(_pi / 4 + `lat' * `d2r' / 2)) if `touse'

        You would need to solve these for latitude and longitude. The formulas are taken from: https://pubs.er.usgs.gov/publication/pp1395.

        Also mathworld has the formulas for both the transformation equations and the inverse formulas: https://mathworld.wolfram.com/topics...ojections.html

        Comment

        Working...
        X