[Mapserver-users] speeding up large shapefiles

woodbri at swoodbridge.com woodbri at swoodbridge.com
Sun Jan 25 05:34:43 PST 2004


Bart,

This would definitely help. There is an OpenSource utility to assist 
in the tiling at http://imaptools.com/?tab=4 called shp2tile it has a 
lot of options to help tile the shpfile using different algorithms.

If you tile the results into a directory like tiledir then you can 
run on linux:

find tiledir -name "*.shp" -exec shptree {} \;
find tiledir -name "*.shp" > tiledir.in
tile4ms tiledir.in tiledir-tile
shptree tiledir-tile

To create spatial indexes and to create the tile index.

As far as size of each tile, you are correct that there are a lot of 
variables involved. Because of the file system cache that most modern 
OSs have, you do not want to make the files too small as it will cost 
you more to open/close a lot of files than it will cost you to read 
some extra data into the file system cache.

Also, if you have LOTS of attributes in your dbf file that you do not 
need for rendering then you might want to think about thinning these 
down to what you do need so you have to do less disk IO to read your 
attributes when rendering your maps.

-Steve Woodbridge

On 25 Jan 2004 at 13:50, Bart van den Eijnden wrote:

> Hi list,
> 
> I saw a few posts from early 2003 about speeding up large shapefiles, but 
> never found any conclusions on the subject.
> 
> I have a question with regard to speeding up large shapefiles:
> 
> would it make sense to split up my large (350 Mb) shapefile in tiles, and 
> then use an OGR tileindex on the tiles (with quadtree indexes on both 
> tileindex and tiles)? If so, can anything be said about an ideal tile size 
> in Mb, or is this too much dependent on the data?
> 
> Ofcourse this will also be dependent on the area I am displaying with my 
> shapefile, and the maximum area a user can get displayed (by using the 
> MINSCALE/MAXSCALE settings in my MAP file).
> 
> Thanks in advance for any input on this.
> 
> Best regards,
> Bart
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 





More information about the MapServer-users mailing list