[mapserver-users] SLD and Mapserver

2011-05-31 Thread luis peinado
Hi list,
I'm using mapserver as a WMS server and I try to use an SLD file to render
my map, instead of the usual CLASS and STYLE labels.
I've succeded using an SLD parameter on my querystring but I can not get the
same result removing the sld url from the querystring and writing it
into wms_sld_url paramenter (into LAYER metadata tag).

I have done that as told here:http://mapserver.org/ogc/sld.html
But it seems that wms_sld_url is only useful when using mapserver as a WMS
client.
I would like to render my maps using SLD files instead of the STYLE label to
avoid programming on my client application.

Have you got any idea?

Best regards.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] SLD and Mapserver

2011-05-31 Thread Yewondwossen Assefa

Hi,

 It is not yet possible to use directly sld styles in a map file. We 
have discussed that a couple of times but It is still in the wish list 
for future versions. If you are interested to see that sooner than later 
and might be possible for you to contribute toward it's development, 
let  me know.


best regards,


On 31/05/2011 12:18 PM, luis peinado wrote:

Hi list,
I'm using mapserver as a WMS server and I try to use an SLD file to 
render my map, instead of the usual CLASS and STYLE labels.
I've succeded using an SLD parameter on my querystring but I can not 
get the same result removing the sld url from the querystring and 
writing it into wms_sld_url paramenter (into LAYER metadata tag).


I have done that as told here:http://mapserver.org/ogc/sld.html
But it seems that wms_sld_url is only useful when using mapserver as a 
WMS client.
I would like to render my maps using SLD files instead of the STYLE 
label to avoid programming on my client application.


Have you got any idea?

Best regards.



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



--

Assefa Yewondwossen
Software Analyst

Email: yass...@dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925



___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] SLD with Mapserver 5.4.2

2009-07-31 Thread Andrea Dessì
Hi Michael,

Thank you for your answer :)

Now SLD is working i had a mistake with names references.

I have just another question: how is possible to add a style
using SLD without overriding the whole server style?

I explain what i want to do: I have a map served by MapServer, so a
mapfile with layers and styles. I want to add a style with new
characteristics (could be outline or overriding just the color of the text).

Thanks,
Andrea



2009/7/30 Michael Schulz msch...@webgis.de

 Hi Andrea,

 to use SLD you won't need very special mapfile configuration. You
 should pay attention to setting the imgpath parameter of the web
 section correctly, i.e. accessible and writable by mapserver-cgi,
 since the sld's are stored there temporarily while/after downloading
 them from the specified URL. I am not aware of any other special
 configuration, but very helpful are the debugging outputs, that you
 can enable with the keyword DEBUG on at map or layer level. I find
 it most convenient to specify an errorfile path via CONFIG
 MS_ERRORFILE /ms4w/tmp/ms_error.txt at map level.

 Be sure to set the SLD's NamedLayer Name tag value exactly the same as
 your mapfile's layer name you want to style.

 Cheers, Michael


 2009/7/30 Andrea Dessì nkj...@gmail.com:
  Hi,
 
  i've started using Mapserver few days ago and i cannot apply SLD styles.
 
  i'm using  MapServer version 5.4.2
  OUTPUT=GIF OUTPUT=PNG
  OUTPUT=JPEG OUTPUT=WBMP
  OUTPUT=SVG
  SUPPORTS=PROJ
  SUPPORTS=AGG
  SUPPORTS=FREETYPE
  SUPPORTS=ICONV
  SUPPORTS=WMS_SERVER
  SUPPORTS=WMS_CLIENT
  SUPPORTS=WFS_SERVER
  SUPPORTS=WFS_CLIENT
  SUPPORTS=WCS_SERVER
  SUPPORTS=FASTCGI
  SUPPORTS=THREADS
  SUPPORTS=GEOS
  INPUT=EPPL7
  INPUT=POSTGIS
  INPUT=OGR
  INPUT=GDAL
  INPUT=SHAPEFILE
 
  under Ubuntu 9.04.
 
  I want to user mapserver as WMS Server and the apply SLD styles on the
  fly... the common query is:
  http://localhost/cgi-bin/wms?SERVICE=WMS;
  VERSION=1.1.1
  REQUEST=GetMap
  BBOX=-74.012362,40.752314,-73.948216,40.791051
  SRS=EPSG:4326
  WIDTH=500
  HEIGHT=500
  LAYERS=myground,myroads
  FORMAT=image/gif
  TRANSPARENT=TRUE
  SLD=http://localhost/mysld.xml
 
  But sld is not applying.
 
  The question is: there are specific parameters for using SLD in mapfile?
  I'm feeling a bit confused about this.
 
  Thank You,
  --
  Andrea
 
  ___
  mapserver-users mailing list
  mapserver-users@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/mapserver-users
 



 --
 ~~~
 Aufwind durch Wissen!

 Qualifizierte Open Source Schulungen bei der
 http://www.foss-akademie.de/
 ~~~

 ---
 Michael Schulz
 msch...@webgis.de

 in medias res
 Gesellschaft für Informationstechnologie mbH

 +++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

 Schwimmbadstraße 2
 D-79100  Freiburg i. Br.

 Tel:  +49 (0)761 705798-102
 Tel:  +49 (0)761 705798-0
 Fax: +49 (0)761 705798-09

 +++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

 http://www.webgis.de / http://www.zopecms.de
 --
 Geschäftsführer: Stefan Giese, Dr. Christof Lindenbeck
 Eingetragen im Handelsregister HRB 5930 beim Amtsgericht Freiburg
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] SLD with Mapserver 5.4.2

2009-07-31 Thread Michael Schulz
Hi Andrea,

mapserver uses sld in library mode, meaning that if for a certain
layer of the mapfile an sld symbolization is provided it takes
precedence over the mapfile symbolization. If for another layer no sld
id provided, then the mapfile symbolization is used. Thus, As far as I
know you can only replace the symbolization of a complete layer and
not add styling in a sense of taking the labelling definitions from
the mapfile and the fill-color from the sld for one layer.

It may nevertheless be that some definitions regarding symbolization
are mixed, e.g. the transparency settings of a layer is kept when
applying an sld (at least this was the case for older versions).

When you really want to add something to the symbolization, a possible
approach would be to use the getstyle request to obtain mapserver's
sld-representation of the current layer styling, then you could add or
modify that and sent it back modified for a getmap request.

Cheers, Michael

2009/7/31 Andrea Dessì nkj...@gmail.com:
 Hi Michael,

 Thank you for your answer :)

 Now SLD is working i had a mistake with names references.

 I have just another question: how is possible to add a style
 using SLD without overriding the whole server style?

 I explain what i want to do: I have a map served by MapServer, so a
 mapfile with layers and styles. I want to add a style with new
 characteristics (could be outline or overriding just the color of the text).

 Thanks,
 Andrea



 2009/7/30 Michael Schulz msch...@webgis.de

 Hi Andrea,

 to use SLD you won't need very special mapfile configuration. You
 should pay attention to setting the imgpath parameter of the web
 section correctly, i.e. accessible and writable by mapserver-cgi,
 since the sld's are stored there temporarily while/after downloading
 them from the specified URL. I am not aware of any other special
 configuration, but very helpful are the debugging outputs, that you
 can enable with the keyword DEBUG on at map or layer level. I find
 it most convenient to specify an errorfile path via CONFIG
 MS_ERRORFILE /ms4w/tmp/ms_error.txt at map level.

 Be sure to set the SLD's NamedLayer Name tag value exactly the same as
 your mapfile's layer name you want to style.

 Cheers, Michael


 2009/7/30 Andrea Dessì nkj...@gmail.com:
  Hi,
 
  i've started using Mapserver few days ago and i cannot apply SLD styles.
 
  i'm using  MapServer version 5.4.2
  OUTPUT=GIF OUTPUT=PNG
  OUTPUT=JPEG OUTPUT=WBMP
  OUTPUT=SVG
  SUPPORTS=PROJ
  SUPPORTS=AGG
  SUPPORTS=FREETYPE
  SUPPORTS=ICONV
  SUPPORTS=WMS_SERVER
  SUPPORTS=WMS_CLIENT
  SUPPORTS=WFS_SERVER
  SUPPORTS=WFS_CLIENT
  SUPPORTS=WCS_SERVER
  SUPPORTS=FASTCGI
  SUPPORTS=THREADS
  SUPPORTS=GEOS
  INPUT=EPPL7
  INPUT=POSTGIS
  INPUT=OGR
  INPUT=GDAL
  INPUT=SHAPEFILE
 
  under Ubuntu 9.04.
 
  I want to user mapserver as WMS Server and the apply SLD styles on the
  fly... the common query is:
  http://localhost/cgi-bin/wms?SERVICE=WMS;
  VERSION=1.1.1
  REQUEST=GetMap
  BBOX=-74.012362,40.752314,-73.948216,40.791051
  SRS=EPSG:4326
  WIDTH=500
  HEIGHT=500
  LAYERS=myground,myroads
  FORMAT=image/gif
  TRANSPARENT=TRUE
  SLD=http://localhost/mysld.xml
 
  But sld is not applying.
 
  The question is: there are specific parameters for using SLD in mapfile?
  I'm feeling a bit confused about this.
 
  Thank You,
  --
  Andrea
 
  ___
  mapserver-users mailing list
  mapserver-users@lists.osgeo.org
  http://lists.osgeo.org/mailman/listinfo/mapserver-users
 



 --
 ~~~
 Aufwind durch Wissen!

 Qualifizierte Open Source Schulungen bei der
 http://www.foss-akademie.de/
 ~~~

 ---
 Michael Schulz
 msch...@webgis.de

 in medias res
 Gesellschaft für Informationstechnologie mbH

 +++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

 Schwimmbadstraße 2
 D-79100  Freiburg i. Br.

 Tel:  +49 (0)761 705798-102
 Tel:  +49 (0)761 705798-0
 Fax: +49 (0)761 705798-09

 +++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

 http://www.webgis.de / http://www.zopecms.de
 --
 Geschäftsführer: Stefan Giese, Dr. Christof Lindenbeck
 Eingetragen im Handelsregister HRB 5930 beim Amtsgericht Freiburg
 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users





-- 
~~~
Aufwind durch Wissen!

Qualifizierte Open Source Schulungen bei der
http://www.foss-akademie.de/
~~~

---
Michael Schulz
msch...@webgis.de

in medias res
Gesellschaft für Informationstechnologie mbH

+++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

Schwimmbadstraße 2
D-79100  

Re: [mapserver-users] SLD with Mapserver 5.4.2

2009-07-31 Thread Andrea Dessì

Michael Schulz ha scritto:

Hi Andrea,

mapserver uses sld in library mode, meaning that if for a certain
layer of the mapfile an sld symbolization is provided it takes
precedence over the mapfile symbolization. If for another layer no sld
id provided, then the mapfile symbolization is used. Thus, As far as I
know you can only replace the symbolization of a complete layer and
not add styling in a sense of taking the labelling definitions from
the mapfile and the fill-color from the sld for one layer.
  

Yes, it's working now ;)

It may nevertheless be that some definitions regarding symbolization
are mixed, e.g. the transparency settings of a layer is kept when
applying an sld (at least this was the case for older versions).

When you really want to add something to the symbolization, a possible
approach would be to use the getstyle request to obtain mapserver's
sld-representation of the current layer styling, then you could add or
modify that and sent it back modified for a getmap request.
  

Michael, using java, we get the layer's style from the request.
Before doing the new request to WMS server, we tried to extract the
old style and then add a new style (in the new request there are  the 
old and the  new ones)


So using geotools we have:

   [...]
 StyleImpl styleImpl = new StyleImpl(); // istantiate new Style
 ListFeatureTypeStyle featuresStyles = new
   ArrayListFeatureTypeStyle(); //define list of styles
 featuresStyles.add(featureTypeStyle); // defining style list
 styleImpl.setFeatureStyles(featuresStyles);   // applying feature
   styles to the current style

 ListStyleImpl st = new ArrayListStyleImpl(); // the new style list

 st.add(style); // adding the old style coming from the request
 st.add(styleImpl); // adding our new style
 
 // then defining the new request with layer...
 Layer l = new Layer(); 
 l.setStyles(st);

 l.setName(nycroads);
 request.addLayer(l);

   [...]

So we are trying to:
- ask getCapabilites to WMS  server
- retrieving the style list from the layer
- retrieve the old style from the layer
- create a new style for the layer
- insert one old style and a new one to the layer
- do a request with the elaborated layer

result: not working :)

is it a good approach?

Thank you,
Andrea


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] SLD with Mapserver 5.4.2

2009-07-30 Thread Andrea Dessì

Hi,

i've started using Mapserver few days ago and i cannot apply SLD styles.

i'm using  MapServer version 5.4.2
OUTPUT=GIF OUTPUT=PNG
OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=SVG
SUPPORTS=PROJ
SUPPORTS=AGG
SUPPORTS=FREETYPE
SUPPORTS=ICONV
SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER
SUPPORTS=FASTCGI
SUPPORTS=THREADS
SUPPORTS=GEOS
INPUT=EPPL7
INPUT=POSTGIS
INPUT=OGR
INPUT=GDAL
INPUT=SHAPEFILE

under Ubuntu 9.04.

I want to user mapserver as WMS Server and the apply SLD styles on the 
fly... the common query is:

http://localhost/cgi-bin/wms?SERVICE=WMS;
VERSION=1.1.1
REQUEST=GetMap
BBOX=-74.012362,40.752314,-73.948216,40.791051
SRS=EPSG:4326
WIDTH=500
HEIGHT=500
LAYERS=myground,myroads
FORMAT=image/gif
TRANSPARENT=TRUE
SLD=http://localhost/mysld.xml

But sld is not applying.

The question is: there are specific parameters for using SLD in mapfile?
I'm feeling a bit confused about this.

Thank You,
--
Andrea

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] SLD with Mapserver 5.4.2

2009-07-30 Thread Michael Schulz
Hi Andrea,

to use SLD you won't need very special mapfile configuration. You
should pay attention to setting the imgpath parameter of the web
section correctly, i.e. accessible and writable by mapserver-cgi,
since the sld's are stored there temporarily while/after downloading
them from the specified URL. I am not aware of any other special
configuration, but very helpful are the debugging outputs, that you
can enable with the keyword DEBUG on at map or layer level. I find
it most convenient to specify an errorfile path via CONFIG
MS_ERRORFILE /ms4w/tmp/ms_error.txt at map level.

Be sure to set the SLD's NamedLayer Name tag value exactly the same as
your mapfile's layer name you want to style.

Cheers, Michael


2009/7/30 Andrea Dessì nkj...@gmail.com:
 Hi,

 i've started using Mapserver few days ago and i cannot apply SLD styles.

 i'm using  MapServer version 5.4.2
 OUTPUT=GIF OUTPUT=PNG
 OUTPUT=JPEG OUTPUT=WBMP
 OUTPUT=SVG
 SUPPORTS=PROJ
 SUPPORTS=AGG
 SUPPORTS=FREETYPE
 SUPPORTS=ICONV
 SUPPORTS=WMS_SERVER
 SUPPORTS=WMS_CLIENT
 SUPPORTS=WFS_SERVER
 SUPPORTS=WFS_CLIENT
 SUPPORTS=WCS_SERVER
 SUPPORTS=FASTCGI
 SUPPORTS=THREADS
 SUPPORTS=GEOS
 INPUT=EPPL7
 INPUT=POSTGIS
 INPUT=OGR
 INPUT=GDAL
 INPUT=SHAPEFILE

 under Ubuntu 9.04.

 I want to user mapserver as WMS Server and the apply SLD styles on the
 fly... the common query is:
 http://localhost/cgi-bin/wms?SERVICE=WMS;
 VERSION=1.1.1
 REQUEST=GetMap
 BBOX=-74.012362,40.752314,-73.948216,40.791051
 SRS=EPSG:4326
 WIDTH=500
 HEIGHT=500
 LAYERS=myground,myroads
 FORMAT=image/gif
 TRANSPARENT=TRUE
 SLD=http://localhost/mysld.xml

 But sld is not applying.

 The question is: there are specific parameters for using SLD in mapfile?
 I'm feeling a bit confused about this.

 Thank You,
 --
 Andrea

 ___
 mapserver-users mailing list
 mapserver-users@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/mapserver-users




-- 
~~~
Aufwind durch Wissen!

Qualifizierte Open Source Schulungen bei der
http://www.foss-akademie.de/
~~~

---
Michael Schulz
msch...@webgis.de

in medias res
Gesellschaft für Informationstechnologie mbH

+++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

Schwimmbadstraße 2
D-79100  Freiburg i. Br.

Tel:  +49 (0)761 705798-102
Tel:  +49 (0)761 705798-0
Fax: +49 (0)761 705798-09

+++ Bitte beachten Sie unsere neue Adresse und Durchwahl +++

http://www.webgis.de / http://www.zopecms.de
--
Geschäftsführer: Stefan Giese, Dr. Christof Lindenbeck
Eingetragen im Handelsregister HRB 5930 beim Amtsgericht Freiburg
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users