MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




How to get the Best Matched Address from FindAddressResults.

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


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-09-2005
Junior Member
White Belt
 
Join Date: Nov 2004
Posts: 6
Send a message via MSN to gvkreddy Send a message via Yahoo to gvkreddy
How to get the Best Matched Address from FindAddressResults.

Hi,

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-09-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
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,
    }
Another possible is that you look for a specific object type in the collection because it can contain different types. For example if you onle need to find the Location objects you can do something like this:
Code:
            foreach (object o in Results) {
                Location Loc = o as Location;

                if (Loc != null) {
                    //here you go
                }
            }
or you can combine the 2 and first check if the ResultsQuality <= geoAmbiguousResults and then loop with the foreach();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 01-10-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 01-10-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
Hi Vijay,

Quote:
Originally Posted by Anonymous
FindAddressResults("","New York", "", "NY", "", "US");

I must get the location which is center of New York.
Note that country is not string but Geocountry type. I dont know about the short form "NY" if mappoint will recognize it, but this is probably not importand.

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 01-10-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 01-10-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 01-10-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
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;
I am using the above code to get the Pushpins from.

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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 01-10-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,177
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) {
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 01-10-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thank you very much..

I will make necessary changes and get back to you.

Vijay
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
address, findaddressresults, matched


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
FindAddressResults returns nothing Anonymous MapPoint 2006/2009 Discussion 5 12-07-2004 04:23 AM
Problem with FindAddressResults Anonymous MapPoint 2006/2009 Discussion 1 10-01-2004 09:04 AM
FindAddressResults not always working? Anonymous MapPoint 2006/2009 Discussion 1 09-10-2003 05:25 AM
Exporting an address matched file bob everett MapPoint 2006/2009 Discussion 0 06-27-2003 06:30 PM
Need help about the FindAddressResults Anonymous MapPoint 2006/2009 Discussion 3 08-21-2002 07:51 PM


All times are GMT -5. The time now is 11:30 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Algarve Holiday
Portuguese all year round sunshine is some of what awaits you if you choose the Algarve holiday option through UlookUbook!



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59