oApp = CREATEOBJECT("MapPoint.Application") oApp.visible=.t. oMap = oApp.NewMap() oLoc=oMap.Find("11072 Greiner Road, Philadelphia, PA 19116") store 0 to dblLat,dblLon =iGetLatLon(oMap, oLoc.location) ?dblLat,dblLon oLoc = null oMap = null oApp = null Return *---------------------- PROCEDURE iGetLatLon * following Gilles Kohl (gilles@compuserve.com) at * http://www.mp2kmag.com/a13--kohl.extract.lat.lon.mappoint.html PARAMETERS poMap, poLocation LOCAL locNorthPole, locSantaCruz,dblHalfEarth, GCD, Lat_Rad locNorthPole = poMap.GetLocation(90, 0) locSantaCruz = poMap.GetLocation(0, -90) *Compute distance between north and south poles == half earth circumference dblHalfEarth = poMap.Distance(locNorthPole, poMap.GetLocation(-90, 0)) *Quarter of that is the max distance a point may be away from locSantaCruz * and still be in western hemisphere dblQuarterEarth = dblHalfEarth / 2 *Compute latitude from distance to north pole dblLat = 90 - 180 * poMap.Distance(locNorthPole, poLocation) / dblHalfEarth *Compute great circle distance to poLocation from point on Greenwich * meridian and computed Latitude GCD = poMap.Distance(poMap.GetLocation(dblLat, 0), poLocation) * convert latitude to radian Lat_Rad = (dblLat / 180) * PI() * Compute Longitude from great circle distance dblLon = 180 * Acos(( Cos(GCD * PI()/dblHalfEarth) - (Sin(Lat_Rad))^2 ) / (Cos(Lat_Rad))^2 ) / PI() * Correct longitude sign if located in western hemisphere If poMap.Distance(locSantaCruz, poLocation) < dblQuarterEarth dblLon = -dblLon ENDIF return>Hello,