Discussion:
Ambiguous results returned from FindAddress
(too old to reply)
Jakob
2008-10-30 12:56:04 UTC
Permalink
My DataSource is set to MapPoint.NA. I am currently evaluating address
decoding platforms for a store locator I plan to build. I am using the
staging webservice for this.

My problem is this: I get ambiguous results from FindAddress on hundreds of
addresses, below are a couple of samples.

Test sample #1
=> 209 New Bruncwick Avenue, Perth Amboy, NJ, 08861
using FindAddress on above and I get back two results about 1.7 miles
apart (.9 score for both)
<= 209 New Brunswick Ave, Perth Amboy, NJ 08861 40.5120717788259
-74.2705891101266
<= 209 New Brunswick Ave, Perth Amboy, NJ 08861 40.5245915155745
-74.2979371875633

Both MapQuest and Live Maps decode fine and just show the location, how does
Live Maps do that? Is Live Maps using a different DataSource?

Test sample #2
=> 157 Main Street, East Haven, CT, 06512
using FindAddress on above and I get back two results about 1.3 miles
apart (.9 score for both)
<= 157 Main St, East Haven, CT 06512 41.2860483250042 -72.8880495390893
<= 157 Main St, East Haven, CT 06512 41.2762060224102 -72.8676614244168

Again, both MapQuest and Live Maps decode the address just fine.

How am I to know which result is the correct one, such as the one that e.g.
Live Maps uses?

Thanks for any help or insight you can provide,
Jakob
Derek Chan
2008-10-30 14:13:01 UTC
Permalink
Jakob,

How are you breaking up your queries into parameters for FindAddress? I had
no problem getting 1 result using the following parameters for both your
listed addresses. For example:

Street: 157 Main Street
City: East Haven
State: CT
PostalCode: 06512
Country: United States
Datasource: NA

On another note, there's no real way to find out how the maps.live.com
searching algorithm works as this is something internal to Microsoft. It
doesn't even match the Virtual Earth VEMap.Find call. From what I can tell
it calls a handler that has it's own searching logic depending on the
ambiguous querystrings that are passed to it.

Hope that helps,
--
Infusion Development
http://www.infusion.com
Post by Jakob
My DataSource is set to MapPoint.NA. I am currently evaluating address
decoding platforms for a store locator I plan to build. I am using the
staging webservice for this.
My problem is this: I get ambiguous results from FindAddress on hundreds of
addresses, below are a couple of samples.
Test sample #1
=> 209 New Bruncwick Avenue, Perth Amboy, NJ, 08861
using FindAddress on above and I get back two results about 1.7 miles
apart (.9 score for both)
<= 209 New Brunswick Ave, Perth Amboy, NJ 08861 40.5120717788259
-74.2705891101266
<= 209 New Brunswick Ave, Perth Amboy, NJ 08861 40.5245915155745
-74.2979371875633
Both MapQuest and Live Maps decode fine and just show the location, how does
Live Maps do that? Is Live Maps using a different DataSource?
Test sample #2
=> 157 Main Street, East Haven, CT, 06512
using FindAddress on above and I get back two results about 1.3 miles
apart (.9 score for both)
<= 157 Main St, East Haven, CT 06512 41.2860483250042 -72.8880495390893
<= 157 Main St, East Haven, CT 06512 41.2762060224102 -72.8676614244168
Again, both MapQuest and Live Maps decode the address just fine.
How am I to know which result is the correct one, such as the one that e.g.
Live Maps uses?
Thanks for any help or insight you can provide,
Jakob
Jakob
2008-10-30 15:45:00 UTC
Permalink
Hi Derek,

Thanks for your quick reply!
I must be doing something wrong or differently than you. When you say your
DataSource is NA, do you mean "MapPoint.NA" or are you using one called "NA"?

I will include some code that shows more about what I'm doing. Maybe you can
see what I'm doing wrong?
Also, my web service reference shown below. Am I using an old one or a
different one than you?
url="https://staging.mappoint.net/secure-30/mappoint.wsdl"
filename="mappoint.wsdl"

Thanks again for your help,
Jakob

System.Net.NetworkCredential networkCredential = new
System.Net.NetworkCredential("blah", "blah");
net.mappoint.staging.FindServiceSoap findService = new FindServiceSoap();
findService.Credentials = networkCredential;
findService.PreAuthenticate = true;
findService.UserInfoFindHeaderValue = new UserInfoFindHeader();
findService.UserInfoFindHeaderValue.DefaultDistanceUnit =
net.mappoint.staging.DistanceUnit.Mile;

...

Address address = new Address();
address.AddressLine = findAddress.Address; // e.g. "157 MAIN STREET"
address.PostalCode = findAddress.ZIP_Code; // "06512"
address.PrimaryCity = findAddress.City; // "EAST HAVEN"
address.Subdivision = findAddress.State; // "CT"
address.CountryRegion = "United States";

FindOptions findOptions = new FindOptions();
findOptions.ResultMask = FindResultMask.LatLongFlag |
FindResultMask.AddressFlag;
findOptions.SearchContext = 244; // 244=US

FindAddressSpecification findAddressSpecification = new
FindAddressSpecification();
findAddressSpecification.InputAddress = address;
findAddressSpecification.DataSourceName = "MapPoint.NA";
findAddressSpecification.Options = findOptions;

// Let's look it up
FindResults findResults = null;
try
{
findResults = findService.FindAddress(findAddressSpecification);
}

findResults.NumberFound is 2
findResults.Results is array of 2 FindResult elements:

From Debug just before FindAddress call:
address {net.mappoint.staging.Address} net.mappoint.staging.Address
AddressLine "157 MAIN STREET" string
addressLineField "157 MAIN STREET" string
CountryRegion "United States" string
countryRegionField "United States" string
FormattedAddress null string
formattedAddressField null string
PostalCode "06512" string
postalCodeField "06512" string
PrimaryCity "EAST HAVEN" string
primaryCityField "EAST HAVEN" string
SecondaryCity null string
secondaryCityField null string
Subdivision "CT" string
subdivisionField "CT" string
Post by Derek Chan
Jakob,
How are you breaking up your queries into parameters for FindAddress? I had
no problem getting 1 result using the following parameters for both your
Street: 157 Main Street
City: East Haven
State: CT
PostalCode: 06512
Country: United States
Datasource: NA
On another note, there's no real way to find out how the maps.live.com
searching algorithm works as this is something internal to Microsoft. It
doesn't even match the Virtual Earth VEMap.Find call. From what I can tell
it calls a handler that has it's own searching logic depending on the
ambiguous querystrings that are passed to it.
Hope that helps,
--
Infusion Development
http://www.infusion.com
Derek Chan
2008-11-03 19:27:01 UTC
Permalink
Everything looks fine here, except I don't think you need to specify the
findOptions.SearchContext. Can you try removing that and see what happens?
Also, what are the two latitude/longitude pairs that are returned for your
queries?

Regards,
--
Infusion Development
http://www.infusion.com
Post by Jakob
Hi Derek,
Thanks for your quick reply!
I must be doing something wrong or differently than you. When you say your
DataSource is NA, do you mean "MapPoint.NA" or are you using one called "NA"?
I will include some code that shows more about what I'm doing. Maybe you can
see what I'm doing wrong?
Also, my web service reference shown below. Am I using an old one or a
different one than you?
url="https://staging.mappoint.net/secure-30/mappoint.wsdl"
filename="mappoint.wsdl"
Thanks again for your help,
Jakob
System.Net.NetworkCredential networkCredential = new
System.Net.NetworkCredential("blah", "blah");
net.mappoint.staging.FindServiceSoap findService = new FindServiceSoap();
findService.Credentials = networkCredential;
findService.PreAuthenticate = true;
findService.UserInfoFindHeaderValue = new UserInfoFindHeader();
findService.UserInfoFindHeaderValue.DefaultDistanceUnit =
net.mappoint.staging.DistanceUnit.Mile;
...
Address address = new Address();
address.AddressLine = findAddress.Address; // e.g. "157 MAIN STREET"
address.PostalCode = findAddress.ZIP_Code; // "06512"
address.PrimaryCity = findAddress.City; // "EAST HAVEN"
address.Subdivision = findAddress.State; // "CT"
address.CountryRegion = "United States";
FindOptions findOptions = new FindOptions();
findOptions.ResultMask = FindResultMask.LatLongFlag |
FindResultMask.AddressFlag;
findOptions.SearchContext = 244; // 244=US
FindAddressSpecification findAddressSpecification = new
FindAddressSpecification();
findAddressSpecification.InputAddress = address;
findAddressSpecification.DataSourceName = "MapPoint.NA";
findAddressSpecification.Options = findOptions;
// Let's look it up
FindResults findResults = null;
try
{
findResults = findService.FindAddress(findAddressSpecification);
}
findResults.NumberFound is 2
address {net.mappoint.staging.Address} net.mappoint.staging.Address
AddressLine "157 MAIN STREET" string
addressLineField "157 MAIN STREET" string
CountryRegion "United States" string
countryRegionField "United States" string
FormattedAddress null string
formattedAddressField null string
PostalCode "06512" string
postalCodeField "06512" string
PrimaryCity "EAST HAVEN" string
primaryCityField "EAST HAVEN" string
SecondaryCity null string
secondaryCityField null string
Subdivision "CT" string
subdivisionField "CT" string
Post by Derek Chan
Jakob,
How are you breaking up your queries into parameters for FindAddress? I had
no problem getting 1 result using the following parameters for both your
Street: 157 Main Street
City: East Haven
State: CT
PostalCode: 06512
Country: United States
Datasource: NA
On another note, there's no real way to find out how the maps.live.com
searching algorithm works as this is something internal to Microsoft. It
doesn't even match the Virtual Earth VEMap.Find call. From what I can tell
it calls a handler that has it's own searching logic depending on the
ambiguous querystrings that are passed to it.
Hope that helps,
--
Infusion Development
http://www.infusion.com
Jakob
2008-11-03 19:40:01 UTC
Permalink
Derek,

Again, thanks for your help.

The results I get back are the same if I omit
findOptions.SearchContext = 244; // 244=US

The exact latitude/longitude pairs that are returned are shown in original
question as well as the addresses returned.

It's almost like the webservice returns several results for the same address
for example because the webservice itself receives inconsistent geodata from
"several providers of geodata" or something like that. Or perhaps I am doing
something wrong, I just don't see what it is.

Thanks again & have a good one,
Jakob
Derek Chan
2008-11-03 22:44:03 UTC
Permalink
Can you try switching to the production WSDL and see if that returns only 1
result?

Regards,
--
Infusion Development
http://www.infusion.com
Post by Jakob
Derek,
Again, thanks for your help.
The results I get back are the same if I omit
findOptions.SearchContext = 244; // 244=US
The exact latitude/longitude pairs that are returned are shown in original
question as well as the addresses returned.
It's almost like the webservice returns several results for the same address
for example because the webservice itself receives inconsistent geodata from
"several providers of geodata" or something like that. Or perhaps I am doing
something wrong, I just don't see what it is.
Thanks again & have a good one,
Jakob
Jakob
2008-11-03 23:04:01 UTC
Permalink
I'd love to, but I don't have a production account.

Currrently evaluating and only have a development account for this purpose,
so I don't know what the production webservice would return - I suppose it
may return a single record in which case all would be fine. It's not really a
"huge problem" at this stage in the evaluation I suppose - just an irritating
little obstacle that makes me uneasy about the geocoding quality/robustness.

That being said, I have come to realize that geocoding an address seems to
be a fuzzy (and often interpolated) affair and it is difficult for me to
point to "the best geocoder in town". I should probably do some intro
research in the "art of geocoding" first.

Loading...