Liking cljdoc? Tell your friends :D

wagoe.geo.shell.service

Public API for the geo module.

Entry points:

  • geocode! — forward geocoding with cache-first lookup
  • reverse-geocode! — reverse geocoding (no caching, coordinates not hashed)
  • distance — pure Haversine distance delegate

geocode! flow:

  1. Compute query-hash from the AddressQuery
  2. If a cache is configured, attempt cache-lookup
  3. On cache miss, iterate providers until one returns a result
  4. Cache-store! the result (if cache configured and result non-nil)
  5. Return result or nil
Public API for the geo module.

Entry points:
- geocode!         — forward geocoding with cache-first lookup
- reverse-geocode! — reverse geocoding (no caching, coordinates not hashed)
- distance         — pure Haversine distance delegate

`geocode!` flow:
  1. Compute query-hash from the AddressQuery
  2. If a cache is configured, attempt cache-lookup
  3. On cache miss, iterate providers until one returns a result
  4. Cache-store! the result (if cache configured and result non-nil)
  5. Return result or nil
raw docstring

distanceclj

(distance point-a point-b)

Calculate the great-circle distance between two points.

Delegates to core/math/haversine-distance — this function is pure.

Args: point-a - GeoPoint map with :lat and :lng point-b - GeoPoint map with :lat and :lng

Returns: Distance in kilometres as a double.

Calculate the great-circle distance between two points.

Delegates to core/math/haversine-distance — this function is pure.

Args:
  point-a - GeoPoint map with :lat and :lng
  point-b - GeoPoint map with :lat and :lng

Returns:
  Distance in kilometres as a double.
sourceraw docstring

geocode!clj

(geocode! {:keys [providers cache]} query)

Forward geocode an address query.

Args: service - GeoService map (from module_wiring or test fixtures): {:providers [provider ...] :cache cache-or-nil} query - AddressQuery map

Returns: GeoResult map or nil if no provider returned a result.

Forward geocode an address query.

Args:
  service - GeoService map (from module_wiring or test fixtures):
            {:providers [provider ...] :cache cache-or-nil}
  query   - AddressQuery map

Returns:
  GeoResult map or nil if no provider returned a result.
sourceraw docstring

reverse-geocode!clj

(reverse-geocode! {:keys [providers]} point)

Reverse geocode coordinates to an address.

Args: service - GeoService map point - GeoPoint map with :lat and :lng

Returns: GeoResult map or nil.

Reverse geocode coordinates to an address.

Args:
  service - GeoService map
  point   - GeoPoint map with :lat and :lng

Returns:
  GeoResult map or nil.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close