Z.Addresses (Portico/Z v0.1.0)

Context module for all things related to addresses - mostly searching for them.

Link to this section Summary

Link to this section Functions

Link to this function

geocode_to_address(geocode, type \\ :short_name)

Parse a Library.Google.Geocode into a ZSchemas.Address.

You can pass :long_name or :short_name as the type, which will have the effect of lengthening or abbreviating address titles like "Street".

Examples

iex> [lookup] = Library.Google.geocode_lookup("932 washington st. norwood ma")
iex> %ZSchemas.Address{} = address = Z.Addresses.geocode_to_address(lookup)
iex> address.street
"932 Washington St"
iex> address.city
"Norwood"
Link to this function

search(address)

Search by address string.

Returns a list of matching addresses as ZSchemas.Address structs.

Examples

iex> [address] = Z.Addresses.search("932 Washington St., Norwood MA 02062")
iex> address.street
"932 Washington St"