I need to visualize PostGIS' polygons as GeoServer WMS with specific style such that the polygons' stroke have different color between inner and outerside of the polygon. According to this reference, a <PerpendicularOffset> tag can be used. Below is the illustration from the reference.

enter image description here

I tried to add that tag in my GeoServer 2.7.0 but does not work. The stroke was rendered with usual symmetric stroke, (inner and outer polygon with similar color and width). Below is the result (i am expecting the gray stroke in only inner side) but fails: enter image description here

The reference apparently is for "2.9.x", and when I check the same reference spot (LineSymbolizer) of lower version (2.8.x and 2.7.2), the explanation of <PerpendicularOffset> tag in LineSymbolizer does not exist.

  1. Is <PerpendicularOffset> only available in GeoServer from version 2.9 ?
  2. If <PerpendicularOffset> is only available in GeoServer from version 2.9, then what are the possible options for me using GeoServer 2.7.x ?
  3. What's the difference between using <PerpendicularOffset> tag in GeoServer 2.9.0 and using Fluxomajic ? (Fluxomajic was also discussed here).

I'm using:

  • GeoServer 2.7.0 on Apache Tomcat 7.0.61 on Windows Server 2008 R2 Datacenter 64-bit on VMWare
  • JVM: Oracle Corporation: 1.7.0_80 (Java HotSpot(TM) 64-Bit Server VM)
  • PostGIS - PostgreSQL 9.4.1 (on Windows Server 2008 R2 Datacenter 64-bit on VMWare)

I tried the blending modes, with the following success result: enter image description here

The above uses 4 FeatureTypeStyle, more or less based on the example you refer in the answer by @AndreAime.

I also tried the Fluxomajic but blending modes are far better.

  • 2
    As per osgeo-org.atlassian.net/browse/GEOT-5243 this has landed on 2.9 only for GeoServer as its a new feature. You might want to ask on the ML if a backport is planned (I don't think so) or propose a bit of funding for it. – simogeo Nov 16 '15 at 8:12
  1. Yes, only available in 2.9, there might be a backport to 2.8 (unsure)
  2. You can try composite and blending modes to achieve a similar effect: http://docs.geoserver.org/2.7.0/user/styling/sld-extensions/composite-blend/example.html
  3. The Fluxomajic plugin is not maintained by GeoServer the core developers and while compatible with GeoServer, it's not licence compatible with GeoTools (the official offset line code lives down in GeoTools instead, for the benefit of all GeoTools based applications). As far as I can tell that code won't generate correct offset lines for a few case as it actually uses a single side buffer function which, as confirmed by Martin Davis (the JTS author) is not the same thing as an offset line: http://lin-ear-th-inking.blogspot.it/2010/11/single-sided-buffers-in-jts.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.