Jump to content

existing php libraries for parsing street addresses?


yekibud

Recommended Posts

 

I've got descriptive address strings like this:

 

    1. 

    2. 104 N Main Street, 3rd floor Masonic Bldg

    3. West Water Street next to Bobbys Auto Sales

    4. 436 Industry Rd 1/2 M from US 27 South of

    5. 111 Bridge St off US 31W @ N end of

    6. Main Street over Blue Daisey Flower Shop

    7. 112 S. Main Street              WILLIAMSTOWN

    8. Hwy 55, Springfield Rd & Corporate Drive

    9. US Highway 68 West, behing Subway      CADIZ

    10. 

 

 

etc., that I have to parse the street address from. I was thinking of

coming up with my own regex, but then I got tired of writing all the

possibilities for Rd, Rd., Road, St, St., Street, and so on.  Not to

mention the other complexities. Then I thought there must be some

generic libraries to help me out here.

 

I found Geo::StreetAddress::US in CPAN, which I guess I could get to

work - but I wanted to check if there was anything natively in PHP to

help me out.

 

Thanks for the tips.

 

Thanks for your response, effigy!

 

I did glance at that post, but I was wondering if there weren't some regex libraries out there that you could import for common parsing issues, like this one.  Seems like there should be.  Guess I'll just have to start building my own.

 

I'll give your solution a try - thanks again!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.