relate

fun relate(geometry1: Geometry, geometry2: Geometry, relation: String): Boolean

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.

Return

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

Since

200.1.0

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.

Throws

Indicates that geometry1 and geometry2 do not have equivalent spatial references.