[mapserver-users] Relative path's in mapfile

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Jan 25 10:38:55 EST 2012


Daniel Morissette wrote:

> Adding hardcoded vendor-specific params to the automatically generated
> URL sounds like a nice idea. We'd just need someone to champion it  ;-)

I started to think that I made an online demo when I was playing with this some time ago. This one is using variable "sql" and runtime substitution and something really Mapserver specific that I do not really undestand myself. I copied the example from somewhere and modified it a bit and it works. I mean this "map.layer[osm_pisteet].class[0].style[0]=+COLOR+0+255+0" thing.

So, select restaurants and pubs from OpenStreetMap tags and paint them green

http://hip.latuviitta.org/cgi-bin/ms_ows?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=563&HEIGHT=437&LAYERS=osm_pisteet&TRANSPARENT=TRUE&FORMAT=image/png&BBOX=-369151.98300283286,6597900.0,1511076.628895184,8057331.444759207&SRS=EPSG:3067&STYLES=&sql=amenity=%27restaurant%27%20OR%20amenity=%27pub%27&map.layer[osm_pisteet].class[0].style[0]=+COLOR+0+255+0

Or select fuel stations from the data and paint them red

http://hip.latuviitta.org/cgi-bin/ms_ows?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=563&HEIGHT=437&LAYERS=osm_pisteet&TRANSPARENT=TRUE&FORMAT=image/png&BBOX=-369151.98300283286,6597900.0,1511076.628895184,8057331.444759207&SRS=EPSG:3067&STYLES=&sql=amenity=%27fuel%27&map.layer[osm_pisteet].class[0].style[0]=+COLOR+255+0+0

The same effect could be mostly achieved by using SLD_BODY but in a heavier way.

All that that is missing is really the champion who could automatically bake in the extra parameters into the onlineresource.

Actually, it is already possible to utilise those extra parameters with QGis and OpenJUMP is one just uses them in the GetCapabilies URL. Mapserver is sending the standard fixed onlineresource back, but because it is often wrong both programs ans user if they want to use the advertised URL or the same that was used for reading GetCapabilities. If uses selects the latter, a tailored WMS map will appear.

-Jukka Rahkonen-


More information about the mapserver-users mailing list