RE: [OpenMap Users] Convert one lat/lon point to x/y

From: Ben Podoll <benjamin.podoll@und.edu>
Date: Wed Jul 21 2004 - 11:01:29 EDT

So the best way for me to do this (if I am working in Mercator) is to:

float scale = 17927308f;
int width = 800;
int height = 600;

LatLonPoint center = new LatLonPoint(43.7f,-102.0f);
Mercator m = new Mercator(center, scale, width, height);

float lat = 38.2f;
float lon = -111.7f;
LatLonPoint llp = new LatLonPoint(lat,lon);

Point p = new Point();
m.forward(llp, p);
System.out.println("(x,y) --> " + "(" + p.x + "," + p.y + ")");

> -----Original Message-----
> From: Shahak.Nagiel@ngc.com [mailto:Shahak.Nagiel@ngc.com]
> Sent: Wednesday, July 21, 2004 9:11 AM
> To: benjamin.podoll@und.nodak.edu; openmap-users@bbn.com
> Subject: RE: [OpenMap Users] Convert one lat/lon point to x/y
>
> Nothing static that I'm aware of, but on the projection object:
>
> forward(LatLonPoint llpoint)
>
> returns an java.awt.Point, from which you can get the x/y
>
>
> -----Original Message-----
> From: owner-openmap-users@bbn.com [mailto:owner-openmap-
> users@bbn.com]On
> Behalf Of Ben Podoll
> Sent: Wednesday, July 21, 2004 9:34 AM
> To: openmap-users@bbn.com
> Cc: 'OpenMap Support'
> Subject: [OpenMap Users] Convert one lat/lon point to x/y
>
>
> Is there a convenience method (or static utility method somewhere) so
> that I
> can just feed it a lat/lon (and projection) and it will return a x/y
> point?
>
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Jul 21 11:03:02 2004

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:39 EDT