HI - I'm trying to obtain a lat/lon position from screen coordinates,
but the return values are way off from what I'm expecting. I'm using
the Mercator projection.
Below is a code snippet. I'm passing in the following values: x=459
y=319 centerLat=33.2 centerLon=-116.0 projectionType=mercator
width=620 height=438 scale=1.0E9
It is returning lat=-20.562952 and new lon=-32.1875.
Perhaps the inverse method doesn't work the way I expected. Any
ideas? Thanks,
Greg
------------------------------
private LatLonPoint getLatLonFromScreenCoordinates(int x, int y,
double centerLat, double centerLon, String projectionType, int width,
int height, float scale)
{
LatLonPoint centerLatLonPoint = new LatLonPoint(centerLat,
centerLon);
Projection projection = null;
if (projectionType.equalsIgnoreCase("Mercator"))
{
projection = new Mercator(centerLatLonPoint, scale, width,
height);
return projection.inverse(x, y);
}
.
.
.
-----------------------
--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Feb 10 2006 - 23:09:16 EST