Encode a coordinate into a hierarchical spatial prefix#
A geohash-like encoding maps latitude/longitude to a string such as the conceptual 9q8yy…. A longer prefix represents a smaller cell. Nearby points often share prefixes, but points on opposite sides of a boundary may not.
Search the current and relevant neighboring cells, then apply an exact distance calculation. Do not publish a universal “prefix length equals radius” rule: cell dimensions vary by latitude and the implementation's encoding.
| Strength | Cost |
|---|---|
| Hierarchical key/prefix representation | Boundary and neighbor handling |
| Works with prefix-based partitioning | Fixed cells can be hot in dense areas |
Related practice problems
Use the manifest-backed prompts below to apply this lesson in a complete design.
- Clusters, nodes, and shardsElastic Documentation