WMS GetMap-Request and class expressions

Stefanie Weykam sweykam at TELELINE.ES
Fri Oct 7 11:32:05 EDT 2005


Hi list members,

A while ago I developed a very simple mapserver application which I would
now like to make available as WMS. I wonder if it is possible to modify the
class expressions via the WMS GetMap-request ?? Or can this only be done by
WFS?

You can see the application here at: http://161.111.161.171/Atlas/ 
It contains maps of 3 thematic groups (species distribution maps, maps on
biodiversity indices and environmental factors) and a query that allows to
generate a list of species, biodiversity indices and environmental factors
for each graticule.

The species distribution maps are what I would like to make available as web
map service but I can't figure out how to pass the parameter on that
indicates the species code. 

The problem is the layer 'Dlyr', my species distribution layer. 
As for the application, the user selects a species name from a list and this
variable is then used to render the map by modifying the predefined classes
in the map file.
  $clObj0=$Dlyr->getClass(0);
  $clObj0->setExpression('(['.$sp.']=0)'); 
  $clObj1=$Dlyr->getClass(1);
  $clObj1->setExpression('(['.$sp.']>0 AND ['.$sp.']<=20)'); 
  $clObj2=$Dlyr->getClass(2);
  $clObj2->setExpression('(['.$sp.']>20 AND ['.$sp.']<=40)'); 
  $clObj3=$Dlyr->getClass(3);
  $clObj3->setExpression('(['.$sp.']>40 AND ['.$sp.']<=60)');  
  $clObj4=$Dlyr->getClass(4);
  $clObj4->setExpression('(['.$sp.']>60 AND ['.$sp.']<=80)');  
  $clObj5=$Dlyr->getClass(5);
  $clObj5->setExpression('(['.$sp.']>80)');

The class ranges never change, no matter what species is selected.
The species code $sp identifies a column in a PostgreSQL table, i.e. [DEMI].
Each species has its table column.

I have already prepared a first version that you may try typing this in your
browser: 
http://161.111.161.171/cgi-bin/AtlasAves.exe?service=WMS&request=GetCapabili
ties

You may retrieve a map composition, for example...
http://161.111.161.171/cgi-bin/AtlasAves.exe?service=WMS&version=1.1.1&reque
st=GetMap&layers=fondo,Dlyr,cuad50,cuad_anno&format=png&transparent

First, the client has to have as well a species list that allows to select
and pass on the species code (I will later make this list available). How is
the species identifier added to the request string ?

I guess, this calls for providing the layer as WFS instead (?). The client
then creates his own classes and I don't have to modify my code at all?

Is it possible to avoid that the whole data set is retrieved by a
GetFeature-request? I tried by specifying 'wfs_maxfeatures', but it had no
effect on the GetFeature response.

I am using MapServer 4.4 and this layer is a PostGIS table.

Thanks for your comments,
Stefanie Weykam



More information about the mapserver-users mailing list