Developer’s Corner: Releasing Postgis Curves Support in GeoServer

GeoServer

Dear Reader,

in this post we’d like to talk about one of our last improvements to GeoServer, that is, the ability to deal with PostGIS curves with both reading and writing support.

Starting from the most interesting bit, the work has been already pushed on GeoServer master (next to be 2.8) which you can download at the links below, either in bin or war format:

Although for the time being the new functionality it’s only available on the 2.8.x series, and we hope to backport all the changes to the 2.7.x  series later, hence some early feedback would be much appreciated.

Let’s look at an example. Here is a screenshot of our sample data set which can be download from here:

Sample curve data for PostGIS

Sample curve data for PostGIS

 

 

 

 

 

 

 

 

 

 

 

And a closer view on some data with arcs of circle:

Sample curve data for PostGIS - Details

Sample curve data for PostGIS – Details

 

 

 

 

 

 

 

 

An observation that might help you save some time, in case you wanted to try with your own dataset and you were experiencing issues you might want to disable the postgis geometry simplification before publishing it, you have to un-check the “Support on the fly geometry simplification”: ​This is required because the ST_Simplify function used to perform the geometry simplification postgis side (during wms requests) does not support curves yet.

We added a check in the queries not to use ST_Simplify when a geometry has curves, using ST_HasArc, but your dataset uses curved primitives, such as CurvePolygon, without actually having any curve inside, only straight segments, ST_HasArc will return false, but then ST_Simplify will fail because it claims not to know what to do with a CurvePolygon (it does not check that inside there is actually no curve).

We’ve informed the PostGIS developer of this, and opened tickets, but we don’t expect them to get fixed shortly, so for the time being, just uncheck the on the fly geometry simplification

Well, let us know how PostGIS curves support works for you. In case you find issues, please send us a sample of the data that’s causing the issue to show up.  So stay tuned and get in touch if you’d like to contribute to this effort. As usual, whatever we’ll produce is released as Open Source.

Last but not least we would like to thanks the City of Helsinki for funding this work under a GeoSolutions Enterprise Services support contract.

The GeoSolutions team,

https://www.geosolutionsgroup.com