[geos-devel] Problem with convex hull generating bad polygons (I think)

Richard Frith-Macdonald richard at tiptree.demon.co.uk
Tue Apr 16 23:23:41 PDT 2013

On 17 Apr 2013, at 06:45, Martin Davis wrote:

> ConvexHull does not require validity of the input - it only operates on the raw vertices of the input.  And it should always produce a valid output (which will be a polygon in the case of three or more non-collinear points).
> Could the TopologyException come from the Union operation, not the ConvexHull?  Union definitely *does* require valid inputs, and if the inputs are not valid it almost always throws a TopologyException.

Thanks ... that confirms my suspicion that I must somehow be getting bad inputs ... I'm now doing the tedious work of adding calls to GEOSisValid() for all input sources and before/after various operatiosn in my code, to track down were the invalid geometry is coming from.   Almost all input in my code comes is handled via the WKT reader, and I had assumed that this would produce a nul geometry if the input text didn't contain a valid geometry, but it seems this may not be the case, and I need to check validity of the geometry explicitly after parsing the WKT.

More information about the geos-devel mailing list