By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,706 Members | 2,046 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,706 IT Pros & Developers. It's quick & easy.

Comparing street addresses (abbreviations and such)

P: n/a
I have a database table that contains street addresses in the following
format:

123 Any St.
456 Some Rd.
7789 That Blvd.
etc.

I.e. Street number, street name, standard abbriviation of road type.

Now, I have a web form where people will type in an address. The
problem is for what I have in the database (123 Any St.) a person might
type in:

123 Any St.
123 Any Street
123 Any
123 Any Street Apt. 4D
123 Any St. # 4D
#4D 123 Any St
etc.

What would be my best bet here? What I need is a sort of "best match"
ability (I'm assuming), but I'm unsure how to do it. Anyone have any
really good ideas?

Note: I'm not interested in Apartment numbers. They should be ignored.
I'm only concerned with building locations.

--
[ Sugapablo ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ su*******@12jabber.com <--jabber IM ]
Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
> What would be my best bet here? What I need is a sort of "best match"
ability (I'm assuming), but I'm unsure how to do it. Anyone have any
really good ideas?


Yes. Storing the information in different columns.

Otherwise, you can use explode() and compare the Array entries, but to
check really all possible cases (if possible)...

Greetz
Paul.
Jul 17 '05 #2

P: n/a
In article <c0*************@ID-205474.news.uni-berlin.de>, Paul 'piz' Wellner Bou wrote:

Yes. Storing the information in different columns.


Well when people are entering their data (i.e. a street address) it will
be a single string that will need exploded. Therein lies the
difficulties. :)

--
[ Sugapablo ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ su*******@12jabber.com <--jabber IM ]
Jul 17 '05 #3

P: n/a
since its all in one string, lets deal with that rather than discuss how it
should be seperate fields.

take a string that a user wants to search for, and removre any of the
following from it:

st, st., street, ave, av, etc.....

then look to see if that string is inside of the address strings you have.

......just an idea

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"Sugapablo" <ru********@sugapablo.com> wrote in message
news:sl***********************@dell.sugapablo.net. ..
I have a database table that contains street addresses in the following
format:

123 Any St.
456 Some Rd.
7789 That Blvd.
etc.

I.e. Street number, street name, standard abbriviation of road type.

Now, I have a web form where people will type in an address. The
problem is for what I have in the database (123 Any St.) a person might
type in:

123 Any St.
123 Any Street
123 Any
123 Any Street Apt. 4D
123 Any St. # 4D
#4D 123 Any St
etc.

What would be my best bet here? What I need is a sort of "best match"
ability (I'm assuming), but I'm unsure how to do it. Anyone have any
really good ideas?

Note: I'm not interested in Apartment numbers. They should be ignored.
I'm only concerned with building locations.

--
[ Sugapablo ]
[ http://www.sugapablo.com <--music ]
[ http://www.sugapablo.net <--personal ]
[ su*******@12jabber.com <--jabber IM ]

Jul 17 '05 #4

P: n/a
"Sugapablo" <ru********@sugapablo.com> wrote in message
news:sl***********************@dell.sugapablo.net. ..
123 Any St.
123 Any Street
123 Any
123 Any Street Apt. 4D
123 Any St. # 4D
#4D 123 Any St
etc.

What would be my best bet here? What I need is a sort of "best match"
ability (I'm assuming), but I'm unsure how to do it. Anyone have any
really good ideas?


If they're all US addresses, run them through a USPS address validator. It
will standardize all of the above to 123 ANY ST or 123 ANY ST APT 4D or
something similar which you can reliably compare. You can also get the
ZIP+4, which allows you to match them together. ZIP+4 + street number (123
in this case) should be unique.

Steve
--
Steven C. Gallafent - The Computer Guy
st***@compguy.com - http://www.compguy.com/
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.