title: Geocoding multi-line street addresses (Address1 / Address2)
body: <p>Our app's postal-address entry UI is a two-line Address1/Address2 field like this (borrowing screenshot from Amazon.com).</p>
  
  <p><a href="https://i.stack.imgur.com/kExOD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kExOD.png" alt="enter image description here"></a></p>
  
  <p>But real users' data entry is always messy. Some users will ignore our directions and will sometimes put the street address in Address1 and sometimes put it in Address2. Other users will import lists of addresses from external sources (like an existing mailing list), which will also likely cause some cases where the street address is unpredictably in Address1 or Address2. </p>
  
  <p>When it comes time to geocode the address, what's a good algorithm to maximize the chance of successful geocoding if we're not sure whether the street address is in Address1 or Address2? A naive approach could be to try Address1, and if it fails then try Address2. But I'm sure I'm not the first person to try geo-coding real-world messy data entry... how is this problem usually solved?</p>
  
  <p>We're using the <a href="https://developers.google.com/maps/documentation/geocoding/intro" rel="nofollow noreferrer">Google Maps Geocoding API</a>, if it matters.</p>