jgv / area

Perform a variety of conversions between places and area codes or zip codes.
http://jonathanvingiano.com/area
MIT License
176 stars 58 forks source link

Throws exception on nine-digit zip code #17

Open mstahl opened 10 years ago

mstahl commented 10 years ago

This is easy enough I figure I'll send you a pull request later today, but thought I'd write an issue anyway to start a discussion about this. When I send a ZIP code with a +4, e.g. "60622-1234", Area raises an ArgumentError: "You must provide a valid area or zip code". For my purposes I don't really care about the +4, so I could filter it out before asking Area, but Area really should handle these kinds of ZIP codes as they are considered to be well-formatted and are accepted by the US Postal Service as valid zip codes.

I think it would be unreasonable to ask it to know exactly where each +4 zip code is, geographically (like, lat/lng should come from the first five digits because seriously nobody should care about the last four), but including the +4 is definitely not good enough cause for throwing an exception.

jgv commented 10 years ago

Agreed. Happy to accept a pull request for this.

On Jan 8, 2014, at 15:33, max thom stahl notifications@github.com wrote:

This is easy enough I figure I'll send you a pull request later today, but thought I'd write an issue anyway to start a discussion about this. When I send a ZIP code with a +4, e.g. "60622-1234", Area raises an ArgumentError: "You must provide a valid area or zip code". For my purposes I don't really care about the +4, so I could filter it out before asking Area, but Area really should handle these kinds of ZIP codes as they are considered to be well-formatted and are accepted by the US Postal Service as valid zip codes.

I think it would be unreasonable to ask it to know exactly where each +4 zip code is, geographically (like, lat/lng should come from the first five digits because seriously nobody should care about the last four), but including the +4 is definitely not good enough cause for throwing an exception.

— Reply to this email directly or view it on GitHub.