MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




Problem with parsing countries

This is a discussion on Problem with parsing countries within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi, I am using MapPoint with C# in a school project. I am trying to do what seems to be ...


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
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Problem with parsing countries

Hi,

I am using MapPoint with C# in a school project. I am trying to do what seems to be a fairly simple task; retreiving addresses from a database and drawing them as pins on a MapPoint control.

I first tried using the FindAddressResults method by supplying Street, City, Postalcode and Country. What happened was that all locations were drawn in Sweden.
Then I tried creating a StreetAddress object with the same values as above. From that object I used the Country property to get a GeoCountry value to use in the FindAddressResults method. The same thing happened; the GeoCountry object was always geoCountryDefault (which is Sweden in my case), so the search results all turned out the same.

So how do I parse the country strings properly? Any answers are much appreciated.
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,

Try this one (if this is what you wants, witch I think):
Code:
            FindResults Results = MP.ActiveMap.FindAddressResults(street, city, othercity, region, zip, country);
            if (Results.ResultsQuality == GeoFindResultsQuality.geoFirstResultGood) {
                object o = 1;
                Location Loc = (Location)Results.get_Item(ref o);
                Pushpin PP = MP.ActiveMap.AddPushpin(Loc, "");
                PP.GoTo();
            }
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-09-2005
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
Thanks Wilfried, but that didn't work. When using that, I got no locations at all, since there were no good results, since the country always got parsed wrong. If I supply a correct street, city and postal code for a German location, but the country is Sweden, the address result is of poor quality.

The thing is, if I use a code that looks like this:
Code:
FindResults Results = MP.ActiveMap.FindAddressResults("A street", "A city", "Other city", "Region", "Postal code", "Germany");
(assume that all attributes point to an existing address)

I want the result to be the same as in:
Code:
FindResults Results = MP.ActiveMap.FindAddressResults("A street", "A city", "Other city", "Region", "Postal code", GeoCountry.geoCountryGermany);
Note that the country is the only different thing in the two examples. However, the method doesn't understand that "Germany" as a string object is the same thing as GeoCountry.geoCountryGermany.
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,

Quote:
Originally Posted by Anonymous
If I supply a correct street, city and postal code for a German location, but the country is Sweden, the address result is of poor quality.
I dont understeand wy you want to give an adress in the one country while specifying another country ? If I give my streetaddress which is in Belgium and I specify eg Germany I dont think I get good results eather. If I misunderstood then please reprase your question.

Quote:
Originally Posted by Anonymous
FindResults Results = MP.ActiveMap.FindAddressResults("A street", "A city", "Other city", "Region", "Postal code", "Germany");
This will not compile since the country is not of type string but a type GeoCountry.
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
Quote:
Originally Posted by Wilfried
Quote:
Originally Posted by SwedishStudent
FindResults Results = MP.ActiveMap.FindAddressResults("A street", "A city", "Other city", "Region", "Postal code", "Germany");
This will not compile since the country is not of type string but a type GeoCountry.
Ok, so there is no way to automatically parse country names as strings into FindAddressResults? That makes it kind of difficult, since I have a rather long list of addresses which I need to find on a map.

The only thing that comes to mind is manually comparing the country strings with the GeoCountry values. This is weird, since I've heard from other sources that the FindAddressResults method actually can parse strings where the country value is supposed to be.
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,

there is a method that accept complete address strings (check one of my postings of today) but I forgot witch one

But you can do easey fast case statement to check GE, SW etc to the geoCountry value. I dont think this can be of any problem.
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
countries, parsing, problem


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
Which countries are supported? Rick MapPoint Web Service and Virtual Earth 0 04-17-2006 11:56 AM
Work with data of Baltic countries, Balcan countries, Greece Abilio Serafim MapPoint 2006/2009 Discussion 0 06-17-2005 11:20 AM
Not supported countries marco66 MapPoint 2006/2009 Discussion 0 03-19-2005 08:22 AM
Gray other countries dynek MapPoint 2006/2009 Discussion 5 01-11-2005 08:48 AM
delete countries Anonymous MapPoint 2006/2009 Discussion 1 11-19-2002 10:59 AM


All times are GMT -5. The time now is 02:14 AM.


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

Madeira Holiday
Why not book a Madeira holiday through UlookUbook and enjoy this warm Portuguese island at a bargain price!



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