locationtech / locationtech/spatial4j

Encode Geo-hashes with Precision

Open
#37 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
961
Forks
172
PR merge metrics
No merged PRs in 30d

Description

Encode Geo-hashes with Precision

By looking at the Earth shape, one recognizes the size of geohash cells shrinks by moving away from the equator along an arbitrary latitude. In other words the radius depends on the latitudinal value. In cases where a user should able to define a precision he needs, this fact can be used to reduce the length of generated hashes. Also a precision value is a reasonable alternative to the currently used maxtreelevel value, used in geohash implementations.

An Example

The geohash 7zzzzzz refers to a geohash cell latlon1~(-0.00137, -0.00137) to latlon2=(0, 0) near the equator. The distance between these point corresponds to ~216.19656m. A geohash cell at a pole gzzzzzz with the same hash length refers to a cell with a size up to ~152.87406m. If i.e. a precision of 200m is accurate enough to encode geo-positions one can use hashes of length 8 for points between the latitudes -32.4837° and +32.4837° and geohashes of length 7 otherwise.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the geohash encoding implementation and the existing maxtreelevel handling. Use the latitude-dependent cell-size example and the requested precision value to define the encoding behavior, then identify tests for hash length and positional accuracy. Done means a documented, tested precision-based alternative to maxtreelevel.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.