Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 7 of 7

Geocoordinates from a waypoint

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...

  1. #1
    chpw is offline Junior Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    26

    Geocoordinates from a waypoint

    Hi all,

    how to get the geocoordinates from a given waypoint?

    TIA

    Chris Werner

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433
    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.

  3. #3
    chpw is offline Junior Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    26

    Thanks

    Hi Wilfried,

    thanks for this valuable hint. After translating
    the code into PowerScript it works like expected.

    Kind regards

    Chris Werner

  4. #4
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

  5. #5
    chpw is offline Junior Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    26

    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
    Of course there are some declarations and initializations not shown here.

    Kind regards

    Chris Werner

  6. #6
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    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 ~

  7. #7
    chpw is offline Junior Member Yellow Belt
    Join Date
    Dec 2004
    Posts
    26

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Zoom to Waypoint
    By BobIDEAS in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 09-08-2004, 02:41 PM
  2. Specifying stop time of new waypoint
    By stephenmillington in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 06-09-2004, 10:08 AM
  3. address from waypoint
    By starbuck in forum MapPoint Desktop Discussion
    Replies: 7
    Last Post: 11-18-2003, 09:04 AM
  4. Put a waypoint!
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-14-2003, 10:44 AM
  5. Route Waypoint Name
    By Vic in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 10-03-2002, 04:00 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25