ES|QL ST_DISJOINT function
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Generally available
Stack
Generally available
Returns whether two geometries are disjoint, sharing no points in common.
geomA- Expression that is either a geometry (
geo_point,cartesian_point,geo_shapeorcartesian_shape) or a geo-grid value (geohash,geotile,geohex). Ifnull, the function returnsnull. geomB-
Expression that is either a geometry (
geo_point,cartesian_point,geo_shapeorcartesian_shape) or a geo-grid value (geohash,geotile,geohex). Ifnull, the function returnsnull. The second parameter must also have the same coordinate system as the first. This means it is not possible to combinegeo_*andcartesian_*parameters.
Returns whether the two geometries or geometry columns are disjoint. This is the inverse of the ST_INTERSECTS function. In mathematical terms: ST_Disjoint(A, B) ⇔ A ⋂ B = ∅
| geomA | geomB | result |
|---|---|---|
| cartesian_point | cartesian_point | boolean |
| cartesian_point | cartesian_shape | boolean |
| cartesian_shape | cartesian_point | boolean |
| cartesian_shape | cartesian_shape | boolean |
| geo_point | geo_point | boolean |
| geo_point | geo_shape | boolean |
| geo_point | geohash | boolean |
| geo_point | geohex | boolean |
| geo_point | geotile | boolean |
| geo_shape | geo_point | boolean |
| geo_shape | geo_shape | boolean |
| geohash | geo_point | boolean |
| geohex | geo_point | boolean |
| geotile | geo_point | boolean |
FROM airport_city_boundaries
| WHERE ST_DISJOINT(city_boundary, TO_GEOSHAPE("POLYGON((-10 -60, 120 -60, 120 60, -10 60, -10 -60))"))
| KEEP abbrev, airport, region, city, city_location
| abbrev:keyword | airport:text | region:text | city:keyword | city_location:geo_point |
|---|---|---|---|---|
| ACA | General Juan N Alvarez Int'l | Acapulco de Juárez | Acapulco de Juárez | POINT (-99.8825 16.8636) |