Skip to content

Commit

Permalink
DOC-2761 limitations section, fixes and note in geo data type page
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-stark-redis committed Dec 12, 2024
1 parent 4057de1 commit 0a6efcb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
8 changes: 8 additions & 0 deletions content/develop/data-types/geospatial.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ weight: 80
Redis geospatial indexes let you store coordinates and search for them.
This data structure is useful for finding nearby points within a given radius or bounding box.

{{< note >}}Take care not to confuse the Geospatial data type with the
[Geospatial]({{< relref "/develop/interact/search-and-query/advanced-concepts/geo" >}})
features in [Redis Query Engine]({{< relref "/develop/interact/search-and-query" >}}).
Although there are some similarities between these two features, the data type is intended
for simpler use cases and doesn't have the range of format options and queries
available in Redis Query Engine.
{{< /note >}}

## Basic commands

* [`GEOADD`]({{< relref "/commands/geoadd" >}}) adds a location to a given geospatial index (note that longitude comes before latitude with this command).
Expand Down
10 changes: 10 additions & 0 deletions content/develop/interact/search-and-query/advanced-concepts/geo.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,13 @@ See
for more information about these query types and see
[Geospatial indexing]({{< relref "/develop/interact/search-and-query/indexing/geoindex" >}})
for examples of indexing `GEOSHAPE` fields.

## Limitations of geographical coordinates

Planet Earth is actually shaped more like an
[ellipsoid](https://en.wikipedia.org/wiki/Earth_ellipsoid) than a perfect sphere.
The spherical coordinate system used by Redis Query Engine is a close
approximation to the shape of the Earth but not exact. For most practical
uses of geospatial queries, the approximation works very well, but you
shouldn't rely on it if you need very precise location data (for example, to track
the GPS locations of boats in an emergency response system).
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ categories:
- oss
- kubernetes
- clients
description: How to index and search geospatial data
linkTitle: Geo indexing
description: Options for indexing geospatial data
linkTitle: Geospatial
title: Geospatial indexing
weight: 3
---
Expand All @@ -32,9 +32,8 @@ reference page for a full description of both types.

## `GEO`

The following [`redis-cli`]({{< relref "/develop/tools/cli" >}}) command
creates a `GEO` index for JSON objects that contain the geospatial data
in a field called `location`:
The following command creates a `GEO` index for JSON objects that contain
the geospatial data in a field called `location`:

```bash
> FT.CREATE productidx ON JSON PREFIX 1 product: SCHEMA $.location AS location GEO
Expand Down

0 comments on commit 0a6efcb

Please sign in to comment.