Hi all,
I'm writing to build some consensus on how to handle a
compatibility breaking change.
Years ago, way before my involvement in GeoServer, I
introduced a rendering optimization for lines. The
observation was that if the line width was less than
1.5 pixels, setting it to 0 flat would make the rendering
quite a bit faster (30%+ if my memory serves me right)
and the visual result would have been the same.
Now, at the time I was not using antialiasing, as it
made rendering times untolerable on my Athlon 700Mhz,
and I did not notice how that optimization affected
antialiased rendering.
These days more than one people complains that they
cannot control the thickness of thin lines. No wonder,
it's the above optimization kicking in.
And with antialiasing rendering on, well, you can
tell a difference between line withs of 0.5, 1,
and 1.5 pixels (just to make an example).
So, what can we do? Kicking off the optimization
the hard way does not seem like a good option to me.
People have been creating styles based on the current
behaviour, changing it would change the way maps
are rendered.
To give you some examples, here are maps that
have been rendered with the optimization on (the
current behaviour) and off (the proposed change).
USA population:
default: http://www.flickr.com/photos/29313339@anonymised.com/3217765574/sizes/o/
opt off: http://www.flickr.com/photos/29313339@anonymised.com/3217765474/sizes/o/
USA population, with hatch fills:
default: http://www.flickr.com/photos/29313339@anonymised.com/3216912511/sizes/o/
opt off: http://www.flickr.com/photos/29313339@anonymised.com/3216912387/sizes/o/
Tasmania:
default: http://www.flickr.com/photos/29313339@anonymised.com/3217765504/sizes/o/
opt off: http://www.flickr.com/photos/29313339@anonymised.com/3216912443/sizes/o/
As you can see the rendering changes, in some cases, significantly.
It's still possible to get back the old "thin line" rendering, you
just have to go and specify a thinner line with, such as 0.5, in the
SLD.
What I'm proposing is to create an option that allows to toggle
the optimization on and off at the renderer level, and at the
SLDStyleFactory level (since this is where the optimization
really kicks in). For the 2.5.x series, we leave
the option on by default, so no change in rendering occurs
unless you tell the code otherwise.
For the trunk series, I'd say that we should turn the
optimization off by default, but leave the toggle around for
one more release cycle, after which, we remove it completely.
How does this sound?
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.