Geospatial operators
You can write rules to reason over geographic locations.
The following table lists geospatial operators. <a geometry> refers
to any type of geometry that is defined in the business model, such
as a point, a polygon, or a line string. For example, the position of a flight is a
geometry, where the position is
an attribute of type point that belongs to a flight entity.
For more information about geospatial concepts, see Geographic location and data.
| Construct | Definition | Example |
|---|---|---|
|
Checks whether a geometry contains another geometry. Returns a boolean. |
|
|
Returns the geometries that are contained in a geometry. |
|
|
Returns the geometries that contain a geometry. |
|
|
Calculates the distance between two geometries in the specified unit of length. |
|
|
Returns all the geometries that are at the specified distance or closer to the specified geometry. |
|
|
Checks whether a geometry crosses another geometry. |
|
|
Returns the geometry in a collection of geometries that is closest to another geometry. Important: This operator returns a geometry of type
geometry.
If you need more specific return types such as point, polygon, and
line string, use the operators specific to these types. |
|
|
Returns the point in a collection of points that is closest to a geometry. |
|
|
Returns the polygon in a collection of polygons that is closest to a geometry. |
|
|
Returns the line string in a collection of line strings that is closest to a geometry. |
|
|
Returns a maximum number of |
|
|
Returns a maximum number of |
|
|
Returns a maximum number of |
|
|
Returns a maximum number of |
|
| Construct | Description | Example |
|---|---|---|
|
Initializes a moving geometry attribute.
The optional |
|
|
Updates the location of a moving geometry
to its current location, which corresponds to the value of |
|
|
Updates the location of a moving entity to its new location at a specific time. |
|
|
Returns the geometry value that represents
the location of the entity at a given timestamp. If no specific value
is reported at that timestamp with the |
|
|
Calculates the maximal, minimal, or average speed of a moving geometry over a time period. |
|
|
Checks that the distance between the two geometries is increasing with time, based on the recent history. If the history has less than 2 available timestamps, the operator returns false. |
|
|
Checks that the distance between the two geometries is decreasing with time, based on the recent history. If the history has less than 2 available timestamps, the operator returns false. |
|
|
Calculates the acceleration rate of a moving geometry, based on the recent history. If the history has less than 3 available timestamps, the operator returns 0. |
|
|
Checks that a moving geometry is accelerating, based on the recent history. If the history has less than 3 available timestamps, the operator returns 0. |
|
|
Checks that a moving geometry is decelerating, based on the recent history. If the history has less than 3 available timestamps, the construct returns 0. |
|
|
Checks that a moving geometry was located inside a polygon during the specified time period, based on the recent history. The construct returns true if the geometry is in the polygon at some of its timestamps, namely all those timestamps that are included in the time period as well as the latest timestamp before or at the start of the time period. If the earliest timestamp is after the start of the required time period, the construct returns false. |
|
|
Checks that a moving geometry was located inside a polygon since the specified time point, based on the recent history. |
|
|
Checks that a moving geometry was located within a specific distance of a geometry during the specified time period, based on the recent history. If the earliest timestamp is after the start of the required time period, the construct returns false. |
|
|
Checks that a moving geometry was located within a specific distance of a geometry since the specified time point, based on the recent history. |
|
|
Returns a list of time intervals for all encounters between the two geometries. |
|
|
Returns the time of the latest encounter between the two geometries. |
|
|
Returns the time of the earliest encounter within the specified range between the two geometries. |
|
|
Checks whether the moving geometry entered
a polygon. If no |
|
|
Checks whether the moving geometry exited
a polygon. If no |
|
| Construct | Description | Example |
|---|---|---|
|
Checks whether the line string crosses itself. Returns a boolean. |
|
|
Returns a collection of points. |
|
|
Returns the number of vertices of a line string. |
|
| Construct | Description | Example |
|---|---|---|
|
Returns an array of doubles. |
|
|
Returns a point. |
|
|
Adds a point to a line string. |
|
| Construct | Description | Example |
|---|---|---|
|
Returns a linear ring. |
|
|
Returns a collection of linear rings. |
|