Skip to content

Commit c0dae60

Browse files
DOC-2761 stash progress so far
1 parent 1803db8 commit c0dae60

File tree

2 files changed

+50
-2
lines changed

2 files changed

+50
-2
lines changed

content/develop/interact/search-and-query/advanced-concepts/geo.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,15 @@ or for games, simulations, and other artificial scenarios.
3838

3939
## Storing geospatial data
4040

41+
42+
43+
## Specifying geospatial data in queries
44+
4145
Redis Query Engine uses the
42-
[*Well-Known Text*](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry)
46+
[*Well-Known Text* (WKT)](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry)
4347
format for geospatial data, specifically the `POINT` and `POLYGON`
44-
constructs.
48+
constructs. Add fields containing WKT data to your JSON objects,
49+
then add
4550

4651
### `POINT` data
4752

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
categories:
3+
- docs
4+
- develop
5+
- stack
6+
- oss
7+
- rs
8+
- rc
9+
- oss
10+
- kubernetes
11+
- clients
12+
description: How to index and search geospatial data
13+
linkTitle: Geo indexing
14+
title: Geospatial indexing
15+
weight: 3
16+
---
17+
18+
Redis supports two different schema types for geospatial data:
19+
20+
- `GEO`: This uses a simple format where individual geospatial
21+
points are specified as numeric longitude-latitude pairs.
22+
This type allows only basic point and radius queries.
23+
For example, you could index the `location` field of the
24+
the JSON object shown below as `GEO`:
25+
26+
```json
27+
{
28+
"location": "-104.991531, 39.742043"
29+
}
30+
```
31+
- `GEOSHAPE`: This uses a subset of the
32+
[Well-Known Text (WKT)](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry)
33+
format to specify both points and points and polygons. A
34+
`GEOSHAPE` field supports more advanced queries that `GEO`,
35+
such as checking if one shape overlaps or contains another.
36+
For example, the `rect` field of the JSON object shown
37+
below specifies a rectangular area:
38+
39+
```json
40+
{
41+
"rect": "POLYGON ((2 2.5, 2 3.5, 3.5 3.5, 3.5 2.5, 2 2.5))"
42+
}
43+
```

0 commit comments

Comments
 (0)