EPSG lookups

Brock Anderson banders at REFRACTIONS.NET
Tue Jul 19 11:53:48 EDT 2005


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.

Thoughts?

Brock Anderson
-----------------

My requests look like this. Notice I am only requesting one layer, yet 
Mapserver goes to the "epsg" file for all layers.
http://my_server/fcgi-bin/mapserv.exe?map=c:\dss_coastal.map&service=WMS&VERSION=1.1.1&REQUEST=GetMap&LAYERS=CRIMS_EELGRASSES&STYLES=&SRS=EPSG%3A4269&BBOX=-135.0,45.7,-115.0,62.2&WIDTH=674&HEIGHT=559&FORMAT=image/gif&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage&


My .map file looks like this:

MAP
EXTENT 200000.0 300000.0 1900000.0 1800000.0
SIZE 100 100
UNITS meters
WEB
METADATA
"wms_title" "bla bla"
"wfs_title" "bla bla"
"wms_onlineresource" "bla bla"
"wfs_onlineresource" "bla bla"
"wms_srs" "EPSG:3005 EPSG:42102 EPSG:4269 EPSG:102190 EPSG:4326 
EPSG:26708 EPSG:26709 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26908 
EPSG:26909 EPSG:26910 EPSG:26911 EPSG:26912 EPSG:32608 EPSG:32609 
EPSG:32610 EPSG:32611 EPSG:32612"
"wfs_srs" "EPSG:3005 EPSG:42102 EPSG:4269 EPSG:102190 EPSG:4326 
EPSG:26708 EPSG:26709 EPSG:26710 EPSG:26711 EPSG:26712 EPSG:26908 
EPSG:26909 EPSG:26910 EPSG:26911 EPSG:26912 EPSG:32608 EPSG:32609 
EPSG:32610 EPSG:32611 EPSG:32612"
END #end metadata
END #end web
PROJECTION
"init=EPSG:3005"
END #end projection

# ===============================
#
# layers
#
# ===============================

# Eelgrass
LAYER
NAME 'CRIMS_EELGRASSES'
CONNECTIONTYPE sde
CONNECTION "bla bla"
DATA 'WHSE_WILDLIFE_MANAGEMENT.CRIMS_EELGRASSES,GEOMETRY'
CLASS
NAME "Eelgrasses"
STYLE
COLOR 140 200 0
OUTLINECOLOR 60 150 0
END #end style
END #end class
TYPE polygon
MAXSCALE 10000000
STATUS ON
PROJECTION
"init=EPSG:3005"
END #end projection
METADATA
"wms_title" "CRIMS Eelgrasses"
"wfs_title" "CRIMS Eelgrasses"
END #end metadata
PROCESSING "CLOSE_CONNECTION=DEFER"
DUMP TRUE #required for WFS
TEMPLATE "crims"
END #end layer

# Herring spawning grounds
LAYER
NAME 'CRIMS_HERRING_SPAWN'
CONNECTIONTYPE sde
CONNECTION "bla bla"
DATA 'WHSE_WILDLIFE_MANAGEMENT.CRIMS_HERRING_SPAWN,GEOMETRY'
CLASS
NAME "HerringSpawn"
STYLE
COLOR 235 122 255
MINSIZE 3
MAXSIZE 3
END #end style
END #end class
TYPE line
MAXSCALE 10000000
STATUS ON
PROJECTION
"init=EPSG:3005"
END #end projection
METADATA
"wms_title" "CRIMS Herring Spawn"
"wfs_title" "CRIMS Herring Spawn"
END #end metadata
PROCESSING "CLOSE_CONNECTION=DEFER"
DUMP TRUE #required for WFS
TEMPLATE "crims"
END #end layer




# ... 70 more layers here. All have the same projection




END #end map



More information about the mapserver-dev mailing list