# recalculate latitude and longitude from a pixel in a cropped map

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

• 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
• 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