Many thanks to Marcel Fortin for his invaluable lesson yesterday. We learned a lot, and yet I think we only just barely scratched the surface.
I have spent the last two days trying to figure out the next steps for our projects, and I think I understand it now. But first, a warning and a review.
This is a very tricky task. I have just spent two full days trying to understand it better. Expect this to take a very long time.
Your best bet: set aside some time to go to the map library, and ask for help. You will need to use ARCgis and probably a number of other tools. Be patient and diligent.
We learned two methods of georeferencing images.
- The Easy Way
- Fire up Google Earth, press a few buttons, export as .KMZ, voilà, you're done!
- The Hard Way
- import into ARCmap, choose a co-ordinate system, adda base map, navigate to Toronto, painfully reference a number of co-ordinates, warp the picture, export as geoTIFF but make sure to get the "nodata" color right in the settings somewhere, voilà, you're, er, well, not done exactly so much as sort of started.
- The Other Way
- I can't get ARCgis at home, so I used qGIS, a pretty amazing Open Source GIS tool. I won't describe the whole process, but there are tutorials here and here (read them in order). One important thing: when exporting the geoTIFF, I had to be sure to click the "nodata" button at the bottom, otherwise I ended up with that thick black line that Marcel got during class.
So we should do this the easy way, right? Well, that's what I thought, until I learned that georeferenced images exported from Google Earth do not display properly in Google Maps! It seems impossible but it's true – Google Maps cannot read the "Rotation" attribute of "GroundOverlays" – georeferenced images – and so, those images will not display correctly on a map. Ugh!
So, we need to do things the hard way. What a drag!
There are zillions of WordPress mapping plugins available. They have different feature sets and price points, and cater to a wide variety of audiences. It can be very difficult to navigate this space!
Building a KML file
I don't have access to ARCgis, so I can't tell if it's posible to build a kml file directly in that program. In qGIS, it's not possible! Blah!
THis means we have to build a KML file from scratch. Fortunately it's not that complicated. Here is a a model kml file:
<?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"> <GroundOverlay> <name>PUT A MEANINGFUL NAME HERE </name> <color>ccffffff</color> <Icon> <href>HREF OF YOUR IMAGE HERE</href> <viewBoundScale>0.75</viewBoundScale> </Icon> <LatLonBox> <north>DECIMALNORTHBOUNDARY</north> <south>DECIMALSOUTHBOUNDARY</south> <east>DECIMALEASTBOUNDARY</east> <west>DECIMALWESTBOUNDARY</west> </LatLonBox> </GroundOverlay> </kml>
All you have to do is fill in 6 fields. But first you have to figure out what values to use.
Be sure to choose something memorable, in some programs the name is used to keep track of this layer.
Wait a moment, we'll come back to this.
North, South, East, West
These are the most important and difficult values toget – they're the precise boundaries of your warped, modified TIFF file, expressedin decimal degrees (like, -79.86592010). Unfortunately, qGIS only uses degree/minute/second, like
73d43'26.5324. You can see these values in qgis by clicking on
Raster --> Miscellaneous ==> information. To convert them to decimal, use an online calculator like this one. Once you have the right values, enter them in the kml file.
Uploading to WordPress
This is a tricky part! The next thing you do is upload the georeferenced TIFF file to wordpress using the media uploader. Click on "Edit this image", and copy the full URL. It will look something like this:
The URL will look a bit like this:
Now you're ready to finish editing your KML file. Add this URL to the
<href> field. Now, upload the .KML file to WordPress using the media uploader. You will point to this file with your map plugin (see below – sort of!).
The next step is to choose a map plugin. This is not an easy task! There are dozens and dozens of them, and they have different feature sets. I have figured out how to use a couple of them, and so far, WP-Geo is my favourite. The tutorial in that last link explains how to add a KML. Read through it, and in class we can modify the script to work with your maps. Whew!