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

Mika Heiskanen mika.heiskanen at fmi.fi
Tue Sep 9 08:44:49 PDT 2014


On 09/09/2014 06:27 PM, Sandro Santilli wrote:
>> I'd like to see a reference where all such special cases
>> are defined explicitly. (No, I never looked for one, as explained
>> before.) In your previous example a linestring was split in half
>> because a vertex is on the rectangle edge. This is kind of consistent
>> with the interpretation that the vertex is considered to be out.
>> However, the example presented here is consistent with the
>> interpretation that the vertex should be considered to be in.
>
> Indeed the results are formally confusing.
> I hope Martin Davis can chime in, being the author of the currently
> used algorithm.

Our algorithm discards all points on the rectangle edges unless they
are required to represent the resulting geometry. This means
intermediate vertices might be skipped when the edges are travelling
along the rectangle edge.

I do see however that someone might wish original vertices on the edges
to be preserved during polygon clipping, for example if the geometry is
to be projected afterwards.

Regards,

Mika Heiskanen / FMI






More information about the geos-devel mailing list