[Geoserver-users] Maximum number of decimals in WFS

Andrea Aime wrote:

On Wed, May 15, 2013 at 11:04 AM, Rahkonen Jukka <jukka.rahkonen@anonymised.com.> wrote:

Hi,

There is a configuration item "Maximum number of decimals" in the Publishing tab for the layer settings. I had a try with Geoserver 2.3.1 on Windows and with the topp:states layer and it appeared that this setting has an effect only on the GML2 outputformat which is the default for WFS 1.0.0 and selectable also for WFS 1.1.0. With all other output formats (GML3, CSV, json) I get always all the decimals. It would be nice to get the decimal cutter to work for all output formats, next best to mention in the documentation and user interface that only GML2 is affected.

I believe this was discussed at some point on the mailing lists already, have you checked the archives?
By the way, now that I think about it, decimal cutting is dangerous business, as you might start with a topologically valid geometry and end up with one that is not.

I see that there is an open issue http://jira.codehaus.org/browse/GEOS-2613
I see also that the configuration utility has this setting in two places, in a very visible place in global settings http://docs.geoserver.org/stable/en/user/webadmin/server/globalsettings.html and in Layer-Publishing tab which is perhaps undocumented in user docs. The latter seems to override the global setting which is good. The global setting really seems to be global for WFS 1.0. You say decimal cutting is dangerous business but I feel that Geoserver is doing it by default for all WFS 1.0.0 layers and only 8 decimal places are used.

Would it be better to remove this setting from the global settings because it may be dangerous, even nobody has complaint about it, and it is not as global as users would believe because it affects only GML2 output? The setting could remain in Layer-Publish with a warning telling that it is dangerous or stupid at least with WFS-T and a hint that it is only for GML2. Or perhaps it could be de-activated or removed also from there?

-Jukka Rahkonen-

On Wed, May 15, 2013 at 3:15 PM, Rahkonen Jukka
<jukka.rahkonen@anonymised.com>wrote:

Would it be better to remove this setting from the global settings because
it may be dangerous, even nobody has complaint about it, and it is not as
global as users would believe because it affects only GML2 output? The
setting could remain in Layer-Publish with a warning telling that it is
dangerous or stupid at least with WFS-T and a hint that it is only for
GML2. Or perhaps it could be de-activated or removed also from there?

I think the original reason for that was to reduce the size of the
generated GML... which is
imho not a great reason right now (we have on the fly GZIP compression of
the output).
However, that thing has been there forever, so not sure.

There is also a "right" way to do it, which would be using a topology
preserving simplifier,
however that would slow down requests quite a bit.

It's something that should be discussed on the devel list, I'm afraid I
don't have a good answer.

Cheers
Andrea

--

GeoServer training in Milan, 6th & 7th June 2013! Visit
http://geoserver.geo-solutions.it 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

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