From Data To Map
Earlier this evening, Atrus pointed out that DC has a bunch of cool data in their GIS Data Catalog. I decided I would play with it a bit and see what I could come up with.
I grabbed the Street Centerlines, played with it in QGIS to do a bit of cartography, and then (eventually) got it exported to a MapServer .map file (which describes styling info). I was then able to set the file up in MapServer, serve it out to OpenLayers, and then to stick TileCache in the mix. The result isn’t the prettiest thing in the world, but it works.
After going through it once, I decided I’d go through it all again, to see how long it took.
- 12:15AM: Open Firefox to the DC Data Catalog to find some data to map.
- 12:16AM: Pick out Structures Polygons.
- 12:17AM: Download complete, open QGIS
- 12:18AM: Open file in QGIS
- 12:19AM: Save QGIS project file, save map file from project file
- 12:20AM: Copy both shapefile and mapfile to server
- 12:21AM: Tweak mapfile: adjust PNG output to not be interlaced (for TileCache usage), change background color
- 12:22AM: Test mapfile in mapserv CGI. Find out I misspelled something, fix it.
- 12:23AM: Edit TileCache config to add new layer information.
- 12:24AM: Copy an existing tile URL, ensure that it works in TileCache with the different layer.
- 12:25AM: Edit OpenLayers config to include additional layer
- 12:26AM: Edit OpenLayers config to include layerswitcher.
- 12:27AM: Marvel at the result
In less than 15 minutes I was able to turn a dataset into a browsable, lazily cached web viewable data set, using qgis, OpenLayers, and TileCache. Not bad at all.
March 10th, 2007 at 6:34 pm
Hey, would it be possible for you to write up a little howto or tutorial on how you did this? It would be much appreciated, as I’ve had quite a hard time finding documentation on how to mimic what you accomplished, creating basically custom maptiles with data, a mapserver, and tilecache. Thanks!