Opened 4 years ago

Closed 4 years ago

#9941 closed Feature Requests (fixed)

bg::touches() for box geometries

Reported by: Frank Owned by: Barend Gehrels
Milestone: To Be Determined Component: geometry
Version: Boost 1.55.0 Severity: Not Applicable
Keywords: touches, box Cc: mateusz@…

Description

Hello,

the bg::touches() algorithm is not implemented for box geometries. Corresponding documentation or - better - implementation would be nice!

Discussion can be found under: http://boost-geometry.203548.n3.nabble.com/touches-compile-error-tp4025154.html

Change History (4)

comment:1 Changed 4 years ago by Frank <glinkaf@…>

It is documented - sorry for the confusion!

Note
only implemented for polygon/multi_polygon

comment:2 Changed 4 years ago by Mateusz Loskot

Cc: mateusz@… added

comment:3 Changed 4 years ago by awulkiew

I pushed the implementation to the develop. However there is an edge case when both Boxes are Point-sized, e.g.: box(pt(0 0,0 0), pt(0 0,0 0)).

Spatial relations are well defined, e.g. touches() returns TRUE only if the interiors of both geometries do NOT overlap.

In the case of Polygons we know what to do because according to the OGC the Polygon must have an interior, its area can't be 0. Boxes are different, they're not defined in the OGC standard. Bounding objects in general may have no area/volume since they may be an envelop of a single Point. So we should decide how a Point-sized Box should be treated:

  1. as a Point - no boundary, only the interior which means that touches for equal Point-sized Boxes should return FALSE.
  2. as an Areal geometry without interior, only boundary which means that touches for equal Point-sized Boxes should return TRUE (currently this is implemented).

In general the handling of numerical errors is different for Box/Box? cases, that is, currently in all functions the error is not taken into account. It's because the test should be as simple as possible. However this way the algorithm calculating some spatial relation for Geometries may be not compatible with the algorithm calculating it for bounding Boxes of those Geometries.

Last edited 4 years ago by awulkiew (previous) (diff)

comment:4 Changed 4 years ago by awulkiew

Resolution: fixed
Status: newclosed

Added in 1.56 with the above remarks.

Note: See TracTickets for help on using tickets.