I'm using Google's Geocoding API to process free-form address data and am trying to make sense of the results (subpremise
, administrative_area_level_2
, etc.). At this point I'm only interested in addresses in the US, and would like to format the results as a street address, city, and state code. The state code seems straightforward (administrative_area_level_1
), but the others are more vague. Is city locality
or sublocality
or both or even more? The street address itself seems like it could be any number of combinations of the other fields.
Ideally, I'd like to just take the formatted_address
, strip off the city, state, zip, and country code, and keep what is left as my "street address". Are there any guidelines or recommendations for handling all these fields, at least for the majority of cases (regular addresses, addresses with unit numbers, etc.)?