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.

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.