GetGeocode (GetGeocode v0.0.2) View Source

The main module with get/1 function to retrieve data from CEP (brazilian format) or full address format (Nominatim).

Link to this section Summary

Functions

Returns a error {:error, "Invalid input"}. Argument must be provided.

Gets geodata from input. Returns a tuple with {:ok, %GetGeocode.Geocode{}}.

Link to this section Functions

Returns a error {:error, "Invalid input"}. Argument must be provided.

Examples

  iex> GetGeocode.get
  {:error, "Invalid input"}

Gets geodata from input. Returns a tuple with {:ok, %GetGeocode.Geocode{}}.

Examples

  iex> GetGeocode.get "69030000"
  {:ok,
  %GetGeocode.Geocode{
    city: "Manaus",
    full_details: "Rua Izaurina Braga, Compensa, Manaus, Região Geográfica Imediata de Manaus, Região Geográfica Intermediária de Manaus, Amazonas, Região Norte, 69000-000, Brasil",
    lat: "-3.1054153",
    lng: "-60.0547259",
    neighborhood: "Compensa",
    postalcode: "69030-000",
    state: "AM",
    street: "Rua Izaurina Braga"
  }}