[mapserver-users] use SLD to dynamic label switching

Barend Kobben kobben at itc.nl
Fri Mar 6 11:12:18 EST 2009


One thing to care care of if you use SLD is having not much to do
with the SLDs themselves, but with TMP file settings.

Using SLDs is dependent on the correct setting of the two settings
 IMAGEPATH  -- where the mapserver software puts the SLD and other temporary
files
 IMAGEURL -- where the web browser and other http services pick them up.

Setting these incorrectly, and more importantly their security setting
incorrrectly, will normally give no problems, but when using SLDs (and also
in other cases, eg. when chaining Mapserver to external WMS and WFS
services), they will make MS malfunction, but SILENTLY (ie. No error
messages).

Eg. in our set ups of a WMS with external SLD they are set as follows:

For  a *nix setup ( MacOSX) with Mapserver CGI 'behind'  Apache:
WEB
    IMAGEPATH "/Users/kobben/Sites/ms_tmp/"
    IMAGEURL "http://localhost/~kobben/ms_tmp/"
    #--------------------------------------------#
    METADATA
       [all your web metadata...]
    END #metadata
END #web

For a Win box with Mapserver CGI 'behind'  IIS:
  IMAGEPATH "C:/tmp/ms_tmp/"
  IMAGEURL "http://geoserver.itc.nl/ms_tmp/"

The IMAGEPATh is a directory that is reacheable by Mapserver at this real
location (in this case expressed as Unix BSD path on my MacOSX or as  UNC
path on Win) and that has read & write access set  for the Mapserver
process. Eg. on the Winbox it should have write access for the anonymous
system service account under which Mapserver runs (usually something like
SERVERNAME\IWAM_SERVERNAME).

You can test this by seeing if files with names like) are being created when
you request the WMS with external SLD. If they are the IMAGEPATH celarly
works. Then test if you can point a browser to the IMAGEURL and pick up the
tmp file. If that worsk the IMAGEURL is also OK. Now it should work...

Hope this helps.


-- 
Barend Köbben
International Institute for Geo-Information
Sciences and Earth Observation (ITC)
PO Box 6, 7500AA Enschede, The Netherlands
+31 (0)53 4874253



On 05-03-09 16:54, "Balázs Bámer" <bamerbalazs at gmail.com> wrote:

> Hi All,
> 
> I have a WMS service
> 
> http://att-it.homelinux.net:22080/cgi-bin/spatial?SERVICE=WMS&VERSION=1.1.1&RE
> QUEST=GetMap&LAYERS=szerkesztheto,csakolv,pont&STYLES=&SRS=epsg:23700&BBOX=420
> 000,40000,950000,370000&WIDTH=938&HEIGHT=591&FORMAT=image/png&SLD=http://att-i
> t.homelinux.net:22080/sld/spatialszerkeszthetoproba.xml
> 
> Mapfile is here, the layer in question is "szerkesztheto"
> http://att-it.homelinux.net:22080/spatial.map
> 
> which works without the SLD request part and does what I want. I want
> to use the SLD to alter rendering colors and add labels, because I
> beleive that this would be more efficient than having a geometry layer
> and a separate annotation one. Moreover, I want to try SLD.
> 
> So with SLD the layer in question disappears. Inspecting the
> transformed layer (written in /tmp)
> http://att-it.homelinux.net:22080/spatialsld3.map
> the layer "szerkesztheto" is turned into annotation type which I
> didn't want. But even being this type, no labels are shown.
> 
> Can this SLD trick be done, and if yes, where am I wrong?
> 
> Thank you in advance!
> best regards: Balázs
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

International Institute for Geo-Information Science and Earth Observation (ITC)
Chamber of Commerce: 410 27 560

E-mail disclaimer
The information in this e-mail, including any attachments, is intended for the addressee only. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or action in relation to the content of this information is strictly prohibited. If you have received this e-mail by mistake, please delete the message and any attachment and inform the sender by return e-mail. ITC accepts no liability for any error or omission in the message content or for damage of any kind that may arise as a result of e-mail transmission.


More information about the mapserver-users mailing list