Provides basic geocoding capabilities via the ArcGIS World Geocoding Service REST APIs
The package can be installed from Hex as:
- Add
:arcgis_geocode
to your list of dependencies inmix.exs
:
def deps do
[{:arcgis_geocode, "~> 0.2.0"}]
end
- Ensure
:arcgis_geocode
is started before your application:
def application do
[applications: [:arcgis_geocode]]
end
- Configure the
:arcgis_geocode
application to use your ArcGIS credentials:
config :arcgis_geocode,
client_id: "YOUR_CLIENT_ID",
client_secret: "YOUR_CLIENT_SECRET"
iex>ArcgisGeocode.geocode("463 Mountain View Dr Colchester VT 05446")
{:ok,
%ArcgisGeocode.GeocodeResult{city: "Colchester",
formatted: "463 Mountain View Dr, Colchester, Vermont, 05446",
lat: 44.51295958611712, lon: -73.18369692467252,
state_abbr: "VT", state_name: "Vermont", street_name: "Mountain View",
street_number: "463", street_type: "Dr", zip_code: "05446"}}