Skip to content

priestd09/abode

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

abode ๐Ÿ 

GoDoc Build Status Go Report Card license

Explode one-line address strings using Golang.

This package uses the Google Maps API to geocode the address. Don't forget to set your GOOGLE_MAPS_API_KEY environment variable.

Installation

go get -u github.com/mattevans/abode

Example

Explode your one-line address...

yourAddress := "193 Rogers Ave, Brooklyn, New York"

// Explode our one-line address into components.
address, err := abode.Explode(yourAddress)
if err != nil {
  return err
}

Which will give you...

abode.Address{
  AddressLine1:     "193 Rogers Avenue",
  AddressLine2:     "Brooklyn"
  AddressCity:      nil,
  AddressState:     "New York"
  AddressCountry:   "United States"
  AddressZip:       "11216"
  AddressLat:       40.6706073,
  AddressLng:       -73.9530182,
  FormattedAddress: "193 Rogers Ave, Brooklyn, NY 11216, USA",
}

Configuration

Each abode.Address{} component can be tailored to meet your needs. Simply adjust the mapping of the Google Maps Address Components here.

Disclaimer

Ensure your end results are used in conjunction with a Google Map to avoid violating the Google Maps API Terms of Service.

About

๐Ÿ  Explode one-line address strings using Golang

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%