geobox v0.1.0 Geobox

Documentation for Geobox.

Link to this section Summary

Functions

Decodes given geohash to a coordinates bounding box

Examples

iex> Geobox.decode_box(“ezs42”) [-5.5810546875, 42.626953125, -5.625, 42.5830078125]

Return all the geohashes between min_y, min_x, max_y, max_x or polygon coordinates in resolution

Examples

iex> Geobox.encode_geohashes([16.9189453125, 52.470703125, 16.8310546875, 52.3828125]) [“u37fr”, “u3k42”, “u37fp”, “u3k40”]

Return all the geohashes in radious with given precision

Examples

iex> Geobox.geohashes_within_radius({52.4267578125, 16.875}, 1, 6) [“u37fr9”, “u37frc”, “u3k421”, “u3k423”, “u37fr8”, “u37frb”, “u3k420”, “u3k422”, “u37fpx”, “u37fpz”, “u3k40p”, “u3k40r”, “u37fpw”, “u37fpy”, “u3k40n”, “u3k40q”]

Link to this section Functions

Link to this function decode_box(geohash)

Decodes given geohash to a coordinates bounding box

Examples

iex> Geobox.decode_box(“ezs42”) [-5.5810546875, 42.626953125, -5.625, 42.5830078125]

Link to this function encode_geohashes(bb_or_coordinates, precision \\ 5)

Return all the geohashes between min_y, min_x, max_y, max_x or polygon coordinates in resolution

Examples

iex> Geobox.encode_geohashes([16.9189453125, 52.470703125, 16.8310546875, 52.3828125]) [“u37fr”, “u3k42”, “u37fp”, “u3k40”]

iex> Geobox.encode_geohashes([16.94874197310152, 52.47172383068623, 16.80125802689848, 52.38179179431377]) [“u37fw”, “u37fx”, “u3k48”, “u3k49”, “u37fq”, “u37fr”, “u3k42”, “u3k43”, “u37fn”, “u37fp”, “u3k40”, “u3k41”, “u37cy”, “u37cz”, “u3k1b”, “u3k1c”]

iex> Geobox.encode_geohashes(%{coordinates: [{16.76513671875, 52.42587274336118}, {16.827621459960938, 52.33114320164082}, {16.967010498046875, 52.39403946901232}, {17.123565673828125, 52.391106301345005}, {16.941604614257813, 52.53376701989025}, {16.76513671875, 52.42587274336118}]}, 5) [“u3k4b”, “u3k4c”, “u3k4f”, “u37fx”, “u3k48”, “u3k49”, “u3k4d”, “u3k4e”, “u37fm”, “u37fq”, “u37fr”, “u3k42”, “u3k43”, “u3k46”, “u3k47”, “u3k4k”, “u37fj”, “u37fn”, “u37fp”, “u3k40”, “u3k41”, “u3k44”, “u3k45”, “u3k4h”, “u3k4j”, “u37cy”, “u37cz”, “u3k1b”, “u3k1c”, “u37cw”, “u37cx”]

Link to this function geohashes_within_radius(point, km_radius, precision \\ 5)

Return all the geohashes in radious with given precision

Examples

iex> Geobox.geohashes_within_radius({52.4267578125, 16.875}, 1, 6) [“u37fr9”, “u37frc”, “u3k421”, “u3k423”, “u37fr8”, “u37frb”, “u3k420”, “u3k422”, “u37fpx”, “u37fpz”, “u3k40p”, “u3k40r”, “u37fpw”, “u37fpy”, “u3k40n”, “u3k40q”]

iex> Geobox.geohashes_within_radius({52.4267578125, 16.875}, 5) [“u37fw”, “u37fx”, “u3k48”, “u3k49”, “u37fq”, “u37fr”, “u3k42”, “u3k43”, “u37fn”, “u37fp”, “u3k40”, “u3k41”, “u37cy”, “u37cz”, “u3k1b”, “u3k1c”]