relate static method

bool relate(
  1. {required Geometry geometry1,
  2. required Geometry geometry2,
  3. required String relation}
)

Test if the two geometries are related using a custom relation.

You can test for a custom spatial relationship by defining your own relation. For example, you can create a relation that tests if two geometries intersect and touch.

The Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) is a custom spatial relationship type used to test the relationship of two geometries. See Custom spatial relationships for more information about the DE-9IM model and how the relationship string patterns are constructed.

For example, each of the following DE-9IM string codes are valid for testing whether a polygon geometry completely contains a line geometry: "TTTFFTFFT" (Boolean), "T*****FF*" (ignore irrelevant intersections), or "102FFFF" (dimension form). Each returns the same result.

Supports true curves.

Parameters:

  • geometry1 — A geometry object.
  • geometry2 — Another geometry object.
  • relation — The DE-9IM string to be evaluated. This must be nine characters long and only contain the characters TF*012.

Return Value: True if the two geometries have the given relationship, false otherwise.

Implementation

static bool relate(
    {required Geometry geometry1,
    required Geometry geometry2,
    required String relation}) {
  _initializeArcGISEnvironmentIfNeeded();
  final coreRelation = _CString(relation);
  return _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEngine_relate(geometry1._handle,
        geometry2._handle, coreRelation.bytes, errorHandler);
  });
}