Using Mapnik with GeoTIFF imagery - a tutorial?

449 views
Skip to first unread message

Max S

unread,
Nov 21, 2014, 6:20:22 AM11/21/14
to map...@googlegroups.com
Our group has quite a bit of aero photography images of our city, in GeoTIFF format, and I'm told it's referenced as National Grid coordinates. I was given the job of setting up a server to view them as a slippy map, a la Google Maps.

This is a new topic for me, and I'm very interested but I have to admit I don't know much about it. I have experience with using Leaflet to access OpenStreetMap and Google Maps, but that's on the client side.

So I'm not quite clear how to start - I found tutorials that take the OpenStreetMap data set as a starting point, but I have to work with a different data set, this aerophotographic survey. So I expect I have to convert these images, chop them up in tiles and so on, so that Mapnik can be used to serve them. Would you guys have any pointer for me?

Thanks in advance,
Max

Andy Allan

unread,
Nov 27, 2014, 4:48:43 AM11/27/14
to mapnik
On 21 November 2014 at 11:20, Max S <basi...@gmail.com> wrote:
> So I expect I have to
> convert these images, chop them up in tiles and so on, so that Mapnik can be
> used to serve them.

That's not the approach I would take. For a start, mapnik doesn't
"serve" the end results - it's just a library, so you need some piece
of software like mod_tile or tilestache to serve them. Mapnik is the
library that will read the GeoTIFFs, reproject them, and knows what to
do when a tile is requested.

So the first step is to create a mapnik config file with the GeoTIFFs
as datasources (I recommend the GDAL datasource, rather than the basic
raster datasource). Your symbolizer will be a RasterSymbolizer where
you can choose scaling algorithms etc (and even recolour things if you
need to).

If you have hundreds of geotiffs, I'd recommend building a gdal .vrt
file first (using gdalbuildvrt) to cut down on the number of layers
used - it just saves a bit of sanity. If you're new to mapnik, I'd
also suggest building your config file using Tilemill, where feedback
is quick and results are easy to see, and then exporting the XML to
use in mod_tile/tilestache/whatever later on.

Cheers,
Andy

Martin Koppenhoefer

unread,
Nov 27, 2014, 5:53:28 AM11/27/14
to map...@googlegroups.com

2014-11-21 12:20 GMT+01:00 Max S <basi...@gmail.com>:
So I'm not quite clear how to start - I found tutorials that take the OpenStreetMap data set as a starting point, but I have to work with a different data set, this aerophotographic survey. So I expect I have to convert these images, chop them up in tiles and so on, so that Mapnik can be used to serve them. Would you guys have any pointer for me?



you can also use gdal to create the tiles, if you don't want to add additional data to your imagery. There is a python script called gdal2tiles.py

Cheers,
Martin
Reply all
Reply to author
Forward
0 new messages