Hi,
finally made it to make a patch for proper arc support in GeoServer:
https://github.com/aaime/geoserver
The user visible changes are that you get two new elements in the GUI to configure the curves:
-
a flag that the admin will use to indicate wether the linework can contain also circular arcs
-
a linearization tolerance, as a measure (e.g., you can specifiy 2m or 3ft)
-
is kind of obvious, 1) is the byproduct of GeoServer using GML3 deprecated types for single
and multiple lines, LineStringType and MultiLineStringType, which cannot contain curves.
The issue happens in the FeatureTypeSchemaBuilder, where we basically force the properties
to be LineString or MultiLineString without knowing if they will contain curves, or not.
The issue is, from the software we cannot know if there will be curves, we’d have to make a full scan of all the data
every time we build those schemas, as lines are just lines, the fact that they might contain circular
segments is a detail that the data source will not give you, because there is not line layer
that is made purely of curves, they are always mixed with straight ones.
So… in order to maintain backwards compatibility in WFS 1.1 output, I had to ask the admin to tell
me whether there will be curves, and in that case, we switch from LineString to Curve, from
MultiLineString to MultiCurve, without affecting the current 99% case, where curves are not present.
GML 3.2 output is instead unaffected, because it uses Curve and MultiCurve for everything already.
The way the switch is done is a bit hacky, basically the feature type is transformed, for the sole
sake of computing the GML schema, so that it uses CurveGeometry as the binding for the
data (as said, it does not make sense to do that in general, as we can also get LineString
in the data mix, plus, CurveGeometry is an interface, thus it cannot be a Geometry, which
is instead a class).
Basically, I’ve tried to keep this new curve support as much out of the way as possible from
the normal usage, while still making it possible to support curves for those that have them.
Feedback welcomed
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