MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Need C# example - address to lat/long

This is a discussion on Need C# example - address to lat/long within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Does anyone have any C# code snippet that will show me how to convert an address in MapPoint to latitude ...


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

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



Click here to register

Reply

 

LinkBack (5) Thread Tools Display Modes
  5 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-27-2007
Junior Member
Yellow Belt
 
Join Date: Mar 2005
Posts: 17
Need C# example - address to lat/long

Does anyone have any C# code snippet that will show me how to convert an address in MapPoint to latitude and longitude coordinates?

Is this activity even possible?

Thanks in advance to all of you smart people...
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 03-28-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Re: Need C# example - address to lat/long

Hi,

Voila:

Code:
FindResults results = MP.ActiveMap.FindAddressResults(street, city, othercity, region, zip, country);

if (results.ResultsQuality <= GeoFindResultsQuality.geoAmbiguousResults)
    foreach (object o in results) {
        Location loc = o as Location;
        if (loc != null) {
            Console.WriteLine(loc.Latitude + " " + loc.Longitude);
            break;
        }
    }
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 03-28-2007
Junior Member
Yellow Belt
 
Join Date: Mar 2005
Posts: 17
Re: Need C# example - address to lat/long

I have MapPoint 2004, I get an error saying:

error CS0117: 'MapPoint.Location' does not contain a definition for 'Latitude'

Is this property available in MP 2004?

Thanks
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 03-29-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,112
Re: Need C# example - address to lat/long

Hi,

No sorry this property not available in 2004, but no probleem, try a search on CalcPos on this site from Gilles Kohl. I also have posted it in C#.
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, lat or long


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/need-c-example-address-lat-long-5781.html

Posted By For Type Date
MapPoint Download - MP2K Magazine This thread Refback 04-06-2007 09:42 AM
MapPoint Articles - MP2K Magazine This thread Refback 04-03-2007 02:17 AM
Microsoft MapPoint 2006 - MP2K Magazine This thread Refback 03-31-2007 09:37 PM
Working With Excel and MapPoint - MP2K Magazine This thread Refback 03-29-2007 06:21 AM
The Magazine for MapPoint - MP2K Magazine This thread Refback 03-28-2007 09:21 AM

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
Adding pushpins by lat/long or address using MPC in MSAccess GM MapPoint 2006/2009 Discussion 0 11-01-2004 01:00 PM
Get address of lat/long Anonymous MapPoint 2006/2009 Discussion 1 05-13-2004 11:54 AM
Getting the lat/long from an address Anonymous MapPoint 2006/2009 Discussion 1 03-25-2004 08:22 PM
Lat. and Long. Anonymous MapPoint 2006/2009 Discussion 1 02-06-2004 03:09 AM
get lat./long. Anonymous MapPoint 2006/2009 Discussion 1 11-19-2002 06:56 AM


All times are GMT -5. The time now is 06:47 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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