I’ve been working on importing some Canvec data into OpenStreetMap and thought I’d write about the process.
Canvec is the geographic data that makes up the Canadian National Topographic map set. Natural Resources Canada has released this data under a free data license that allows it to be imported into OpenStreetMap. The nice folks at NRCan have actually gone further and are converting their dataset into OpenStreetMap (.osm) format to make importing it easier.
The dataset is divided according to the National Topographic Grid system that is used to produce topographic maps. You can find a map showing how the country is divided
here. Once you know the NTS index that your interested in you can get the CanVec data in OSM format via the ftp site
To import an area I did the following
- Download the .zip file for the area your interested in
- Open up one of the .osm files inside the zip file using JOSM. Each Canvec tile is sub-divided into smaller quad areas. Those quads can be further sud-divided.
For purposes of this example rename the layer to be ‘Canvec’
- Check to see if someone else is already working on this tile. See Work In Progress for the latest information on where work in progress information is being tracked. If no on else is working on your area then update the chart so others know that you have started an area
- Zoom to the layer. Then download the existing OSM data for the area. Be sure to download the existing data into a new Layer. Rename this layer to be “OSM”
- Activate the “CanVec” layer and pick on of the relations that is of interest to you . For example a “wood” relation. Select the relation by using the button titled “Set the current selection to the list of the selected relation”
- Zoom to your selection (hotkey ‘3’)
- Look at the item you’ve selected. Then hide the “CanVec” layer. Look to see if their are any conflicts in the “OSM” layer with the items your about to dealing with. I’ll discuss some common conflicts later
- Make the “Canvec” layer visible again then under the “Edit” menu. Then select “Merge Selection” and choose the “OSM” layer. This will put the selected items onto the “OSM” layer.
- Now delete the item you just merged from the “CanVec” layer. The item should still appear on the map because you copied it into the “OSM” layer. I like to delete items from the CanVec layer after I’ve placed them on the OSM layer so I can keep track of what items still need merging.
- Repeat these steps for all of the relations that you want to merge
- Now it is time to merge objects that are not in a relation. The JOSM Search feature is really good for this. Search for a feature your interested in for example ‘water’ using the replace selection option
- Pick an item from the selection list (that hows the result of your search) and make that your new selection. Zoom to the selection
- Examine the feature and hide the ‘Canvec’ layer to check for conflicts.
- If you don’t see any conflicts then you can use “Merge Selection” from the “Edit” menu to merge your selection into the “OSM” layer. Then delete the objects from the “Canvec” layer
- Repeat until all of the objects your interested in have been merged
- To upload your data you should select the “OSM” layer and upload the data as your normally would when using JOSM. Pay attention to issues the JOSM validator finds, I’ve found that it often picks up on things that should be fixed. I recommend merging everything you plan on merging in the tile before uploading. You can periodically save your “OSM” layer to your local disk to safe-guard against user errors or power failures.
- Canvec buildings that are already in OSM as a POI or a trace. The tags (ie what the buliding is) can either be added to the Canvec object or you can leave the existing OSM object as is (if it is a better trace then Canvec)
- Lakes that are already traced in OSM. The Canvec lake data tends to be better than the typical LandSat trace of a lake. I will often copy the tags (ie the lake name) from the OSM object and add it to the Canvec lake and then replace the OSM version of the lake with the Canvec one. I don’t do this in an automated fashion, I manually compare the two objects and decide which one looks better. The Canvec data for lakes often uses polygon relations for islands while a lot of the lakes in OSM predate relation support.
- Railroad data are often in the existing OSM data and are included in Canvec. For the ‘main’ part of the railway I’ve been leaving the OSM objects as is, I don’t have an easy way of determining which is right. The OSM railway data sometimes comes from GPS traces of mappers riding the train, nor do I know how the Canvec data was collected. Often the Canvec data will have short branches into industrial areas or extra tracks near train yads that are not in OSM. These I will add and connect to the existing railways.
- Landuse data somtimes conflicts, ie a ‘wood’ (forest) in the Canvec data might cover an area that is now retail or residential in OSM. Keep in mind that some of the Canvec data was collected a number of years ago might no longer reflect reality in areas that have had lots of development going on. Local knowledge helps here.
- Objects at the edge of the Canvec tile should be connected (merge the nodes) with objects that describe the same feature in adjacent tiles. This has to be done manually but the JOSM validator plugin will warn you about it.
I’ve intentionally been ignoring roads and addresses, dealing with those is a project for another day (or someone else)