EPSG lookups

Frank Warmerdam fwarmerdam at GMAIL.COM
Tue Jul 19 13:54:44 EDT 2005


On 7/19/05, Brock Anderson <banders at refractions.net> wrote:
> Hi Developers,
> 
> While doing some performance tests against Mapserver, I noticed that
> Mapserver can be significantly slower for WMS GetMap requests when the
> .map file has many layers. I did some experimenting, and it looks like
> for each GetMap request Mapserver attempts to look up the projection
> definition for every layer -- *even for layers that I did not request.*
> 
> Why does Mapserver need to know the projection details for layers that
> aren't involved in the request?
> 
> If it is necessary to lookup the projection definition for each layer,
> would it make sense to cache the definitions for even faster lookup?
> 
> Is there something in my .map file (below) that makes it necessary to
> look up projection definitions for each layer?
> 
> I realize that I can simply provide the proj 4 string for each layer
> within the .map file, but for cases where I use the init=EPSG syntax, I
> still don't expect Mapserver to go to the "epsg" file for layers that
> aren't involved in my request.

Brock,

I haven't tracked through the details, but basically I think MapServer
tries to fully resolve the projection definitions at the point it loads
the map file, whether some layers are going to be used or not. 

One approach would be to try and defer loading of information for 
coordinate systems when they aren't strictly needed.  Another easier
approach might be to have Mapserver (or PROJ.4) cache the definitions
read from the init files.  Thus, only the first fetch would involve a slow
pass through the file. 

If you file a bug on this in the MapServer bugzilla and assign it to me,
I'll look into handling it. 

Best regards,
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-dev mailing list