Hello Liz,

Welcome to Mapnik.

On Apr 27, 2009, at 2:26 PM, Liz Dobbins wrote:

Hi;

I've got a question that relates to Ticket #75: Feature Request: 2- level spatial index ("TileIndex" in UMD Mapserver) - a feature that is planned for Mapnik in the future.

I'm working for a company that has used MapServer in the past, and is considering migrating to Mapnik to generate map tiles. As part of the old system, there are several data sets that were configured to use the TileIndex capability of MapServer. tile4ms was used to break the original data set into localized shapefiles, each with its own spatial index file (.qix, created by shptree). The filenames of these data sets are summarized by a tile index shapefile that includes the file pathnames as an attribute named "LOCATION". There aren't many localized files; the world is covered by only 73 of them. The tile index file is then referenced in the MapServer stylesheet.


I'd like to convert this to a system that Mapnik can use currently. I was thinking of importing all the shapefiles into a PostGIS database,

Right, sounds good. We've not added support for a shapefile TILEINDEX (and there are currently no active plans to do so) because most use cases like this with Mapnik are handled nicely by PostGIS.

For reference however, Mapnik does support QuadTree indexes on shapefiles like those produced by 'shptree'. These files have an .index file extension and can be created by installing (done by default) the 'shapeindex' command line tool bundled with Mapnik and running it on a shapefile.

and doing the spatial indexing with it, but I'm a total newbie with databases.

Ah, PostGIS is excellent, and there are a lot of resources for community and commercial support. Also, the PostGIS documentation has been improving rapidly in the last several months and you can find descriptions of working with spatial and attribute indexes here:

http://postgis.refractions.net/documentation/manual-svn/ch04.html#id2767631

I think that a database view might take the place of the tile index file, but I don't know how to set it up. Anybody have some suggestions about how this could be done?


I would start by importing your shapefiles into a single PostGIS table (don't worry about VIEW for now), and creating good spatial indexes and attribute indexes on any fields you plan to apply attribute filters upon.

Once you have benchmarked this approach you could break your tables up a bit and set manual extents for each table in your Mapnik XML which may be able to speed things up as well.

To help further it would be good to know your anticipated rendering workflow. You must be planning to render map tiles dynamically? Is your data frequently changing? If your data is fairly static, surely the easiest way of optimizing response times is to implement tile caching.


Thanks,
Liz

Cheers,

Dane

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to