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

From: Ben Podoll <benjamin.podoll_at_und.edu>
Date: Wed, 21 Jul 2004 10:01:29 -0500

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_at_ngc.com [mailto:Shahak.Nagiel_at_ngc.com]
> Sent: Wednesday, July 21, 2004 9:11 AM
> To: benjamin.podoll_at_und.nodak.edu; openmap-users_at_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_at_bbn.com [mailto:owner-openmap-
> users_at_bbn.com]On
> Behalf Of Ben Podoll
> Sent: Wednesday, July 21, 2004 9:34 AM
> To: openmap-users_at_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_at_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_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
```
Received on Wed Jul 21 2004 - 11:03:02 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:05 EDT