Community of VE/MapPoint Users and Developers
This is a discussion on How to get the Best Matched Address from FindAddressResults. within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I am using the method FindAddressResults of MapPoint object to find some address results in a map file. When ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| How to get the Best Matched Address from FindAddressResults. I am using the method FindAddressResults of MapPoint object to find some address results in a map file. When I use the same, it returns me some abiguous results. I would like to get the best matched one out of the ambiguous results. I am not sure how to get the best matched location from the results object. Any pointer / information is much appreciated.
__________________ Thanks & Regards, Vijay |
| |||
|
Hi, I dont know if this is what you looking for but the collection returned from FindAddressResults has a property named ResultsQuality. It can have following values: Code: public enum GeoFindResultsQuality
{
geoAllResultsValid = 0,
geoFirstResultGood = 1,
geoAmbiguousResults = 2,
geoNoGoodResult = 3,
geoNoResults = 4,
}
Code: foreach (object o in Results) {
Location Loc = o as Location;
if (Loc != null) {
//here you go
}
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
I would like to be more specific. 1> I get the matched addresses using findaddressresults method 2> This returns me the Results object having the ambiguous results. Among these results I would like to get the closest match to my address. Suppose if I pass FindAddressResults("","New York", "", "NY", "", "US"); I must get the location which is center of New York. I hope I am clear. Vijay |
| |||
|
Hi Vijay, Quote:
Anyway I just tryed that first with only a ZIP code, and then with only a city name, and it returns exact the center of the city as you wanted
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Thanks a lot. Any idea how to convert given address string into a location object with out using the find, findresults , findaddressresults mehtods. Actually, I have an address string, I would like to get the all pushpins with in specified radius from this location. Vijay |
| |||
|
Hi Vijay, Maybe is FindPlaceResults the method you wnat ? It accepts a string like: "Washington, D.C." but I never tryed it. To find opjects near by you can try the FindNearBy method.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Code: oResults=oMap.FindAddressResults(@street,@city,"" ,@state, @zip, @country);
string resQuality=oResults.ResultsQuality.ToString();
if( resQuality== "geoFirstResultGood" || resQuality=="geoAmbiguousResults")
{
foreach (object o in oResults)
{
MapPoint.Location oLoc =o as MapPoint.Location;
if(oLoc!=null)
{
// oDataset is mappoint Dataset holding the Counsellors. oRs=oDataSet.QueryCircle(oLoc, radius);
if(oRs!=null)
{
oRs.MoveFirst();
while(!oRs.EOF )
{
oPin=oRs.Pushpin;
if(oPin !=null)
counselCount=counselCount+1;
oRs.MoveNext();
}
}
//break;
}
}
return counselCount;
When i try to use my MapPoint application, chose the New York city and if I use the MapPoint Application on my system it gives me nearly 22 counsellors(Puspin) in 50 miles of radius, But when I execute the above program, it gives me just 5 Counsellors(Puspin). I am not able to understand where am going wrong. |
| |||
|
Hi, ResultsQuality can also be: geoAllResultsValid. I suggest you do not use a string to compare (it is also slower) but like this: Code: if (Results.ResultsQuality <= GeoFindResultsQuality.geoAmbiguousResults) {
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| address, findaddressresults, matched |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FindAddressResults returns nothing | Anonymous | MapPoint 2006/2009 Discussion | 5 | 12-07-2004 05:23 AM |
| Problem with FindAddressResults | Anonymous | MapPoint 2006/2009 Discussion | 1 | 10-01-2004 10:04 AM |
| FindAddressResults not always working? | Anonymous | MapPoint 2006/2009 Discussion | 1 | 09-10-2003 06:25 AM |
| Exporting an address matched file | bob everett | MapPoint 2006/2009 Discussion | 0 | 06-27-2003 07:30 PM |
| Need help about the FindAddressResults | Anonymous | MapPoint 2006/2009 Discussion | 3 | 08-21-2002 08:51 PM |