Learner
03-08-2006, 12:50 AM
Hi there,
Is it possible to calculate latitude and longitude with the help of address. Say you've street address, city, country, post code etc. and you've to calculate the longitude and latitude. Please guide and oblige!
Regards
Wilfried
03-08-2006, 12:15 PM
Hi,
Yes this is good possible. Because each address has a collection of Location objects, however you need a thrick. The CalcPos routine will you find somewhere on this forum (try search on CalcPos). Original in VB fro m Gilles, but various C# copies are posted too. This will start you:
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) {
double lat;
double lon;
Pushpin PP = mp.ActiveMap.AddPushpin(loc, "");
PP.GoTo();
MPTools.CalcPos(mp.ActiveMap, loc, out lat, out lon);
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by
vBSEO 3.6.1