World Wind Forums

Go Back   World Wind Forums > WorldWind JAVA forums > Development Help

Development Help Help for building applications or diagnosing problems with WWJ

Reply
 
Thread Tools Display Modes
Old 06-17-2010, 10:58 AM   #1
fabio.portieri
Member
 
Join Date: Jan 2010
Posts: 96
fabio.portieri is on a distinguished road
Default Elevation issue

Hello everybody
Maybe you guys can help me out with this weird issue i have, given this code

WWJ.addPositionListener(new PositionListener() {

public void moved(PositionEvent pe) {
double el = WWJ.getModel().getGlobe().getElevation(p e.getPosition().getLatitude(),pe.getPosi tion().getLongitude() );
double ele2= WWJ.getModel().getGlobe().getElevation(A ngle.fromDegrees(45.88042d), Angle.fromDegrees(10.84165d));
System.out.println("elevation at Lat: " + pe.getPosition().getLatitude() + " Lon: " + pe.getPosition().getLongitude() + " : " +el + " WRONG: " + ele2);
}
});



This is some output generated:

elevation at Lat: 46.002016011137144° Lon: 10.558173974898681° : 2104.3139492196487 WRONG: 405.4671896846715
elevation at Lat: 45.990964923360735° Lon: 10.519201307949299° : 2190.7855833296962 WRONG: 405.4671896846715
elevation at Lat: 45.97780489843011° Lon: 10.472872660240789° : 2342.0955212200934 WRONG: 405.4671896846715
elevation at Lat: 45.96000778889752° Lon: 10.410359696036473° : 1597.1700716603236 WRONG: 749.2751061302113
elevation at Lat: 45.937431079709036° Lon: 10.331287777269° : 881.7778770303752 WRONG: 749.2751061302113
elevation at Lat: 45.916030362090304° Lon: 10.25657030832848° : 686.8668823848345 WRONG: 749.2751061302113
elevation at Lat: 45.897776054486016° Lon: 10.193017892435334° : 1375.5935128422832 WRONG: 749.2751061302113
elevation at Lat: 45.88219960175847° Lon: 10.1389184825127° : 1007.9843367775953 WRONG: 749.2751061302113
elevation at Lat: 45.86900235570172° Lon: 10.093175509075232° : 910.3480187271654 WRONG: 749.2751061302113
elevation at Lat: 45.857765361731694° Lon: 10.054294009591095° : 1026.6625299709385 WRONG: 749.2751061302113
elevation at Lat: 45.84820048498196° Lon: 10.021246645001053° : 1191.7927915348555 WRONG: 749.2751061302113
elevation at Lat: 45.84007546141724° Lon: 9.993208899685314° : 1014.4401332140378 WRONG: 749.2751061302113
elevation at Lat: 45.833168518646794° Lon: 9.969399577829616° : 1092.1438170833658 WRONG: 749.2751061302113
elevation at Lat: 45.827234421516216° Lon: 9.958499569074187° : 1102.4015297356057 WRONG: 749.2751061302113
elevation at Lat: 45.82216216880693° Lon: 9.954621100956565° : 1082.4929285436485 WRONG: 749.2751061302113
elevation at Lat: 45.81788699783299° Lon: 9.943795003721412° : 1111.5789090821806 WRONG: 749.2751061302113
elevation at Lat: 45.81424053822204° Lon: 9.93062077922722° : 658.649624195017 WRONG: 401.10952202232556
elevation at Lat: 45.811161040747024° Lon: 9.919500519820165° : 682.9191078152825 WRONG: 401.10952202232556


My question is, why retrieving elevation with:
WWJ.getModel().getGlobe().getElevation(A ngle.fromDegrees(45.88042d), Angle.fromDegrees(10.84165d));

In other words by handcoding the lat and lon, gives me wrong results
In the other end, using positionevent position it works as expected

It just don't make sense to me
Thanks in advance
fabio.portieri is offline   Reply With Quote
Old 06-18-2010, 03:42 PM   #2
dhenkels
Junior Member
 
Join Date: Mar 2010
Posts: 24
dhenkels is on a distinguished road
Default

Maybe you need to use Angle.fromDegreesLatitude() instead of Angle.fromDegrees()? I'm not sure if those give different results though.
dhenkels is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
World Wind RC2 bull Announcements & News 15 12-29-2006 01:14 AM
NASA World Wind 1.3.3.1 Released bull Announcements & News 0 10-31-2005 06:52 PM
World Wind 1.3.3 released Randy Kim Announcements & News 0 10-22-2005 05:37 AM
World Wind 1.3.2 released Beansprout Announcements & News 0 09-07-2005 11:51 PM
1.3.2 beta 1 released Jessi Developers' Corner 11 07-28-2005 06:30 PM


All times are GMT +1. The time now is 12:23 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.