You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/cosmos-db/sql-query-geospatial-index.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Indexing geospatial data with Azure Cosmos DB
2
+
title: Index geospatial data with Azure Cosmos DB
3
3
description: Index spatial data with Azure Cosmos DB
4
4
author: timsander1
5
5
ms.service: cosmos-db
@@ -8,7 +8,7 @@ ms.date: 02/20/2020
8
8
ms.author: tisande
9
9
10
10
---
11
-
# Indexing geospatial data with Azure Cosmos DB
11
+
# Index geospatial data with Azure Cosmos DB
12
12
13
13
We designed Azure Cosmos DB’s database engine to be truly schema agnostic and provide first class support for JSON. The write optimized database engine of Azure Cosmos DB natively understands spatial data represented in the GeoJSON standard.
Copy file name to clipboardExpand all lines: articles/cosmos-db/sql-query-geospatial-query.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Here is a list of geospatial system functions useful for querying in Azure Cosmo
24
24
|ST_ISVALID| Returns a Boolean value indicating whether the specified GeoJSON Point, Polygon, or LineString expression is valid.|
25
25
| ST_ISVALIDDETAILED| Returns a JSON value containing a Boolean value if the specified GeoJSON Point, Polygon, or LineString expression is valid. If invalid, it returns the reason as a string value.|
26
26
27
-
Spatial functions can be used to perform proximity queries against spatial data. For example, here's a query that returns all family documents that are within 30 km of the specified location using the ST_DISTANCE built-in function.
27
+
Spatial functions can be used to perform proximity queries against spatial data. For example, here's a query that returns all family documents that are within 30 km of the specified location using the `ST_DISTANCE` built-in function.
28
28
29
29
**Query**
30
30
@@ -42,7 +42,7 @@ Spatial functions can be used to perform proximity queries against spatial data.
42
42
}]
43
43
```
44
44
45
-
If you include spatial indexing in your indexing policy, then "distance queries" will be served efficiently through the index. For more information on spatial indexing, see [geospatial indexing](sql-query-geospatial-indexing.md). If you don't have a spatial index for the specified paths, the query will do a scan of the container.
45
+
If you include spatial indexing in your indexing policy, then "distance queries" will be served efficiently through the index. For more information on spatial indexing, see [geospatial indexing](sql-query-geospatial-index.md). If you don't have a spatial index for the specified paths, the query will do a scan of the container.
46
46
47
47
`ST_WITHIN` can be used to check if a point lies within a Polygon. Commonly Polygons are used to represent boundaries like zip codes, state boundaries, or natural formations. Again if you include spatial indexing in your indexing policy, then "within" queries will be served efficiently through the index.
48
48
@@ -94,7 +94,7 @@ Azure Cosmos DB also supports performing inverse queries, that is, you can index
94
94
}]
95
95
```
96
96
97
-
`ST_ISVALID` and `ST_ISVALIDDETAILED` can be used to check if a spatial object is valid. For example, the following query checks the validity of a point with an out of range latitude value (-132.8). ST_ISVALID returns just a Boolean value, and ST_ISVALIDDETAILED returns the Boolean and a string containing the reason why it is considered invalid.
97
+
`ST_ISVALID` and `ST_ISVALIDDETAILED` can be used to check if a spatial object is valid. For example, the following query checks the validity of a point with an out of range latitude value (-132.8). `ST_ISVALID` returns just a Boolean value, and `ST_ISVALIDDETAILED` returns the Boolean and a string containing the reason why it is considered invalid.
98
98
99
99
**Query**
100
100
@@ -110,7 +110,7 @@ Azure Cosmos DB also supports performing inverse queries, that is, you can index
110
110
}]
111
111
```
112
112
113
-
These functions can also be used to validate Polygons. For example, here we use `ST_ISVALIDDETAILED` to validate a Polygon that is not closed.
113
+
These functions can also be used to validate Polygons. For example, here we use `ST_ISVALIDDETAILED` to validate a Polygon that is not closed.
114
114
115
115
**Query**
116
116
@@ -131,8 +131,9 @@ These functions can also be used to validate Polygons. For example, here we use
131
131
}]
132
132
```
133
133
134
-
## LINQ Querying in the .NET SDK
135
-
The SQL .NET SDK also providers stub methods `Distance()` and `Within()` for use within LINQ expressions. The SQL LINQ provider translates this method calls to the equivalent SQL built-in function calls (ST_DISTANCE and ST_WITHIN respectively).
134
+
## LINQ querying in the .NET SDK
135
+
136
+
The SQL .NET SDK also providers stub methods `Distance()` and `Within()` for use within LINQ expressions. The SQL LINQ provider translates this method calls to the equivalent SQL built-in function calls (ST_DISTANCE and ST_WITHIN respectively).
136
137
137
138
Here's an example of a LINQ query that finds all documents in the Azure Cosmos container whose `location` value is within a radius of 30 km of the specified point using LINQ.
138
139
@@ -176,4 +177,4 @@ Now that you have learned how to get started with geospatial support in Azure Co
176
177
177
178
* Learn more about [Azure Cosmos DB Query](sql-query-getting-started.md)
178
179
* Learn more about [Geospatial and GeoJSON location data in Azure Cosmos DB](sql-query-geospatial-intro.md)
179
-
* Learn more about [Indexing spatial data with Azure Cosmos DB](sql-query-geospatial-indexing.md)
180
+
* Learn more about [Index spatial data with Azure Cosmos DB](sql-query-geospatial-index.md)
0 commit comments