Mappoint, postcode to longitude and latitude

jimbob
01-15-2005, 06:25 PM
Hi,

I have been using mappoint to manage my delivery vans for quite a while. However, I want to have a process before using mappoint which can tell whether the customer is in the delivery area or not. I want to do this on the web using longitude and latitude. I know my depot postition and so just need the customers position. I am based in the UK and the UK postcode data is very hard to come by.

Can mapoint export the longitude and latitude for postcodes? Or can someone tell me where to find this information?

Thanks,

James.

p.s. I don't have a large amount to spend on databases at the moment to a cheap option would be appreciated.

Wilfried
01-16-2005, 02:22 AM
Hi,

Yes, you can use FindAddressResults(street, city, othercity, region, zip, country); forit. It returns Location object. Some (and many) of the arguments may be empty.

+username
01-16-2005, 07:13 AM
Hi,

It seems FindAddressResults(street, city, othercity, region, zip, country)
just matches the address it doesn't give the coordinates.

There is a Location Sensor tool in Mappoint. Is there a way of obtaining the location sensor information?

James

Wilfried
01-16-2005, 08:08 AM
Hi,

Dont know about using the location sensor, but you can easy calc lat/lon from out of Location objects. This is an article for it with code: http://www.mp2kmag.com/articles.asp?ArticleID=13&key=extract.lat.lon. Also there is somewhere a conversion to C# on this forum.

Basicly you have to do something like this:

Results = MP.ActiveMap.FindAddressResults(street, city, othercity, region, zip, country);

foreach (object o in Results) {
Location Loc = o as Location;

if (Loc != null) {
double Lat;
double Lon;
pos.CalcPos(Loc, out Lat, out Lon);
Console.WriteLine(Loc.Name + " " + Lat.ToString() + " " + Lon.ToString());
}

 
Web mp2kmag.com
mapforums.com