[Mapserver-users] optimizing shapefiles with the mapserver utilities?

Paul Ramsey pramsey at refractions.net
Tue Feb 11 16:29:06 EST 2003


Hi Eric,

Eric Davies wrote:
> 
> I've got some fairly large shapefiles (> 100M) which I'm asking 
> mapserver to display. I'd like to improve the speed at which it
> processes these large files. I've already done the level-of-detail
> stuff (setting the minimum and maximum scales at which a layer is
> displayed), and I've built up the quadtree index with shptree.
> However, the latter didn't make much change to the speed.

That is very odd. I have always found the indexes to make a substantial 
difference. Obviously it won't make any difference for rendering the 
whole layer, but zoomed in to an area it should make a substantial 
difference.

> My suspicion is that my shapefiles are relatively unordered, so that
>  elements for any particular small region are likely scattered across
> the entire shapefile. What I'd like to do is order the shapefile so
> that geometries that are geographically close together are more
> likely to be close together in the shapefile.

Instead, you might want to order the shapefile by feature size, and then 
set a MAXFEATURES parameter in your layer. That way, when you are 
rendering more features than you "need" visually, you'll get the 
"important" (big) features into the picture first, and stop rendering 
before you waste alot of time on small features which are barely visible.

P.

-- 
       __
      /
      | Paul Ramsey
      | Refractions Research
      | Email: pramsey at refractions.net
      | Phone: (250) 885-0632
      \_




More information about the mapserver-users mailing list