PathAway Support Forum Index PathAway Support
Discussion board for PathAway for Mobile Handheld Devices
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Advice on calibrating WMS maps

 
Post new topic   Reply to topic    PathAway Support Forum Index -> Calibrating Maps
View previous topic :: View next topic  
Author Message
Dodger



Joined: 14 Mar 2006
Posts: 80
Location: Ontario, Canada

PostPosted: Thu Apr 20, 2006 6:37 am    Post subject: Advice on calibrating WMS maps Reply with quote

The Canadian Government has seen fit to offer, free of charge, access to it's topographical WMS (Web Map Server) map database. The maps can be viewed online using any one of a number of web interfaces, but I've found a free program called "Gaia" (www.TheCarbonProject.com) that, so far, appears to be the best client interface for the on-line topo maps.

To access the Canadian topo maps, I point the Gaia program to http://wms.cits.rncan.gc.ca/cgi-bin/cubeserv.cgi?, select all the "layers" I'm interested in from the available layers menu (this allows you to select which features you want to appear on your map - Roads, rivers, place names, geographical features, bridges, etc....) and then wait for the map to appear. You can zoom into a very detailed level and once you are satisfied with what you have, you can save the map in a number of graphic formats. The interface also allows you to click on any location on the map & it will pop open a window providing the exact coordinates of wherever you clicked.

The only limitation is that you cannot view a map larger than 800X800. This is a limitation the Canadian government has set on the free map server. If you adjust your Gaia window larger than 800 X 800, you'll get an error each time you attempt to query the server. (You can see the generated error log in the "Log" tab - It'll tell you what size your window was & you can adjust it accordingly by trial & error till you get it to exactly 800 X 800.)

Once you have all the layers you want selected and set the screen size appropriately, you can save the configuration in a "Session" file. This allows you to reload the same session information next time so you don't have to go through all the trouble of reselecting all the layers you're interested in next time.

There are free WMS map servers all over the place (not just for Canada) and the Gaia program comes with the addresses to a few of the more popular ones.

So far, the only thing I haven't been able to do is to somehow automate the creation of a calibration file of some sort that I can convert or load into Pathaway to automatically calibrate the map I've saved from Gaia.

In Gaia, when you have the "Info" icon highlighted, clicking on the map produces a window that provides the coordinates of wherever you clicked. (For example, clicking near my house displays:

Querying at X=1543014.439, Y=-178955.3075, SRS=EPSG:42304 (NAD83 / NRCan LCC Canada)

(Latitude 45.257746386667, Longitude -75.343826344285)


Until now, the only method I've used involves saving the map from Gaia in BMP format, loading it into PW Map Manager, then clicking on a few obvious locations (like a road intersection) on the map in Gaia, writing down the coordinates, switching to PW Map Manager and using the "Known Points" calibration method, attempting to click on exactly the same point and entering the coordinates in Map Manager.

So far, while I've gotten this to work for a number of maps, I've also screwed up a few by either incorrectly selecting the wrong "Coordinate grid" (Anyone know what type of coordinates are represented by the above coords?) or by entering a number incorrectly. Because this type of calibration works best with at least 3 points entered, there are plenty of opportunities for me to screw it up. Because I want as much detail as possible, this also involves creating dozens of small, detailed maps and calibrating each one, thereby increasing the chances of me screwing up some of them.

So - The gist of all this: Does anyone know of an easier way to calibrate maps downloaded from WMS servers? I've noticed that each request sent to the WMS server appears to contain coordinates (Decimal long/lat?) in the URL - But I know nothing about WMS servers so I don't know which area of the map these coordinates represent - The center? The 4 corners?

If anyone is interested in trying out this Gaia program & would like some help getting started, Simply reply here & I'll post a step-by-step tutorial on how to view & save maps using the program. In exchange, if someone can figure out an easier way to calibrate these maps for use with PathAway, I'd be very grateful. (Or perhaps someone is aware of a different map viewer that views WMS maps and will save them WITH some form of convertible calibration file for Ozi Explorer or some other system that has a converter for PathAway?)

Dodger
Back to top
View user's profile Send private message
Dodger



Joined: 14 Mar 2006
Posts: 80
Location: Ontario, Canada

PostPosted: Sat Apr 22, 2006 6:37 pm    Post subject: Reply with quote

Well - After some digging, I was able to figure out how to accurately and easily calibrate maps downloaded from WMS servers for Pathaway.

If anyone is interested in an example (this one is in eastern Ontario but all of Canada is available), point your browser HERE - This will display an 800 X 800 topo map from the WMS server at a resolution I chose for the biggest map with the most detail I wanted. (This particular server limits public use to 800 X 800)

Right click on the image, chose "Save Image As" and enter a filename with the PNG extension. The WMS server cannot output BMP files directly, so for the best image quality, save as PNG and convert to BMP using a graphic converter program afterwards - You CAN save as JPG if you change the "format=image/png" to "format=image/jpg" in the url text in the address bar but the quality isn't as good.

To calibrate, look at the URL in the address bar - Scroll to the right (it's a long URL) and you'll see one parameter called "bbox" with 4 lat/long values in decimal degrees. Those are the parameters for the "Bounding Box", the lat/long coordinates of the outside edge of the graphic. The order of the bbox values are:

MIN-X (Map Left Edge), MIN-Y (Map Bottom Edge), MAX-X (Map right Edge), MAX-Y (Map top edge)

For a proper 800 X 800 map for anywhere in Canada at this resolution, choose whatever coordinates you like but just make sure MIN-X is less than MAX-X by exactly .127916 and MIN-Y is less than MAX-Y by exactly .0901336. (Don't forget - For Canada, min/max X are negative numbers so "less than" actually makes a "larger looking" negative number)

- To calibrate your saved map, convert the PNG to BMP
- Load it into PW Map Manager
- Press "Calibrate" button
- Choose Coordinate Type "Top-Left and Bottom-Right"
- Calibration Type: Lat/Long (Rectangle)
- Map Datum: WGS84
- Coordinate Grid: DD.dddd
- Enter the coordinates (Copy & paste from your browser if you like)

... Latitude (N/S) TL: MAX-Y
... Longitude (E/W) TL: MIN-X
... Latitude (N/S) BR: MAX-X
... Longitude (E/W) BR:MIN-Y


Press "Apply" and save your Pathaway map.

While this may all seem complicated, it's only because I've included every detail in how to do it. It's actually quite simple and produces fairly nice maps. And best of all, they are ACCURATE and FREE.

I wrote a small Oracle program to help to calculate the coordinates and generate a query URL for each of of 88 consecutive images for the area I was interested in. From start to finish, it took about 3 hours to download, convert & calibrate them all. I'm considering writing a quick & dirty VB program to automate the whole process but I'll have to wait & see if I can find time.

Dodger
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PathAway Support Forum Index -> Calibrating Maps All times are GMT + 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group