ZIPCodes (zip_codes v0.2.0)

View Source

Look up the latitude and longitude of a ZIP code.

Summary

Functions

Look up the latitude and longitude of a ZIP code.

Functions

lat_long(zip)

@spec lat_long(String.t()) :: {float(), float()} | nil

Look up the latitude and longitude of a ZIP code.

ZIP+4 codes will be truncated to the first five digits.

Examples

iex> ZIPCodes.lat_long("90210")
{34.100517, -118.41463}

iex> ZIPCodes.lat_long("90210-4701")
{34.100517, -118.41463}

iex> ZIPCodes.lat_long("99999")
nil

iex> ZIPCodes.lat_long("")
nil