2

I would like to completely disable antialiasing of polygon borders in Geoserver's WMS png output. The reason is because we do downstream colour remapping, and intermediate colours break that.

This is the problem:

enter image description here

I would like that to look sharp and jaggy :)

EDIT

I see from the documentation that there is a "vendor parameter" that should allow this:

&FORMAT_OPTIONS=antialiasing%3Aoff

Alas, it does not work for me. (Geoserver 2.6.4)

EDIT 2:

Here's a live URL you can try (for a while...)

Changing the DPI changes the fidelity of the rendered geometry, but doesn't affect antialiasing.

6
  • I believe you are right. It feels like a bug but post first a question with a test URL http://localhost:8080/geoserver/wms?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&WIDTH=1297&HEIGHT=692&LAYERS=topp%3Astates&TRANSPARENT=TRUE&FORMAT=image%2Fpng&BBOX=-98.576334,34.141929,-98.576330,34.141931&SRS=EPSG:4326&STYLES=&format_options=antialiasing:offto geoserver-users mailing list so it can be verified.
    – user30184
    Commented Nov 16, 2015 at 9:32
  • Ok I added a URL. Hopefully that's enough to see whether it's a bug or not? Commented Nov 16, 2015 at 11:58
  • In my personal opinion, this is not a bug. The bluring pixels can be seen only when you zoom into the image which means stretching the image. If you want to display the image at lower scale you may set a lower bbox while keeping the width, height of the image. If all polygons had horisontal and vertical lines, pixel blurring would not be necessary but as long as polygons have diagonal lines how someone can create an output image without blurring the pixels in these polygon sides? The result would be ugly.
    – pavlos
    Commented Nov 16, 2015 at 13:12
  • Yes, I'm specifically looking for a way to get that "ugly" result. Commented Nov 16, 2015 at 23:25
  • The option you are looking for is "Raster Rendering Options" in the geoserver wms config page -->docs.geoserver.org/stable/en/user/webadmin/services/WMS.html but this is forcing to use one of the three different options. Doesnt give you the option to get rid of it. The reason is because the result would be an ugly image. Unless you dig into geoserver code and disable this option cant see any other way.
    – pavlos
    Commented Nov 17, 2015 at 16:18

1 Answer 1

1

disable the antialising through geoserver wms config page check it here. If not using SVG then pass a parameter to your WMS http request like so:

&format_options=antialiasing:off

I have used this vendor parameter and I have seen it working perfectly with text labels but it should work for your case as well. Try also to play a bit with the dpi option of &format_options. A last thing to take into account is to clear the cache in geoserver and reload it.

2
  • I think that's only for SVG output. Commented Nov 16, 2015 at 9:04
  • thats right. check my answer
    – pavlos
    Commented Nov 16, 2015 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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