Hi all,
how to get the geocoordinates from a given waypoint?
TIA
Chris Werner
This is a discussion on Geocoordinates from a waypoint within the MapPoint Desktop Discussion forums, part of the Map Forums category; Hi all, how to get the geocoordinates from a given waypoint? TIA Chris Werner...
Hi all,
how to get the geocoordinates from a given waypoint?
TIA
Chris Werner
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
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
Hi Wilfried,
thanks for this valuable hint. After translating
the code into PowerScript it works like expected.
Kind regards
Chris Werner
Hi Chris,
Glad it works for you. Tell me, what is PowerScript ?
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
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:
Of course there are some declarations and initializations not shown here.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
Wow, thanks Chris. Is that Pascal? After Commodore Basic I think I only studied Pascal briefly in high school at one point. Pity Borland is selling their flagship product, it is like ToysRUS selling their Toys stores (kept the BabiesRUS stores). A bit off topic sorry
Eric
~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
~~
~ Upgrade to Get Access to the MapForums Downloads ~
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
There are currently 1 users browsing this thread. (0 members and 1 guests)