[Geoserver-users] GeoServer and PolygonSymbolizer Stroke-Opacity not working

Hey all,

I have seen a couple posts about this lying around but no solution or whether it’s on the cards to get fixed.

I have a WMS polygon layer with a simple style but the polygon layer has been tiled (ie: cut up into 10x10km squares) - this has improved rendering performance no-end but when I remove the stroke style I get white “gap” lines appearing between the tiles at certain zooms. I applied the same colour and opacity to the stroke component of the PolygonSymbolizer

to remove this affect but the stroke-opacity does not work and all I get are full coloured lines appearing now.

I did find out that it’s got something to do with the gamma translucency setting within Java (that’s all I got) and that it’s not exposed…

I have seen something in MapServer about it being fixed there but it’s not on a Java platform and to be honest I prefer GeoServer (both ease of use and performance are brilliant) and don’t want to have to move across

This is a bit of a problem - has anyone got any info on this? Updates in the works? Workarounds?

Cheers,
Ben

On Tue, Aug 5, 2014 at 11:21 AM, Ben Crane <curtly.boon@anonymised.com> wrote:

Hey all,

I have seen a couple posts about this lying around but no solution or
whether it's on the cards to get fixed.

I have a WMS polygon layer with a simple style but the polygon layer has
been tiled (ie: cut up into 10x10km squares) - this has improved rendering
performance no-end but when I remove the stroke style I get white "gap"
lines appearing between the tiles at certain zooms.

Interesting, which version of GeoServer are you using? We have had specific
performance optimizations for the "render a polygon much larger than
screen" case for a few releases now.

I applied the same colour and opacity to the stroke component of the
PolygonSymbolizer
to remove this affect but the stroke-opacity does not work and all I get
are full coloured lines appearing now.

I did find out that it's got something to do with the gamma translucency
setting within Java (that's all I got) and that it's not exposed...

Yes, the JDK rasterizer does not expose gamma to the programmer, so we
cannot control it.
The workaround you are using is correct, what I think it's happening is
that the opacity is getting
used, but the two lines of adjacent polygons overlap, making the border
darker in the overlap.

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

On Tue, Aug 5, 2014 at 5:35 PM, Ben Crane <curtly.boon@anonymised.com> wrote:

Hi Andre,

Build Information

   - Version2.5.2
   - Git Revision878d05129d090db388d1717ec136010ce104b2e3
   - Build Date22-Jul-2014 09:05
   - GeoTools Version11.2 (rev 59edb005ac690fabd8a0e02b898a82fac1618468)
   - GeoWebCache Version1.5.3 (rev
   1.5.x/a648922b85343e0181131725764da833997ffa9e)

Ah - so I need to find a colour that when overlaps with an opacity setting
matches the polygon opacity colour :slight_smile: that should be fun.

Indeed... maybe try assigning only half of the opacity to the stroke

I'm very keen to hear about the first one - sounds like you have a fix in
place? does this only affect bordering images or is every image expanded
outwards?

Hum no, the fixes for large geoemtries went into 2.2.0, if you already had
performance issues with 2.5.2
and slicing the polygons in squares did help, I don't have anything to add
(without looking in deep
at your use case, that is).

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

Hi Andrea,

Yep, I tried that but it didn’t work so I:

  1. Tried determining a new colour based on original colour + transparency (bit complex so left it for now)

  2. I just got the screen shot colour and added stroke width 1 and that colour-seems to work vaguely well but still overlaps so lines do appear - I think the polygon may need some editing - diagonal lines seem to create the most issues…long winded process but trying to prove the concept

So how big do the polygons have to be for the fix to kick in? I have a lot of control over the geometry data so can customize it to fit the large geom fix?

Cheers,

Ben

···

On Tue, Aug 5, 2014 at 4:40 PM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Tue, Aug 5, 2014 at 5:35 PM, Ben Crane <curtly.boon@anonymised.com4…> wrote:

Hi Andre,

Ah - so I need to find a colour that when overlaps with an opacity setting matches the polygon opacity colour :slight_smile: that should be fun.

Indeed… maybe try assigning only half of the opacity to the stroke

I’m very keen to hear about the first one - sounds like you have a fix in place? does this only affect bordering images or is every image expanded outwards?

Hum no, the fixes for large geoemtries went into 2.2.0, if you already had performance issues with 2.5.2
and slicing the polygons in squares did help, I don’t have anything to add (without looking in deep
at your use case, that is).

Cheers

Andrea

==

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

==

Ing. Andrea Aime

@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it


n Thu, Aug 7, 2014 at 12:03 PM, Ben Crane <curtly.boon@anonymised.com> wrote:

Hi Andrea,

Yep, I tried that but it didn't work so I:

1. Tried determining a new colour based on original colour + transparency
(bit complex so left it for now)
2. I just got the screen shot colour and added stroke width 1 and that
colour-seems to work vaguely well but still overlaps so lines do appear - I
think the polygon may need some editing - diagonal lines seem to create the
most issues...long winded process but trying to prove the concept

So how big do the polygons have to be for the fix to kick in? I have a lot
of control over the geometry data so can customize it to fit the large geom
fix?

As soon as the geometry is bigger than the displayed area, it gets clipped
before being rendered, so not that big.
But of course it still needs to be read fully.

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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

On Thu, Aug 7, 2014 at 12:05 PM, Andrea Aime <andrea.aime@anonymised.com>
wrote:

As soon as the geometry is bigger than the displayed area, it gets clipped
before being rendered, so not that big.
But of course it still needs to be read fully.

By the way, could you share that dataset for local tests?

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

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