Jump to Lat / Lon --- Convert X,Y to GIS Coordinates

Richard Greenwood richard.greenwood at GMAIL.COM
Thu Dec 2 22:43:40 EST 2004


On Thu, 2 Dec 2004 13:48:02 -0500, Shanton, James A
<james.shanton2 at nscorp.com> wrote:
> Is there an easy way to jump to a GIS Lat/Lon location with Mapserver?
>
> I'm also trying to convert X and Y (returned by JBox) to GIS Coordinates,
> but am not having any luck finding a sample.

jBox returns screen pixels, so you need to convert screen pixels to
map_units. It's pretty simple:
   map_width = max_x - min_x
   map_units/pixel = map_width / image_width
   GIS_X = min_x + pos_x * map_units/pixel
where pos_x is the pixel x coordinate returned by jBox.

--
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the mapserver-users mailing list