Community of MapPoint and Virtual Earth Users and Developers
This is a discussion on Geocoordinates from a waypoint within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi all, how to get the geocoordinates from a given waypoint? TIA Chris Werner...
| |||||||
| Today's Posts | Twitter Feed | Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
|
Hi Chris, A Waypoint object has a Location property. To get the coordinaes from a Location object you need to do reverse geocoding. There is an exellent article on this site that you can use. Try a search on CalcPos.
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
|
Hi Chris, Glad it works for you. Tell me, what is PowerScript ?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| PowerScript
Hi Wilfried, PowerScript is a programming language used in the development environment PowerBuilder from Sybase (http://www.sybase.com/products/devel...n/powerbuilder). Rather than talking much about it let me show my PowerScipt implementation of CalcPos: Code: public function integer uf_get_latlong4wp (oleobject aole_wp, ref decimal adc_lat, ref decimal adc_long);
// ======================================================================================
//
// adoptet from:
//
// http://www.mp2kmag.com/mappoint/discussion/viewtopic.asp?t=3291&highlight=calcpos
//
// ======================================================================================
integer li_ret
dec{10} ldc_dist, ldc_len
string ls_err
oleObject lole_loc
li_ret = c_map_ok
if li_ret = c_map_ok then
if isNull(this.idc_halfEarth) then
this.iole_northPole = this.iole_objt.getLocation( 90, 0, 1)
this.iole_southPole = this.iole_objt.getLocation(-90, 0, 1)
this.iole_santaCruz = this.iole_objt.getLocation( 0, -90, 1)
this.idc_halfEarth = this.iole_objt.distance(this.iole_northPole, this.iole_southPole);
this.idc_quarterEarth = this.idc_halfEarth / 2
end if
end if
if li_ret = c_map_ok then
lole_loc = aole_wp.location
adc_lat = 90.0 - 180.0 * this.iole_objt.distance(this.iole_northPole, lole_loc) / this.idc_halfEarth
ldc_dist = this.iole_objt.distance(this.iole_objt.getLocation(adc_lat, 0, 1), lole_loc)
ldc_len = (adc_lat / 180) * pi(1)
adc_long = 180.0 * acos((cos((ldc_dist * 2 * pi(1)) / (2 * this.idc_halfearth)) - sin(ldc_len) * sin(ldc_len)) / (cos(ldc_len) * cos(ldc_len))) / pi(1)
end if
return li_ret
Kind regards Chris Werner |
| |||
| Sounds well known
Hi Eric, learning Pascal after a home computer Basic dialect sounds well known to me, I went the same way. Once upon a time ... It was Turbo Pascal and I also wonder what this boys from Borland want to do today or tomorrow. Printing money? Later when I went to my first job in the industrie I thought "Oh yes, now they want me to code in C" - but what an astonishment - it was a BASIC job! It cost me some effort to hide my surprise. As said: Once upon a time. No, PowerScript is'nt Pascal but a similar language and the tool PowerBuilder is similar to Delphi: object oriented language, GUI builder and the "DataWindow" - a very powerfull approach to access relational databases. Actually Sybase adds web development capabilities and .NET compatibility. Unfortunately PowerBuilder is'nt very common in Europe but this is rather because of lack of marketing than lack of features. A bit more off topic Nice day! Chris |
![]() |
| Tags |
| geocoordinates, waypoint |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Zoom to Waypoint | BobIDEAS | MapPoint 2006/2009 Discussion | 3 | 09-08-2004 01:41 PM |
| Specifying stop time of new waypoint | stephenmillington | MapPoint 2006/2009 Discussion | 0 | 06-09-2004 09:08 AM |
| address from waypoint | starbuck | MapPoint 2006/2009 Discussion | 7 | 11-18-2003 08:04 AM |
| Put a waypoint! | Anonymous | MapPoint 2006/2009 Discussion | 1 | 11-14-2003 09:44 AM |
| Route Waypoint Name | Vic | MapPoint 2006/2009 Discussion | 1 | 10-03-2002 03:00 PM |
Dalaman Holiday
Enjoy a wonderfully peaceful Dalaman holiday... Book through UlookUbook and save!