pyinterp.geometry.cartesian.algorithms.relation#
- pyinterp.geometry.cartesian.algorithms.relation(geometry1: pyinterp.core.geometry.cartesian.Point, geometry2: pyinterp.core.geometry.cartesian.Point) str#
- pyinterp.geometry.cartesian.algorithms.relation(geometry1: pyinterp.core.geometry.cartesian.LineString, geometry2: pyinterp.core.geometry.cartesian.LineString) str
- pyinterp.geometry.cartesian.algorithms.relation(geometry1: pyinterp.core.geometry.cartesian.Ring, geometry2: pyinterp.core.geometry.cartesian.Ring) str
- pyinterp.geometry.cartesian.algorithms.relation(geometry1: pyinterp.core.geometry.cartesian.Ring, geometry2: pyinterp.core.geometry.cartesian.Polygon) str
- pyinterp.geometry.cartesian.algorithms.relation(geometry1: pyinterp.core.geometry.cartesian.Polygon, geometry2: pyinterp.core.geometry.cartesian.Ring) str
- pyinterp.geometry.cartesian.algorithms.relation(geometry1: pyinterp.core.geometry.cartesian.Polygon, geometry2: pyinterp.core.geometry.cartesian.Polygon) str
Computes the DE-9IM (Dimensionally Extended nine-Intersection Model) matrix for two geometries.
The DE-9IM is a topological model that describes the spatial relationship between two geometries using a 3x3 matrix. Each cell in the matrix describes the dimension of the intersection between interior/boundary/exterior of the two geometries.
- Parameters:
geometry1 – First geometry.
geometry2 – Second geometry.
- Returns:
A string representing the 9-character DE-9IM matrix pattern (e.g., “FF2F11212”). Each character can be: - ‘F’ (false): empty set (no intersection) - ‘0’: point (0-dimensional) intersection - ‘1’: line (1-dimensional) intersection - ‘2’: area (2-dimensional) intersection
Examples
>>> point = Point(4.0, 1.0) >>> polygon = Polygon(...) >>> matrix = relation(point, polygon) >>> # Returns string like "0FFFFF212" indicating the topological >>> # relationship