proximityhash icon indicating copy to clipboard operation
proximityhash copied to clipboard

Reuse the Geohash prefix

Open ppKrauss opened this issue 4 years ago • 0 comments

((This project was abandoned, so, if there are a good alternative where we can post issues, please comment here.))

Suggestion, as we can see at README illustrations, there are a lot of reduntant information in a list of Geohashes of a proximity. The commom prefix is not perfect, but a soution is to use a separator to mark the parent digit or a start character to mark the only prefix. Suppose using "_" as mark:

  • one commom prefix:
    {u09w58, u09w5b, u09tuz} = prefixes(u09) + {_w58, _w5b, _tuz}.

  • many (2,3 or 4) prefixes:
    {u09w58, u09w5b, u09tuz, u0812, u081b} = prefixes(u09, u081) + {1_w58, 1_w5b, 1_tuz, 2_2, 2_b}.

It is a simple "cut prefix redundance" easy/intuitive algorithm (so it is human readable) for enhance labels in data visualization or compress a long list of geohashes.

When in the context not exist risk of confusion with complete Geohash, we can cut the mark supposing that it is a simple operation:

  • of concatenation at {w58, w5b, tuz};
  • of "replace first digit" at {1w58, 1w5b, 1tuz, 22, 2b}.

PS: in the proxymity of "many" geohashes we can use, instead [1,2,3,4] the "N,S,O,W", in upper case, to reuse direction information, that is (perhaps) more human-readable, but need a complex algorithm to detect directions.

ppKrauss avatar Nov 30 '19 13:11 ppKrauss