ST_INTERSECTS (NoSQL query)
APPLIES TO:
NoSQL
Returns a boolean indicating whether the GeoJSON object (Point, Polygon, MultiPolygon, or LineString) specified in the first argument intersects the GeoJSON object in the second argument.
Syntax
ST_INTERSECTS(<spatial_expr_1>, <spatial_expr_2>)
Arguments
Description | |
---|---|
spatial_expr_1 |
Any valid GeoJSON Point, Polygon, MultiPolygon or LineString expression. |
spatial_expr_2 |
Any valid GeoJSON Point, Polygon, MultiPolygon or LineString expression. |
Return types
Returns a boolean value.
Examples
The following example shows how to find if two polygons intersect.
SELECT VALUE {
highWayAndCampusIntersect: ST_INTERSECTS({
"type": "Polygon",
"coordinates": [ [
[
-122.13693695285855,
47.64996065621003
],
[
-122.1351662656516,
47.64627863318731
],
[
-122.13488295569863,
47.646326350048696
],
[
-122.1366182291613,
47.650016321952904
],
[
-122.13693695285855,
47.64996065621003
]
] ]
}, {
"type": "Polygon",
"coordinates": [ [
[
-122.14034847687708,
47.6494835188378
],
[
-122.14014779899375,
47.64625477474044
],
[
-122.13256925774829,
47.646207057813655
],
[
-122.13254564858545,
47.64941990019193
],
[
-122.14034847687708,
47.6494835188378
]
] ]
})
}
[
{
"highWayAndCampusIntersect": true
}
]
Remarks
- This function benefits from a geospatial index except in queries with aggregates.
- The GeoJSON specification requires that points within a Polygon be specified in counter-clockwise order. A Polygon specified in clockwise order represents the inverse of the region within it.
Related content
प्रतिक्रिया
https://aka.ms/ContentUserFeedback.
जल्द आ रहा है: 2024 के दौरान हम सामग्री के लिए फीडबैक तंत्र के रूप में GitHub मुद्दों को चरणबद्ध तरीके से समाप्त कर देंगे और इसे एक नई फीडबैक प्रणाली से बदल देंगे. अधिक जानकारी के लिए, देखें:के लिए प्रतिक्रिया सबमिट करें और देखें