Comparing street addresses (abbreviations and such)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sugapablo

    Comparing street addresses (abbreviations and such)

    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 ]
    [ sugapablo@12jab ber.com <--jabber IM ]
  • Paul 'piz' Wellner Bou

    #2
    Re: Comparing street addresses (abbreviations and such)

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

    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.

    Comment

    • Sugapablo

      #3
      Re: Comparing street addresses (abbreviations and such)

      In article <c0vmh7$1c617p$ 1@ID-205474.news.uni-berlin.de>, Paul 'piz' Wellner Bou wrote:[color=blue]
      >
      > Yes. Storing the information in different columns.[/color]

      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 ]
      [ sugapablo@12jab ber.com <--jabber IM ]

      Comment

      • CountScubula

        #4
        Re: Comparing street addresses (abbreviations and such)

        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" <russREMOVE@sug apablo.com> wrote in message
        news:slrnc36k1f .8n5.russREMOVE @dell.sugapablo .net...[color=blue]
        > 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 ]
        > [ sugapablo@12jab ber.com <--jabber IM ][/color]


        Comment

        • Steven C. Gallafent

          #5
          Re: Comparing street addresses (abbreviations and such)

          "Sugapablo" <russREMOVE@sug apablo.com> wrote in message
          news:slrnc36k1f .8n5.russREMOVE @dell.sugapablo .net...[color=blue]
          > 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?[/color]

          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
          steve@compguy.c om - http://www.compguy.com/


          Comment

          Working...