Getting curvey with Oracle Spatial and GeoServer

GeoServer

Dear readers,

in this blog post we are going to introduce you to the new GeoServer curved geometry support that has been developed here at GeoSolutions.

To date GeoServer was limited to handle geometries made of straight segments, but in the last years a number of spatial databases added support for geometries containing arcs of circles as well. GML also recognized the need for this kind of geometries, and has been supporting them (along with other curved geometry types) since GML 3.0.

In GeoServer 2.6 (to be released September 2014) we have implemented support for geometries made of circular arcs, in particular:

  • CircularString and CircularRing, a sequence of circular arcs by 3 points, eventually closed
  • CompundString and CompoundRing, a line made of a mix of straight and circular arcs, eventually closed
  • CurvePolygon, a polygon whose shell or holes contains one or more circular arcs

In particular, we have implemented all the machinery necessary to represent these geometries in memory, to turn them into straight line equivalents with a user provided accuracy, render them with an accuracy related to the current display resolution, and encode them in GML. Data source wise, we added support for reading circular arcs from Oracle.

Let’s have a look at some examples. Here are two sets of curved geometries read from Oracle, a set of test lines, and some real world polygons, and rendered by WMS:

sample            detail3

The geometries can also be retrieved via WFS. If WFS 1.0/GML 2 is chosen, the geometries are going to be linearized on the fly and exposed as flat linestrings:

curves_gml2

 

However, if we switch to a WFS/GML version that is capable of expressing curved geometries, for example WFS 1.1/GML 3 we’ll get instead:

curves_gml3curves_gml3

Circular, and much more compact!

Any other protocol will be able to work off curved geometries as well, and if it’s not aware of circular geometries, the data will linearize itself automatically. For example, if you try to buffer a circular arc via WPS, the geometry will automatically transform into one made of straight segments before being buffered.

We would like to thank the City of Wien for sponsoring this great improvement. If the topic is of interest to you, there is still some work that can be done to improve curved geometries support, for example:

  • Support reading circular arcs from PostGis or SQLServer
  • Writing curved geometries via WFS-T

It’s worth mentioning that this work was performed as part of our GeoSolutions Enterprise Services offer, hence if you want to know more about how we can help your organization reaching its goals, feel free to contact us!

The GeoSolutions team,

https://www.geosolutionsgroup.com