Liking cljdoc? Tell your friends :D

Sextant

cljdoc badge

Offline location geocoder/reverse geocoder from GeoName datasets

Shamelessly using code from both twitter-location-parser and OfflineReverseGeocode for the reverse GeoCoding parts.

Made it clojure friendly, the geocoder and reverse geocoder both return the same record type, and implement the same protocol.

They both have ready to use components.

(require 'qbits.sextant.geocoder)
(require 'qbits.sextant)
(def g (qbits.sextant.geocoder/load))
(qbits.sextant/find-location g "paris")

=>
#qbits.sextant.Location{
 :name "Paris",
 :state-code "11",
 :country-code "FR",
 :type :city,
 :population 2138551,
 :latitude 48.85341,
 :longitude 2.3488
}

;; And from the reverse geocoder

(require 'qbits.sextant.reverse-geocoder)
(def g (qbits.sextant.reverse-geocoder/load))
(qbits.sextant/find-location g [48.85341 2.3488])

=> #qbits.sextant.Location{
    :name "Paris",
    :state-code "11",
    :country-code "FR",
    :type :city,
    :population 2138551,
    :latitude 48.85341,
    :longitude 2.3488
    }

The component is in qbits.sextant.component, it uses the same api, you just call qbits.sextant/find-location on it once it's started.

Installation

add this to your project.clj

Clojars Project

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close