RE: [Geoserver-users] Editing SLD

Hi,

I believe the easiest way to test an SLD you are developing is to do a GetLegendGraphic request, using the path to the SLD inline.

For example:

http://your-host/geoserver/wms/GetLegendGraphic?VERSION=1.0.0&FORMAT=image/png&WIDTH=50&HEIGHT=50&LAYER=any-existing-layer&SLD=http://path-to-your-sld-file

If you change the host name above, change 'any-existing-layer' above to any layer you have, like 'states_shapefile:states', and change the path to your SLD you should get something like this:

http://aadc-maps.aad.gov.au/geoserver/wms/GetLegendGraphic?VERSION=1.0.0&FORMAT=image/png&WIDTH=50&HEIGHT=50&LAYER=shapefile:continent&SLD=http://aadc-maps.aad.gov.au/temp/symbology/SLD/tmp_86276989_1.sld

(The link above will only work for 2 hours more until the program that generated it expires the SLD - it's created automatically, but you can view our existing symbol library at http://aadc-maps.aad.gov.au/symbology/. Currently, the public can only view existing SLDs - only we have access to the tool that creates them.)

Hope this helps,

Miles Jordan
Applications Developer
The Australian Antarctic Data Centre

-----Original Message-----
From: geoserver-users-admin@lists.sourceforge.net
[mailto:geoserver-users-admin@lists.sourceforge.net] On
Behalf Of Chris Holmes
Sent: Thursday, 18 May 2006 12:48 AM
To: Alexander Petkov
Cc: Javier de la Torre; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Editing SLD

Alexander Petkov wrote:
> Hello Javier:
>
>
> On 5/17/06, Javier de la Torre <jatorre@...84...> wrote:
>
>> Hi all,
>>
>> I am right now creating and editing SLD files to present
my maps but
>> I find a little bit annoying the way to develop them. How
do you do
>> when you want to test changes in the style?
>>
>> I am directly editing the SLD file that has been uploaded to the /
>> data/styles and then requesting a map to see the changes... but it
>> seems that the style is somehow cached in memory and the
changes do
>> not take effect...
>>
>> How do you do test the styles? Do I have to restart tomcat
every time
>> I do a change on the style to see its effect?
>
>
> You need to reload the catalog. There are some ways to do that in a
> way other than the web interface, see the following wiki page for
> details:
>
>
http://docs.codehaus.org/display/GEOSDOC/Alternative+for+reloading+the
> +Geoserver+catalog

Note that this is more for programmatically reloading it. You can
accomplish the same thing by just hitting 'load' in the web
admin tool.
  This forces a reload of the sld stuff in memory, so if
you've changed
things they'll be picked up.

Chris

>
>
> Alex
>
> PS Except that codehaus seems to be down, as already
mentioned on the list.
>  ) N j w v  j+xמv , h nǫ ' ǜ g ۟} 'z rIr +a
נ ^vל z% > f
> {*. :ey "z yhi 1g J ^ ) X jب ' M[jǝ p)i ^ ) i
 . 'z zW&vY 'u N ۭ Z ]
> 덆z  ǫ f ) +- ,z ޮ  b , y + ޶em +- . ǟ  
+- b ا~ z  ǫ

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

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.aad.gov.au/
___________________________________________________________________________

Thanks Miles.

I've never used the GtLegendGraphic operation, it is nice.
Your symbology library is here http://aadc-maps.aad.gov.au/aadc/symbology/ (if someone is interested because the other link did not work)
It is great! I am taking ideas from it :slight_smile:

Is there any way to pass an SLD as a URL in a WMS request too? Would be great instead of having to pass the XML encoded...
I tried passing the SLD parameter too but it is not taken in consideration...

Javier.

On 18/05/2006, at 1:53, Miles Jordan wrote:

Hi,

I believe the easiest way to test an SLD you are developing is to do a GetLegendGraphic request, using the path to the SLD inline.

For example:

http://your-host/geoserver/wms/GetLegendGraphic?VERSION=1.0.0&FORMAT=image/png&WIDTH=50&HEIGHT=50&LAYER=any-existing-layer&SLD=http://path-to-your-sld-file

If you change the host name above, change 'any-existing-layer' above to any layer you have, like 'states_shapefile:states', and change the path to your SLD you should get something like this:

http://aadc-maps.aad.gov.au/geoserver/wms/GetLegendGraphic?VERSION=1.0.0&FORMAT=image/png&WIDTH=50&HEIGHT=50&LAYER=shapefile:continent&SLD=http://aadc-maps.aad.gov.au/temp/symbology/SLD/tmp_86276989_1.sld

(The link above will only work for 2 hours more until the program that generated it expires the SLD - it's created automatically, but you can view our existing symbol library at http://aadc-maps.aad.gov.au/symbology/. Currently, the public can only view existing SLDs - only we have access to the tool that creates them.)

Hope this helps,

Miles Jordan
Applications Developer
The Australian Antarctic Data Centre

-----Original Message-----
From: geoserver-users-admin@lists.sourceforge.net
[mailto:geoserver-users-admin@lists.sourceforge.net] On
Behalf Of Chris Holmes
Sent: Thursday, 18 May 2006 12:48 AM
To: Alexander Petkov
Cc: Javier de la Torre; geoserver-users@lists.sourceforge.net
Subject: Re: [Geoserver-users] Editing SLD

Alexander Petkov wrote:

Hello Javier:

On 5/17/06, Javier de la Torre <jatorre@anonymised.com> wrote:

Hi all,

I am right now creating and editing SLD files to present

my maps but

I find a little bit annoying the way to develop them. How

do you do

when you want to test changes in the style?

I am directly editing the SLD file that has been uploaded to the /
data/styles and then requesting a map to see the changes... but it
seems that the style is somehow cached in memory and the

changes do

not take effect...

How do you do test the styles? Do I have to restart tomcat

every time

I do a change on the style to see its effect?

You need to reload the catalog. There are some ways to do that in a
way other than the web interface, see the following wiki page for
details:

http://docs.codehaus.org/display/GEOSDOC/Alternative+for+reloading+the

+Geoserver+catalog

Note that this is more for programmatically reloading it. You can
accomplish the same thing by just hitting 'load' in the web
admin tool.
  This forces a reload of the sld stuff in memory, so if
you've changed
things they'll be picked up.

Chris

Alex

PS Except that codehaus seems to be down, as already

mentioned on the list.

 ) N j w v  j+xמv , h nǫ ' ǜ g ۟} 'z rIr +a

נ ^vל z% > f

{*. :ey "z yhi 1g J ^ ) X jب ' M[jǝ p)i ^ ) i

 . 'z zW&vY 'u N ۭ Z ]

덆z  ǫ f ) +- ,z ޮ  b , y + ޶em +- . ǟ  

+- b ا~ z  ǫ

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

___________________________________________________________________________

    Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not the
intended recipient, you are notified that use or dissemination of this communication is
strictly prohibited by Commonwealth law. If you have received this transmission in error,
please notify the sender immediately by e-mail or by telephoning +61 3 6232 3209 and
DELETE the message.
        Visit our web site at http://www.aad.gov.au/
___________________________________________________________________________

JTorre.vcf (278 Bytes)

Is there any way to pass an SLD as a URL in a WMS request too? Would
be great instead of having to pass the XML encoded...
I tried passing the SLD parameter too but it is not taken in
consideration...

Javier.

Yes, there is an getMap example on the "Sample Requests" page, but it
does not look pretty:

http://localhost:8080/geoserver/wms?bbox=-130,24,-66,50&Format=image/png&request=GetMap&width=550&height=250&srs=EPSG:4326&SLD_BODY=<StyledLayerDescriptor%20version%3D"1.0.0"><UserLayer><Name>topp:states</Name><UserStyle><Name>UserSelection</Name><FeatureTypeStyle><Rule><Filter%20xmlns:gml%3D"http://www.opengis.net/gml"><PropertyIsEqualTo><PropertyName>STATE_NAME</PropertyName><Literal>Illinois</Literal></PropertyIsEqualTo></Filter><PolygonSymbolizer><Fill><CssParameter%20name%3D"fill">%23FF0000</CssParameter></Fill></PolygonSymbolizer></Rule><Rule><LineSymbolizer><Stroke/></LineSymbolizer></Rule></FeatureTypeStyle></UserStyle></UserLayer></StyledLayerDescriptor>

Alex

Right this is what I have tried:

This request uses the default SLD for this FeatureType:
http://synthesys.csic.es:8080/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=1000&HEIGHT=570&LAYERS=tdwg:richness_by_c_square_05&FORMAT=image/png&STYLES=&TRANSPARENT=TRUE

Now If to the same one I provide an SLD parameter like this:
http://synthesys.csic.es:8080/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=1000&HEIGHT=570&LAYERS=tdwg:richness_by_c_square_05&FORMAT=image/png&STYLES=&TRANSPARENT=TRUE&SLD=http://synthesys.csic.es/SLD/richness_by_c_square.sld

I get the same result... and for you to check that the style provided
in the second example is different here is the GetLegend request, you
will see it has different colours:

http://synthesys.csic.es:8080/geoserver/wms/GetLegendGraphic?VERSION=1.0.0&WIDTH=50&HEIGHT=50&LAYER=tdwg:richness_by_c_square_05&FORMAT=image/png&SLD=http://synthesys.csic.es/SLD/richness_by_c_square.sld

Could it be that the default style has prevalence over the provided one?

Thanks.

Javier.

On 5/18/06, Javier de la Torre <jatorre@anonymised.com> wrote:

Uhmmm... then it didn't work for me...

i will try again... and let you know in a moment..

On 5/18/06, Alexander Petkov <greenkov@anonymised.com> wrote:
> On 5/18/06, Javier de la Torre <jatorre@anonymised.com> wrote:
> > No, I meant passing an SLD parameter that is a URL poiting to the SLD
> > document, not passing the SLD itself url encoded...
> >
> Yes, see this page for details:
> http://docs.codehaus.org/display/GEOSDOC/WMS
>
> Alex
>