[geos-devel] OverlayNG for Testing
Martin Davis
mtnclimb at gmail.com
Thu Jul 30 10:02:03 PDT 2020
A clarification on the semantics of output from OverlayNG. Some operations
CAN return heterogeneous (mixed-dimension) outputs in some situations.
The exact semantics are:
- Results are always valid geometries. In particular, result MultiPolygons
are valid.
- Repeated vertices are removed.
- Linear results are merged node-to-node (e.g. are of maximal length).
- Polygon edges which collapse completely due to rounding are not output.
- The intersection operation produces a homogeneous result. The result
contains the components of highest dimension in the intersection. (For
instance, the intersection of a Polygon and a LineStringmight produce a
Point result.)
- The difference operation produces a homogeneous result. The result
dimension is that of the left-hand operand.
- The union and symmetric difference operations may produce a
heterogeneous result if the inputs are of mixed dimension
- Homogeneous results are output as Multi geometries.
- Heterogeneous results are in the form of a GeometryCollection containing
a set of atomic geometries. This provides backwards compatibility with the
original JTS overlay implementation. (However, this loses the information
that the polygonal results have valid MultiPolygon topology.)
- Empty results are atomic EMPTY geometries of dimension appropriate to
the operation.
On Wed, Jul 29, 2020 at 2:08 PM Martin Davis <mtnclimb at gmail.com> wrote:
> On Wed, Jul 29, 2020 at 12:53 PM Paul Ramsey <pramsey at cleverelephant.ca>
> wrote:
>
>>
>> - 3D! GEOS uniquely has supported adding in Z coordinates to introduced
>> coordinates, and that code hasn't been added to JTS (and thus overlayng).
>> How this will affect existing expectations for 3D output is unknown, but
>> it's sure to be broken in some way.
>> - Union on linestrings! OverlayNG extracts maximal length linestrings
>> from the unioned graph. Old overlay extracted minimal length linestrings.
>> This change is probably "for the best" but it's a change which might impact
>> existing logic.
>>
>
> Another behavioural change is that now overlay operations do not return
> mixed-dimension results. Instead, a homogeneous geometry containing only
> the highest dimension resultants is returned.
>
> So for example, if two polygons intersect in an area and along an edge,
> the new overlay will only return the area resultant. The old overlay
> returned a GEOMETRYCOLLECTION containing both a polygon and a line.
>
> Or, if two polygons intersect along an edge and at a point, the new result
> is a LineString for the shared edge. The old overlay returns a GC
> ccntaining a line and a point.
>
> The old behaviour seemed like a pain, since most (all?) uses were only
> interested in the highest dimension resultants. And since
> GeometryCollections cannot be processed by overlay ops or spatial
> predicates, it made chaining together operations painful.
>
> What are people's thoughts on this? It is probably possible to build in
> the old behaviour (with a bit of coding effort), and make it the default
> path. But I think the new behaviour is preferable and more sensible.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20200730/8ba9b407/attachment-0001.html>
More information about the geos-devel
mailing list