Community of MapPoint and Virtual Earth Users and Developers
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 ...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Problem with parsing countries 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. |
| |||
|
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();
}
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
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");
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);
|
| |||
|
Hi, Quote:
Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Quote:
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. |
| |||
|
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.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
![]() |
| Tags |
| countries, parsing, problem |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| 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 |
Madeira Holiday
Why not book a Madeira holiday through UlookUbook and enjoy this warm Portuguese island at a bargain price!