GeoEye is planning to distribute this imagery to the media as soon as the imagery is transmitted and processed. To make it easy for news outlets to quickly publish and share these images on the web, they’re processing them as interactive maps using the MapBox.js API. One of the key features needed to do this is the swipe layers code, which allows for some cool 2009 versus 2013 comparison shots.
To prepare for this we’ve been working with GeoEye’s team to process the 2009 imagery. The imagery was post processed, and while that retained the high resolution of the imagery, it also removed the geospatial elements of the image metadata. Using GDAL, QGIS, and MapBox Satellite, I was able to manually georeference the 2009 imagery and compare the ceremony attendance and changes to the city with our own MapBox Satellite layer.
Below I go over the steps of how to take a non-georeferenced JPEG image and turn it into a geospatial dataset ready for rendering in TileMill and uploading to MapBox hosting. I use three free, open-source software libraries: Quantum GIS (My instructions are based off of QGIS version 1.8.0 Lisboa), GDAL, and TileMill.
1. Open up QGIS and activate the Georeferencer plugin from within the Plugins drop-down menu.
2. Open raster dataset in Georeferencer window.
3. Log in to your MapBox account and create a new map layer. To create a Satellite base layer, you’ll need a basic account or higher.
4. In the Georeferencer window in QGIS, choose a recognizable location on the source image. Select the Add a Point tool (Command + A), and add a point on the source image over the location. I’m using the corner of 15th Street NW and Madison Dr. NW, across from the Washington Monument.
5. Search for the same location on the map shown in your custom MapBox Satellite layer, keeping the point of interest in the center of the screen. Here’s a screenshot of the area on the source image, and its equivalent location on MapBox Satellite.
Take a look at the url hash at the end of the MapBox url.
The first number after the # is the zoom level, the second is latitude, and the third is longitude.
6. Back in QGIS, use the values obtained from the url hash in the “Enter Map Coordinates” dialog. The second number from the URL hash, latitude, is the Y value; the third number,longitude, from the hash is the X value.
7. Repeat steps 6-8 until you’ve added the desired number of control points to the image. A good rule of thumb here is to start with the four corners and work your way inward. To meet the project accuracy requirements, I added a total of 37 ground control points. Be sure to save your ground control points using the “Save GCP Points as” option in the georeferencer plugin. That way, you can reopen the project at a later date to modify points or add additional ones to improve spatial accuracy.
8. You can either perform the georeferencing within QGIS, or select the “Generate GDAL Script” from QGIS. I selected Thin Plate Spline transformation, Lanczos resampling, no compression, and generated a script to modify before running.
The script produces a conventional GeoTIFF, which we can render in TileMill, and upload to MapBox hosting. I checked the spatial accuracy of the georeferencing against our MapBox Satellite layer using the Reference Layer Plugin from within TileMill.