speed of map generation {Scanned}

Siki Zoltan siki at AGT.BME.HU
Tue Sep 12 05:33:13 EDT 2006


Hi,

Is your 90 MB data in one shapefile?
Did you generate spatial index for it? See shptree.
It makes drawing faster if you zoom in.
Another idea to use a tileindex (e.g. split the big shape into smaller
shapefiles). It also useful when zoomming in.
Try to create more shape files for different resolutions, like gdaladdo 
makes it for raster data. And turn on/off them depending on the actual map 
scale.

Just some tipps ...
Zoltan

On Tue, 12 Sep 2006, Ben Madin wrote:

> G'day all,
> 
> We are generating a map showing relative densities in various  
> polygons (worldwide adminstrative regions) of various commodities.  
> This is being done using php-mapscript (4.8), by querying a SQL  
> Server database, developing a range to code, and generating classes  
> below. The shapefile does not have any of the data associated with  
> it, only the id which matches up with that in the db.
> 
> When we do this at a country level (242 countries) there is little  
> trouble with speed - maybe a few seconds.
> 
> However, at the next level (3300 administrative regions) this is  
> taking way too long. Through various testing, the only step that is  
> taking longer than 1 second is the
> 
> $img = $map->draw();
> 
> step, which can take upwards of 15 seconds - very tedious for a user.  
> (Originally we tried it using reprojection (to orthographic) it was  
> routinely taking > 3 minutes!, so sadly that has been dropped.)
> 
> I accept that the shapefile is large (90MB), and some time will be  
> required, but this seems way to long. if we don't try to colour the  
> polygons, the map displays very fast.
> 
> I have attached the class definitions for a part of the mapfile which  
> is generated. The CLASSITEM is the polygon id. Any suggestions??
> 
> CLASS
>        NAME "< 7040000 /sq km"
>        EXPRESSION /^$/
>        METADATA
>        END
>        STYLE
>          ANGLE 360
>          COLOR 0 204 51
>          SYMBOL 0
>        END
>      END
>      CLASS
>        NAME "< 5280000 /sq km"
>        EXPRESSION /^157$/
>        METADATA
>        END
>        STYLE
>          ANGLE 360
>          COLOR 0 153 102
>          SYMBOL 0
>        END
>      END
>      CLASS
>        NAME "< 3520000 /sq km"
>        EXPRESSION /^158$|^162$|^163$/
>        METADATA
>        END
>        STYLE
>          ANGLE 360
>          COLOR 0 102 153
>          SYMBOL 0
>        END
>      END
>      CLASS
>        NAME "< 1760000 /sq km"
>        EXPRESSION /^156$|^160$|^161$/
>        METADATA
>        END
>        STYLE
>          ANGLE 360
>          COLOR 0 51 204
>          SYMBOL 0
>        END
>      END
>      CLASS
>        NAME " 0 "
>        EXPRESSION /^$/
>        METADATA
>        END
>        STYLE
>          ANGLE 360
>          COLOR 0 0 255
>          SYMBOL 0
>        END
>      END
>      CLASS
>        NAME "No Data"
>        EXPRESSION /^$/
>        METADATA
>        END
>        STYLE
>          ANGLE 360
>          COLOR 255 250 205
>          SYMBOL 0
>        END
>      END
> 
> 
> cheers
> 
> Ben	
> 
> 
> 



More information about the mapserver-users mailing list