AW: [mapserver-users] How do i define my SLD inside the mapfile?

Albrecht.Weiser at hzd.hessen.de Albrecht.Weiser at hzd.hessen.de
Thu Aug 7 02:25:02 PDT 2008


Hi Bart,
what a luck that there's a workaround. Unluckily i'm not a php crack :o/ Could you please tell in a few catchwords how to apply the script?
Thanks
Albrecht

> -----Ursprüngliche Nachricht-----
> Von: bartvde at osgis.nl [mailto:bartvde at osgis.nl] 
> Gesendet: Donnerstag, 7. August 2008 09:52
> An: Weiser, Albrecht (HZD)
> Cc: mapserver-users at lists.osgeo.org
> Betreff: Re: [mapserver-users] How do i define my SLD inside 
> the mapfile?
> 
> No you can't use an SLD directly in a WMS server MAP file.
> 
> What I normally do is apply the SLD to the MAP file using a simple PHP
> script:
> 
> #!/bin/sh
> sudo -u apache php -f $0 $*; exit $?
> 
> <?php
> 
> if ($argc != 4) {
>   echo "Usage: applysldurl.php <input MAP file> <SLD url> <output MAP
> file>\n";
>   echo "\n";
>   echo "Applies the SLD url to the layers in the MAP file\n";
>   echo "\n";
>   exit(1);
> }
> 
> $oMap = ms_newMapObj($argv[1]);
> $oMap->applySLDURL($argv[2]);
> $oMap->save($argv[3]);
> 
> echo "Output saved to $argv[3]\n";
> 
> ?>
> 
> Best regards,
> Bart



More information about the MapServer-users mailing list