1

i want to recalculate a geographic coordinate from a pixel in a map. For this i have the size and the coordinates from the map

to convert a coordinate to a pixel is use the algorithm, you find at https://gist.github.com/gagern/6636176

But how can i convert this back to the orginal geographic coordinate?

for the longitude i simply use

 Math.toDegrees((x+from.getLongitudeAsRad()*xFactor)/xFactor)

but how can i calculate the latitude?

best regards

3
  • 1
    While your tags are correct, the best topic is "map projections" (long,lat --> X,Y) and especially "reverse (or inverse) map projections" (X,Y --> long,lat). You need to know which projection. Please do more research. Good luck.
    – Martin F
    Feb 3, 2014 at 18:11
  • 1
    in addition to @martinf's comment, needing to know the map's coordinate system (projection) if the map image is available publicly that might help answerers as well. Feb 3, 2014 at 18:27
  • hi, i found a solution on stackoverflow.com/questions/2103924/… . thank you Feb 5, 2014 at 19:24

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.