Skip to main content

crosses (Stream Processor)

Determines if the specified object or location crosses a geographic location specified by geo.json.geometry.fence.

Syntax

<BOOL> geo:crosses(<STRING> id, <DOUBLE> longitude, <DOUBLE> latitude, <STRING> geo.json.geometry.fence)
<BOOL> geo:crosses(<STRING> id, <STRING> geo.json.geometry, <STRING> geo.json.geometry.fence)

Query Parameters

NameDescriptionPossible Data TypesOptionalDynamic
idLocation ID.STRINGNoNo
longitudeLongitude of the geo location.DOUBLEYesNo
latitudeLatitude of the geo location.DOUBLEYesNo
geo.json.geometryString that contains geometry type and coordinates for a GeoJSON geometry.STRINGYesNo
geo.json.geometry.fenceString that contains geometry type and coordinates for a GeoJSON geometry fence.STRINGNoNo

Example

geo:crosses(km-4354, -0.5, 0.5, {'type':'Polygon','coordinates':[[[0, 0],[2, 0],[2, 1],[0, 1],[0, 0]]]} )

This example returns true because the coordinates cross the geo.json.geometry.fence.