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

  • 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 '14 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. – matt wilkie Feb 3 '14 at 18:27
  • hi, i found a solution on stackoverflow.com/questions/2103924/… . thank you – 501 - not implemented Feb 5 '14 at 19:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.