Giter Club home page Giter Club logo

proximityhash's People

Contributors

ashwin711 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proximityhash's Issues

Reuse the Geohash prefix

((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.

Fixing longitude values when they cross +/-180

The function convert_to_latlon gives wrong longitude values that can be above 180 or below -180 degrees when the reference longitude is close to +/-180. This should fix it:

def convert_to_latlon(y, x, latitude, longitude):

    pi = 3.14159265359

    r_earth = 6371000

   lat_diff = (y / r_earth) * (180 / pi)
   lon_diff = (x / r_earth) * (180 / pi) / math.cos(latitude * pi/180)

   final_lat = latitude+lat_diff
   final_lon = longitude+lon_diff

   final_lon = final_lon - 360 if final_lon > 180 else final_lon
   final_lon = 360 + final_lon if final_lon < -180 else final_lon

   return (final_lat, final_lon)

Generate wrong geohash code in some case

proximityhash -81.61573388649089 -143.9767487947425 5000 7 --georaptor True

In some input case, it generate wrong output, please help analyze this issue, Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.