[geos-devel] Geometry/Rectangle Intersection: line touching rectangle

Mika Heiskanen mika.heiskanen at fmi.fi
Thu Sep 11 13:07:26 PDT 2014


On 09/11/2014 06:49 PM, Martin Davis wrote:
> Yup, that's correct output for JTS, as per it's spec (not the OGC spec -
> they didn't actually specify any semantics, so I made them up  8^)
>
> The rationale is as before - provide everything back, and it can be
> filtered post-op if required.  That said, JTS really needs an easy way
> to retain just the polygons- or even better retain just the highest
> dimension output geometries.

The rationale for leaving the post processing task to the user
is not solid, since the user may not be aware of what is required
to achieve the desired result. You certainly have not documented
the GEOS/JTS API well enough for casual user to be able to do so.

A case study from personal experience: I implemented a contouring
(isoline and isoband calculation) algorithm which feeds the line
segments to the GEOS Polygonizer class. I then found out that the
polygonizer would build all possible geometries instead of building
just the one that fit the input. In other words, I got polygons with
holes, but also the same holes as separate polygons. I eventually
had to write a separate post processing stage that would remove the
superfluous rings to get a single consistent geometry. An ordinary
user should not be expected to do so, the required code is not
trivial.

Regards,

Mika Heiskanen / FMI




More information about the geos-devel mailing list