pyinterp.geometry.geographic.algorithms.relation#
- pyinterp.geometry.geographic.algorithms.relation(geometry1: pyinterp.core.geometry.geographic.Point, geometry2: pyinterp.core.geometry.geographic.Point) str#
- pyinterp.geometry.geographic.algorithms.relation(geometry1: pyinterp.core.geometry.geographic.LineString, geometry2: pyinterp.core.geometry.geographic.LineString) str
- pyinterp.geometry.geographic.algorithms.relation(geometry1: pyinterp.core.geometry.geographic.Ring, geometry2: pyinterp.core.geometry.geographic.Ring) str
- pyinterp.geometry.geographic.algorithms.relation(geometry1: pyinterp.core.geometry.geographic.Ring, geometry2: pyinterp.core.geometry.geographic.Polygon) str
- pyinterp.geometry.geographic.algorithms.relation(geometry1: pyinterp.core.geometry.geographic.Polygon, geometry2: pyinterp.core.geometry.geographic.Ring) str
- pyinterp.geometry.geographic.algorithms.relation(geometry1: pyinterp.core.geometry.geographic.Polygon, geometry2: pyinterp.core.geometry.geographic.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