[Geoserver-users] get and put of SLD xml files

hello all,

is there a way to programmatically send and receive SLD files to GeoServer;
e.g. access, and may be replace, the style named 'population' (which seems to
be defined in popshade.sld in the folder $GEOSERVER_WEBAPP/conf/styles) used
by the 'topp:states' layer?

TIA + cheers;
rsn

Raif S. Naffah ha scritto:

hello all,

is there a way to programmatically send and receive SLD files to GeoServer; e.g. access, and may be replace, the style named 'population' (which seems to be defined in popshade.sld in the folder $GEOSERVER_WEBAPP/conf/styles) used by the 'topp:states' layer?

As far as I know, we do lack a GetStyle, we do have a prototype PutStyles but they told me it's not compliant with the SLD WMS extensions, and its not documented anywhere, neither...
Maybe my colleagues know more, let's wait and see what they can say about this.

Cheers
Andrea

Brent was the one who coded it up, and I was hoping he'd answer, but let's ping him directly.

Brent, could you point Raif at how to programmatically put a style in to GeoServer? Maybe a code snippet from your basic SLD editor?

Chris

Andrea Aime wrote:

Raif S. Naffah ha scritto:

hello all,

is there a way to programmatically send and receive SLD files to GeoServer; e.g. access, and may be replace, the style named 'population' (which seems to be defined in popshade.sld in the folder $GEOSERVER_WEBAPP/conf/styles) used by the 'topp:states' layer?

As far as I know, we do lack a GetStyle, we do have a prototype PutStyles but they told me it's not compliant with the SLD WMS extensions, and its not documented anywhere, neither...
Maybe my colleagues know more, let's wait and see what they can say about this.

Cheers
Andrea

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:1003,45c05817119411194215290!

--
Chris Holmes
The Open Planning Project
http://topp.openplans.org

Hi Raif,
Sorry just saw the email this morning. We do have a pseudo putStyles method. Here is the breakdown of how to use it:

Send a POST request to your server instance using this url: localhost:8080/geoserver/wms?request=putstyles
(replace 'localhost' with your server address)
Then the body just has to be the SLD file.
Make sure that the SLD has a NamedLayer where the <Name> is equal to the feature type you want to set the style for. Then in the NamedLayer tag make sure there is a <UserStyle> that has the name of the style you want to use.

Here is a snippit from our basic SLD editor that builds the SLD file before it sends it off:
XML = '<?xml version="1.0" encoding="UTF-8"?>'+"\n";
    XML += '<StyledLayerDescriptor version="1.0.0"'+"\n";
    XML += ' xmlns:gml="http://www.opengis.net/gml&quot;&#39;\+&quot;\\n&quot;;
    XML += ' xmlns:ogc="http://www.opengis.net/ogc&quot;&#39;\+&quot;\\n&quot;;
    XML += ' xmlns="http://www.opengis.net/sld&quot;&gt;&#39;\+&quot;\\n&quot;;
    XML += ' <NamedLayer>'+"\n";
    XML += ' <Name>'+featureType+'</Name>'+"\n";
    XML += ' <UserStyle>'+"\n";
    XML += ' <Name>'+featureType+'_style</Name>'+"\n";
    XML += ' <Title>geoserver style</Title>'+"\n";
    XML += ' <Abstract>Generated by GeoServer</Abstract>'+"\n";
    XML += ' <FeatureTypeStyle>'+"\n";
    XML += ' <Rule>'+"\n";
...

Be warned that the put styles request is not very robust and was designed just for the sld editor, but it wouldn't be hard to improve it and I could point you at the code and walk you through how to improve it if you would like. It is definitely something that would be nice to have.

Feel free to ask me if you need any more help.
cheers,

Brent Owens
(The Open Planning Project)

Chris Holmes wrote:

Brent was the one who coded it up, and I was hoping he'd answer, but let's ping him directly.

Brent, could you point Raif at how to programmatically put a style in to GeoServer? Maybe a code snippet from your basic SLD editor?

Chris

Andrea Aime wrote:

Raif S. Naffah ha scritto:

hello all,

is there a way to programmatically send and receive SLD files to GeoServer; e.g. access, and may be replace, the style named 'population' (which seems to be defined in popshade.sld in the folder $GEOSERVER_WEBAPP/conf/styles) used by the 'topp:states' layer?

As far as I know, we do lack a GetStyle, we do have a prototype PutStyles but they told me it's not compliant with the SLD WMS extensions, and its not documented anywhere, neither...
Maybe my colleagues know more, let's wait and see what they can say about this.

Cheers
Andrea

-------------------------------------------------------------------------

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

hello all,

thank you Brent, Chris and Andrea for your prompt reply.

Brent, i shall give this a go with GeoServer 1.4.0 if it works it will answer
my 'put-style' part of the question. if i encounter any problems i'll take
you on your offer and will ask for help!

how about getting an SLD xml file; is there a ?request=getstyles&layers=foo...
equivalent?

On Thursday 01 February 2007 03:05, Brent Owens wrote:

Hi Raif,
Sorry just saw the email this morning. We do have a pseudo putStyles
method. Here is the breakdown of how to use it:

Send a POST request to your server instance using this url:
localhost:8080/geoserver/wms?request=putstyles
(replace 'localhost' with your server address)
Then the body just has to be the SLD file.
Make sure that the SLD has a NamedLayer where the <Name> is equal to the
feature type you want to set the style for. Then in the NamedLayer tag
make sure there is a <UserStyle> that has the name of the style you want
to use.

Here is a snippit from our basic SLD editor that builds the SLD file
before it sends it off:
XML = '<?xml version="1.0" encoding="UTF-8"?>'+"\n";
    XML += '<StyledLayerDescriptor version="1.0.0"'+"\n";
    XML += ' xmlns:gml="http://www.opengis.net/gml&quot;&#39;\+&quot;\\n&quot;;
    XML += ' xmlns:ogc="http://www.opengis.net/ogc&quot;&#39;\+&quot;\\n&quot;;
    XML += ' xmlns="http://www.opengis.net/sld&quot;&gt;&#39;\+&quot;\\n&quot;;
    XML += ' <NamedLayer>'+"\n";
    XML += ' <Name>'+featureType+'</Name>'+"\n";
    XML += ' <UserStyle>'+"\n";
    XML += ' <Name>'+featureType+'_style</Name>'+"\n";
    XML += ' <Title>geoserver style</Title>'+"\n";
    XML += ' <Abstract>Generated by GeoServer</Abstract>'+"\n";
    XML += ' <FeatureTypeStyle>'+"\n";
    XML += ' <Rule>'+"\n";
...
...
...

Be warned that the put styles request is not very robust and was
designed just for the sld editor, but it wouldn't be hard to improve it
and I could point you at the code and walk you through how to improve it
if you would like. It is definitely something that would be nice to have.

Feel free to ask me if you need any more help.
cheers,

Brent Owens
(The Open Planning Project)

Chris Holmes wrote:
> Brent was the one who coded it up, and I was hoping he'd answer, but
> let's ping him directly.
>
> Brent, could you point Raif at how to programmatically put a style in
> to GeoServer? Maybe a code snippet from your basic SLD editor?
>
> Chris
>
> Andrea Aime wrote:
>> Raif S. Naffah ha scritto:
>>> hello all,
>>>
>>> is there a way to programmatically send and receive SLD files to
>>> GeoServer; e.g. access, and may be replace, the style named
>>> 'population' (which seems to be defined in popshade.sld in the
>>> folder $GEOSERVER_WEBAPP/conf/styles) used by the 'topp:states' layer?
>>
>> As far as I know, we do lack a GetStyle, we do have a prototype
>> PutStyles but they told me it's not compliant with the SLD WMS
>> extensions, and its not documented anywhere, neither...
>> Maybe my colleagues know more, let's wait and see what they can say
>> about this.
>>
>> Cheers
>> Andrea
>>
>> ------------------------------------------------------------------------
>>-
>>
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to
>> share your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
>>V
>>
>> _______________________________________________
>> Geoserver-users mailing list
>> Geoserver-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
cheers;
rsn

We haven't implemented getStyles yet, but it should be an easy one to do if you would like to tackle it =)

Brent Owens
(The Open Planning Project)

Raif S. Naffah wrote:

hello all,

thank you Brent, Chris and Andrea for your prompt reply.

Brent, i shall give this a go with GeoServer 1.4.0 if it works it will answer my 'put-style' part of the question. if i encounter any problems i'll take you on your offer and will ask for help!

how about getting an SLD xml file; is there a ?request=getstyles&layers=foo... equivalent?

On Thursday 01 February 2007 03:05, Brent Owens wrote:
  

Hi Raif,
Sorry just saw the email this morning. We do have a pseudo putStyles
method. Here is the breakdown of how to use it:

Send a POST request to your server instance using this url:
localhost:8080/geoserver/wms?request=putstyles
(replace 'localhost' with your server address)
Then the body just has to be the SLD file.
Make sure that the SLD has a NamedLayer where the <Name> is equal to the
feature type you want to set the style for. Then in the NamedLayer tag
make sure there is a <UserStyle> that has the name of the style you want
to use.

Here is a snippit from our basic SLD editor that builds the SLD file
before it sends it off:
XML = '<?xml version="1.0" encoding="UTF-8"?>'+"\n";
    XML += '<StyledLayerDescriptor version="1.0.0"'+"\n";
    XML += ' xmlns:gml="http://www.opengis.net/gml&quot;&#39;\+&quot;\\n&quot;;
    XML += ' xmlns:ogc="http://www.opengis.net/ogc&quot;&#39;\+&quot;\\n&quot;;
    XML += ' xmlns="http://www.opengis.net/sld&quot;&gt;&#39;\+&quot;\\n&quot;;
    XML += ' <NamedLayer>'+"\n";
    XML += ' <Name>'+featureType+'</Name>'+"\n";
    XML += ' <UserStyle>'+"\n";
    XML += ' <Name>'+featureType+'_style</Name>'+"\n";
    XML += ' <Title>geoserver style</Title>'+"\n";
    XML += ' <Abstract>Generated by GeoServer</Abstract>'+"\n";
    XML += ' <FeatureTypeStyle>'+"\n";
    XML += ' <Rule>'+"\n";
...

Be warned that the put styles request is not very robust and was
designed just for the sld editor, but it wouldn't be hard to improve it
and I could point you at the code and walk you through how to improve it
if you would like. It is definitely something that would be nice to have.

Feel free to ask me if you need any more help.
cheers,

Brent Owens
(The Open Planning Project)

Chris Holmes wrote:
    

Brent was the one who coded it up, and I was hoping he'd answer, but
let's ping him directly.

Brent, could you point Raif at how to programmatically put a style in
to GeoServer? Maybe a code snippet from your basic SLD editor?

Chris

Andrea Aime wrote:
      

Raif S. Naffah ha scritto:
        

hello all,

is there a way to programmatically send and receive SLD files to
GeoServer; e.g. access, and may be replace, the style named
'population' (which seems to be defined in popshade.sld in the
folder $GEOSERVER_WEBAPP/conf/styles) used by the 'topp:states' layer?
          

As far as I know, we do lack a GetStyle, we do have a prototype
PutStyles but they told me it's not compliant with the SLD WMS
extensions, and its not documented anywhere, neither...
Maybe my colleagues know more, let's wait and see what they can say
about this.

Cheers
Andrea

------------------------------------------------------------------------
-

Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to
share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
        
  ------------------------------------------------------------------------

!DSPAM:1005,45c109fc258591995013331!

hello all,

On Thursday 01 February 2007 08:39, Brent Owens wrote:

We haven't implemented getStyles yet, but it should be an easy one to do
if you would like to tackle it =)

i might do that if i cannot solve my problem without it.

thanks again for your help!

Brent Owens
(The Open Planning Project)

Raif S. Naffah wrote:
> hello all,
>
> thank you Brent, Chris and Andrea for your prompt reply.
>
> Brent, i shall give this a go with GeoServer 1.4.0 if it works it will
> answer my 'put-style' part of the question. if i encounter any problems
> i'll take you on your offer and will ask for help!
>
> how about getting an SLD xml file; is there a
> ?request=getstyles&layers=foo... equivalent?
>
> On Thursday 01 February 2007 03:05, Brent Owens wrote:
>> Hi Raif,
>> Sorry just saw the email this morning. We do have a pseudo putStyles
>> method. Here is the breakdown of how to use it:
>>
>> Send a POST request to your server instance using this url:
>> localhost:8080/geoserver/wms?request=putstyles
>> (replace 'localhost' with your server address)
>> Then the body just has to be the SLD file.
>> Make sure that the SLD has a NamedLayer where the <Name> is equal to the
>> feature type you want to set the style for. Then in the NamedLayer tag
>> make sure there is a <UserStyle> that has the name of the style you want
>> to use.
>>
>> Here is a snippit from our basic SLD editor that builds the SLD file
>> before it sends it off:
>> XML = '<?xml version="1.0" encoding="UTF-8"?>'+"\n";
>> XML += '<StyledLayerDescriptor version="1.0.0"'+"\n";
>> XML += ' xmlns:gml="http://www.opengis.net/gml&quot;&#39;\+&quot;\\n&quot;;
>> XML += ' xmlns:ogc="http://www.opengis.net/ogc&quot;&#39;\+&quot;\\n&quot;;
>> XML += ' xmlns="http://www.opengis.net/sld&quot;&gt;&#39;\+&quot;\\n&quot;;
>> XML += ' <NamedLayer>'+"\n";
>> XML += ' <Name>'+featureType+'</Name>'+"\n";
>> XML += ' <UserStyle>'+"\n";
>> XML += ' <Name>'+featureType+'_style</Name>'+"\n";
>> XML += ' <Title>geoserver style</Title>'+"\n";
>> XML += ' <Abstract>Generated by
>> GeoServer</Abstract>'+"\n"; XML += '
>> <FeatureTypeStyle>'+"\n";
>> XML += ' <Rule>'+"\n";
>> ...
>> ...
>> ...
>>
>> Be warned that the put styles request is not very robust and was
>> designed just for the sld editor, but it wouldn't be hard to improve it
>> and I could point you at the code and walk you through how to improve it
>> if you would like. It is definitely something that would be nice to
>> have.
>>
>> Feel free to ask me if you need any more help.
>> cheers,
>>
>> Brent Owens
>> (The Open Planning Project)
>>
>> Chris Holmes wrote:
>>> Brent was the one who coded it up, and I was hoping he'd answer, but
>>> let's ping him directly.
>>>
>>> Brent, could you point Raif at how to programmatically put a style in
>>> to GeoServer? Maybe a code snippet from your basic SLD editor?
>>>
>>> Chris
>>>
>>> Andrea Aime wrote:
>>>> Raif S. Naffah ha scritto:
>>>>> hello all,
>>>>>
>>>>> is there a way to programmatically send and receive SLD files to
>>>>> GeoServer; e.g. access, and may be replace, the style named
>>>>> 'population' (which seems to be defined in popshade.sld in the
>>>>> folder $GEOSERVER_WEBAPP/conf/styles) used by the 'topp:states'
>>>>> layer?
>>>>
>>>> As far as I know, we do lack a GetStyle, we do have a prototype
>>>> PutStyles but they told me it's not compliant with the SLD WMS
>>>> extensions, and its not documented anywhere, neither...
>>>> Maybe my colleagues know more, let's wait and see what they can say
>>>> about this.
>>>>
>>>> Cheers
>>>> Andrea
>>>>
>>>> ----------------------------------------------------------------------
>>>>-- -
>>>>
>>>> Take Surveys. Earn Cash. Influence the Future of IT
>>>> Join SourceForge.net's Techsay panel and you'll get the chance to
>>>> share your
>>>> opinions on IT & business topics through brief surveys - and earn cash
>>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEV
>>>>DE V
>>>>
>>>> _______________________________________________
>>>> Geoserver-users mailing list
>>>> Geoserver-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
> ------------------------------------------------------------------------
>
> !DSPAM:1005,45c109fc258591995013331!

cheers;
rsn