Latitude and longitude values to the Mapserver x/y format?

Andy Burnham andy at MEGALITHIC.CO.UK
Fri Jun 17 14:10:58 PDT 2005


Hello,
Here's an appropriate question as the Summer Solstice is nearly on us, 
hopefully someone can help me?
I'd like a way to convert from latitude and longitude values to the 
Mapserver x/y format. If I could calculate this I would be able to 
create links from my prehistoric site pages, eg: Stonehenge 
http://www.megalithic.co.uk/article.php?sid=157 , which includes the 
values: Latitude: 51.178904N  Longitude: 1.825418W

Do you know how to work out the scaling factor so as to convert this to 
a URL that would show a map centred and zoomed in on the  Stonehenge 
area, a bit like this:

http://www.megalithic.co.uk/cgi-bin/mapserv40?img.x=134&img.y=68&mode=browse&layer=scr&zoomdir=0&zoomsize=2&imgxy=300.0+300.0&imgext=-858441.666667+296416.666665+-773441.666667+381416.666665&map=%2Fsrv%2Fwww%2Fhtdocs%2Fmapserv%2Fmegp.map&root=%2Fmapserv&savequery=true&program=%2Fcgi-bin%2Fmapserv40&map_web_imagepath=%2Fsrv%2Fwww%2Fhtdocs%2Fmapserv%2Ftmp%2F&map_web_imageurl=%2Fmapserv%2Ftmp%2F&map_web_template=itasca_adds_pan.html

Thanks and happy Solstice everyone!
Andy

-- 
==================================================================
The Megalithic Portal http://www.megalithic.co.uk
<><><><><><><> TRY OUR NEW EUROPE-WIDE MEGALITH MAP <><><><><><><>
"a wonderful guide" - the New York Times
"useful, fun, and accurate" - Archaeology Magazine
==================================================================



More information about the MapServer-users mailing list