[Geoserver-users] opacity of point symbolisers with a well-known name

hello there,

i'm trying to display a translucent circle around a point using the following
PointSymbolizer, but the rendered graphic is opaque:

  <sld:PointSymbolizer>
    <sld:Graphic>
      <sld:Mark>
        <sld:WellKnownName>circle</sld:WellKnownName>
        <sld:Fill>
          <sld:CssParameter name="fill">
            <ogc:Literal>#FF0000</ogc:Literal>
          </sld:CssParameter>
          <sld:CssParameter name="fill-opacity">
            <ogc:Literal>0.75</ogc:Literal>
          </sld:CssParameter>
        </sld:Fill>
        <sld:Stroke>
          <sld:CssParameter name="stroke">
            <ogc:Literal>#000000</ogc:Literal>
          </sld:CssParameter>
          <sld:CssParameter name="stroke-linecap">
            <ogc:Literal>butt</ogc:Literal>
          </sld:CssParameter>
          <sld:CssParameter name="stroke-linejoin">
            <ogc:Literal>miter</ogc:Literal>
          </sld:CssParameter>
          <sld:CssParameter name="stroke-opacity">
            <ogc:Literal>1.0</ogc:Literal>
          </sld:CssParameter>
          <sld:CssParameter name="stroke-width">
            <ogc:Literal>0.0</ogc:Literal>
          </sld:CssParameter>
          <sld:CssParameter name="stroke-dashoffset">
            <ogc:Literal>0.0</ogc:Literal>
          </sld:CssParameter>
        </sld:Stroke>
      </sld:Mark>
      <sld:Opacity>
        <ogc:Literal>0.75</ogc:Literal>
      </sld:Opacity>
      <sld:Size>
        <ogc:Literal>187.38503757005859</ogc:Literal>
      </sld:Size>
      <sld:Rotation>
        <ogc:Literal>0.0</ogc:Literal>
      </sld:Rotation>
    </sld:Graphic>
  </sld:PointSymbolizer>

GeoServer is 1.5.x (052307); java is JDK 6.

am i missing something obvious, or should i enter this as a bug?

TIA + cheers;
rsn

Raif S. Naffah ha scritto:

hello there,

i'm trying to display a translucent circle around a point using the following PointSymbolizer, but the rendered graphic is opaque:

...

GeoServer is 1.5.x (052307); java is JDK 6.

Funny, I just tried out your style, expanded in the following full sld document:

<?xml version="1.0" encoding="UTF-8"?>
<sld:StyledLayerDescriptor version="1.0.0"
   xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
   xmlns:sld="http://www.opengis.net/sld&quot;
   xmlns:ogc="http://www.opengis.net/ogc&quot;
   xmlns:xlink="http://www.w3.org/1999/xlink&quot;
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   <sld:NamedLayer>
     <sld:Name>Default Styler</sld:Name>
     <sld:UserStyle>
     <sld:FeatureTypeStyle>
       <sld:FeatureTypeName>Feature</sld:FeatureTypeName>
       <sld:Rule>
         <sld:Name>name</sld:Name>
         <sld:Title>title</sld:Title>
         <sld:Abstract>Abstract</sld:Abstract>

         <sld:PointSymbolizer>
     <sld:Graphic>
       <sld:Mark>
         <sld:WellKnownName>circle</sld:WellKnownName>
         <sld:Fill>
           <sld:CssParameter name="fill">
             <ogc:Literal>#FF0000</ogc:Literal>
           </sld:CssParameter>
           <sld:CssParameter name="fill-opacity">
             <ogc:Literal>0.75</ogc:Literal>
           </sld:CssParameter>
         </sld:Fill>
         <sld:Stroke>
           <sld:CssParameter name="stroke">
             <ogc:Literal>#000000</ogc:Literal>
           </sld:CssParameter>
           <sld:CssParameter name="stroke-linecap">
             <ogc:Literal>butt</ogc:Literal>
           </sld:CssParameter>
           <sld:CssParameter name="stroke-linejoin">
             <ogc:Literal>miter</ogc:Literal>
           </sld:CssParameter>
           <sld:CssParameter name="stroke-opacity">
             <ogc:Literal>1.0</ogc:Literal>
           </sld:CssParameter>
           <sld:CssParameter name="stroke-width">
             <ogc:Literal>0.0</ogc:Literal>
           </sld:CssParameter>
           <sld:CssParameter name="stroke-dashoffset">
             <ogc:Literal>0.0</ogc:Literal>
           </sld:CssParameter>
         </sld:Stroke>
       </sld:Mark>
       <sld:Opacity>
         <ogc:Literal>0.75</ogc:Literal>
       </sld:Opacity>
       <sld:Size>
         <ogc:Literal>187.38503757005859</ogc:Literal>
       </sld:Size>
       <sld:Rotation>
         <ogc:Literal>0.0</ogc:Literal>
       </sld:Rotation>
     </sld:Graphic>
   </sld:PointSymbolizer>
       </sld:Rule>
     </sld:FeatureTypeStyle>
     </sld:UserStyle>
   </sld:NamedLayer>
</sld:StyledLayerDescriptor>

And with the following request:
http://localhost:8080/geoserver/wms?bbox=143.60260815000004,-43.851764249999995,148.71135685000002,-39.370182750000005&styles=,reddots2&Format=application/openlayers&request=GetMap&layers=topp:tasmania_state_boundaries,topp:tasmania_cities&width=800&height=658&srs=EPSG:4326
(which should work on your 1.5.x, I think the openlayers preview was already integrated) I see the red dot as translucent.

Yet, you may be experiencing another problem. At the moment for the openlayers previews we're doing on the fly meta tiling, and then
caching in memory the generated tiles in a supposedly short lived
memory cache, in order to satisfy other requests quickly.
It turns out that the cache may well be long lived if the server
is not under pressure, so I'll have to fix this somehow. In that
situation, you may get back images that are generated with
an old solid style, if you had one.

To make sure, just restart Geoserver, and see if the issue disappears.
I'm fixing the cache today, so that tiles won't last inside of it
more than a few seconds.

Cheers
Andrea

hello Andrea,

On Thursday 31 May 2007 18:21:18 Andrea Aime wrote:

Raif S. Naffah ha scritto:
> i'm trying to display a translucent circle around a point using the
> following PointSymbolizer, but the rendered graphic is opaque:
...
> GeoServer is 1.5.x (052307); java is JDK 6.

Funny, I just tried out your style, expanded in the following full sld
document:
...

And ... I see the red
dot as translucent.

you are, of course, right! when i tried it again this morning with different
colours and a 50% opacity it was clear that it was doing the right thing.
apologies for making you waste your time on a non-issue.

Yet, you may be experiencing another problem. At the moment for the
openlayers previews we're doing on the fly meta tiling, and then
caching in memory the generated tiles in a supposedly short lived
memory cache, in order to satisfy other requests quickly.
It turns out that the cache may well be long lived if the server
is not under pressure, so I'll have to fix this somehow. In that
situation, you may get back images that are generated with
an old solid style, if you had one.

i think that the caching may have contributed to my false impression: when i
tried editing the SLD by hand and re-issuing the same request (copy+paste in
a web browser) i was not seeing any change in the opacity of the circles.
most likely, but i'm not sure, the server could have been serving the
previously rendered image and not parsing/processing the new content of the
same SLD document.

To make sure, just restart Geoserver, and see if the issue disappears.

it surely did disappear.

I'm fixing the cache today, so that tiles won't last inside of it
more than a few seconds.

thanks for quickly looking into this and again sorry for the bum-steer.

cheers;
rsn

Raif S. Naffah ha scritto:

hello Andrea,

I'm fixing the cache today, so that tiles won't last inside of it
more than a few seconds.

thanks for quickly looking into this and again sorry for the bum-steer.

No problem. If you are willing do double check this, wait for the 050107 build (http://geo.openplans.org/nightly/1.5.x/) and give it a shot.
I made it so that tiles are kept around no more than 5 seconds, enough
for the browser to pick them up, usually, but definitely too short
for you to edit the style and ask the tiles again.

Oh, remember refresh the page with openlayers, otherwise the browser
will keep showing you the old tiles anyways (browser side cache, which
I cannot control at the moment).

Cheers
Andrea

hello Andrea,

On Friday 01 June 2007 17:15:26 Andrea Aime wrote:

Raif S. Naffah ha scritto:
>> I'm fixing the cache today, so that tiles won't last inside of it
>> more than a few seconds.
>
> thanks for quickly looking into this and again sorry for the bum-steer.

No problem. If you are willing do double check this, wait for the 050107
build (http://geo.openplans.org/nightly/1.5.x/) and give it a shot.
I made it so that tiles are kept around no more than 5 seconds, enough
for the browser to pick them up, usually, but definitely too short
for you to edit the style and ask the tiles again.

no problems; i'll do that and report back if i find any problem --btw. you
probably meant 060107.

Oh, remember refresh the page with openlayers, otherwise the browser
will keep showing you the old tiles anyways (browser side cache, which
I cannot control at the moment).

cheers;
rsn