relatePattern
Returns true if the spatial relationship between geometries a and b
matches the specified DE-9IM
pattern.
DE-9IM pattern is a 9-character string described by the regular expression
/^[F012T*]{9}$/.
Each character represents a dimension of intersection:
F- no intersection (-1 dimension)0- point1- line2- areaT- any intersection (0,1or2)*- wildcard (F,0,1or2)
If possible it is better to use a named relationship functions like
overlaps or covers.
warning
Do not use this function with invalid geometries. You will get unexpected results.
Parameters
| Name | Type | Description |
|---|---|---|
a | Geometry | Prepared<Geometry> | First geometry |
b | Geometry | Second geometry |
pattern | string | DE-9IM pattern, 9-character string where each character is one of F,0,1,2,T,* |
Returns
boolean
true if the specified pattern matches the spatial relationship
between geometries a and b
Throws
GEOSErroron unsupported geometry types (curved)
See also
relatereturns the exact DE-9IM matrix string for two geometriesprepareimproves performance of repeated calls against a single geometry