![]() |
|
|||||||
| Add-ons & Scripts Find add-ons, scripts, and utilities for World Wind. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Oct 2004
Location: Austria
Posts: 342
![]() |
Hello,
there was often an request for a movie and a download script. Thanks to the JavaScript Counter using setTimeout, I written a script with Javascript. For writing a movie with individual spots or download them, look at the script at post #5. You can even import your GPX data but only moving to this spots, not showing a track. Please find below the text file of this script, moviescriptdefined.txt Copy this script in a text file and change the file format of this file to .htm, then start this file. You can also download the file moviescriptprompt.txt from the attachment and change the file format of this file to .htm. Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>Movie and Download with World Wind by input the values</title>
</head>
<body onload="worldwind();">
<div name="fred" id="fred" style="position:absolute;top:0;left:20;"></div><BR>
<script type="text/javascript">
<!--
var startlat = prompt("Insert Start Latitude",""); //Prompt for Input of Start Latitude
var endlat = prompt("Insert End Latitude",""); //Prompt for Input of End Latitude
var startlong = prompt("Insert Start Longitude",""); //Prompt for Input of Start Longitude
var endlong = prompt("Insert End Longitude",""); //Prompt for Input of End Longitude
var delay = prompt("Insert Delay (0 = Movie, 10 seconds; 1 = Download, 30 minutes; all others = seconds)","0");
var vi = prompt("Insert Number of Viewing Level (B, 0-6) or Altitude (B=Blue Marble, Landsat7 Levels 0=below 740000 m, 6=below 12000 m; all others=Altitude in m)","3");//Prompt for Input of Viewing Level or Altitude
var xdiff = prompt("Insert the distance between spots in north south direction im kilometres","10"); //Prompt for Input of the Distance of the spots
var ydiff = prompt("Insert the approximately distance between spots in east west direction im kilometres","10"); //Prompt for Input of the Distance of the spots
x1 = parseFloat(startlat);
x2 = parseFloat(endlat);
y1 = parseFloat(startlong);
y2 = parseFloat(endlong);
switch(delay) { //Parse the Delay
case "0":
var delaytime=10000;
break;
case "1":
var delaytime=1800000;
break;
default:
var delaytime=parseInt(delay)*1000;
break;
} //End of parsing
switch(vi) { //Parse the View
case "B":
var view=14.36291495;
break;
case "0":
var view=13.39;
break;
case "1":
var view=6.76;
break;
case "2":
var view=3.28;
break;
case "3":
var view=1.71;
break;
case "4":
var view=0.84;
break;
case "5":
var view=0.41;
break;
case "6":
var view=0.21;
break;
default:
var view=parseInt(vi)/55699;
break;
} //End of parsing
xdifference=parseFloat(xdiff)/60;
ydifference=parseFloat(ydiff)/60;
x3=x1;
y3=y1;
xyn=0;
i=0;
j=0;
if (y1<y2) { //Change the Start Longitude if the End Longitude >Start Longitude
y1=y2;
y2=y3;
y3=y1;
}//
do{ //count how many spots will be used
do
{ y1=y1-ydifference;
xyn=xyn+1
if(y1==y2)break;
}while (y1 > y2 )
x1=x1+xdifference;
y1=y3
if(x1==x2)break;
}while (x1 < x2 ) //end of counting the soots
document.write(xyn); // Number of different URL, this line could be removed, URL means a spot in World Wind
differenturl=new Array(xyn); //write an array with data of the spots
for (var i=0; i<differenturl.length; i++)
differenturl[i]=0;
y1=y3;
x1=x3;
document.write('<table><TR><TH CLASS="js">Latitude<\/TH><TH CLASS="js">Longitude<\/TH><TH CLASS="js">Link<\/TH><\/TR>'); //This line could be removed
do {
do {
var url="worldwind://goto/world=Earth&lat=" + x1 +"&lon="+ y1 +"&view="+view;
document.write('<TR><Td CLASS="js">'+x1+'<\/Td>'); //These 3 lines could be removed, there are only for information about the different URl
document.write('<Td CLASS="js">'+y1+'<\/Td>'); //
document.write('<Td CLASS="js">'+"<a href='"+url+"'>"+url+"<\/a>"+'<\/Td><\/TR>'); //
differenturl[j]=url;
j=j+1;
y1=y1-ydifference;
}while (y1 > y2 )
x1=x1+xdifference;
y1=y3
}while (x1 < x2 )
document.write('<\/table>'); //This line could be removed, end of writing the array
i=-1;
function worldwind(){ // show the current spot and start or move World Wind to this spot
i++;
changelayer_content(i);
if (i<differenturl.length){
Id = window.setTimeout("worldwind()",delaytime);
location=differenturl[i];
}
else{
window.stop();
}
} //end of current spot
function changelayer_content(counter){ //function to write the current spot
msgstring="<a href='"+differenturl[counter]+"'>"+differenturl[counter]+"<\/a>"+"<br>";
if(document.layers){
//thisbrowser="NN4";
fredlayer = document.layers[0];
fredlayer.document.open();
fredlayer.document.write(msgstring);
fredlayer.document.close();
}
if(document.all){
//thisbrowser="ie"
fredlayer = document.all["fred"];
fredlayer.innerHTML=msgstring;
}
if(!document.all && document.getElementById){
//thisbrowser="NN6";
fredlayer = document.getElementById("fred");
fredlayer.innerHTML =msgstring;
}
}// end of function
// -->
</script>
</body>
</html>
You will get different windows to input your parameters, first "Start Latitude", then "End Latitude", then "Start Longitude" and "End Longitude". You will also be asked for the Delay for the moving between different spots and the altitude of World Wind, higher level will be loaded automaticlly. Also you can input the difference in kilometres between the different spots. The script shoud be useable also for view or downloading USGS, I don't know whether the view parameter is fine for this. I hope that I helped and that I not confused everybody. canosso [attachmentid=247] (=Script where you will be asked to insert the variables in a window) [attachmentid=248] (=Script for individual spots) [attachmentid=249] (=Script where you input your data in the script)
__________________
My Plug-ins for World Wind |
|
|
|
|
|
#2 | |
|
Junior Member
Join Date: Oct 2004
Location: Netherlands
Posts: 12
![]() |
Quote:
I've changed the lat. and lon. for my country (Holland) and also after each "scan" the level. While it scans I shut off the placenames, borders, lat. and lon. position and the lat. and lon. lines, then it goes at it fastest way to download the tiles. Thanks again! Robert |
|
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Oct 2004
Location: Austria
Posts: 342
![]() |
Hello Robert,
Quote:
canosso
__________________
My Plug-ins for World Wind |
|
|
|
|
|
|
#4 | |
|
Junior Member
Join Date: Oct 2004
Location: Netherlands
Posts: 12
![]() |
Quote:
With the highest level I set the difference to 0.1 degree and the delay to 30 to 60 seconds to let the program download all the tiles of the different levels. Thank you. Robert |
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Oct 2004
Location: Austria
Posts: 342
![]() |
Hello,
it's me again, now I changed the script that predefined spots could be used, e.g. GPX Data. Sorry this script is not showing a line of the different spots, only visiting the spots. For import of GPX Data, use GPS Visualizer Converter and convert the file into text. This text import in a spreadsheet, transform the Latitude and Longitude, so you will have them in one row, copy each row in a word processor as raw text, replace the TABs with comma and copy this line in the script below. Code:
<HTML>
<head>
<title>Movie and Download with World Wind with individual spots</title>
</head><BODY onLoad="worldwind();">
<div name="fred" id="fred" style="position:absolute;top:0;left:20;"></div><BR>
<script type="text/javascript">
<!--
var fredlayer;
delaytime=10000; //This is the waiting time between the change of the different spots. For movie 10000 milliseconds (=10 seconds) are fine, if you reduce the timeout the placename will not be shown テつ*For download 1800000 milliseconds should be used , these are 30 minutes. If you want to use an array of delaytime, delete this line
levelB=14.36291495; //only Blue Marble, ~ 800000 metres
level0=13.39; //lower than 740000 metres
level1=6.76; //lower than 384000 metres
level2=3.28; //lower than 192000 metres
level3=1.71; //lower than 96000 metres
level4=0.84; //lower than 48000 metres
level5=0.41; //lower than 24000 metres
level6=0.21; //lower than 12000 metres
view=level3; テつ*//change here only the number of the level starting from 0 to 6 to the highest level you want to see. 6 is the highest resolution, lower level tiles will be loaded automaticly. If you want to use an array of Altitude, delete this line
xyn=; // Insert here the number of the different spots
i=0;
j=0;
document.write(xyn); // Number of different URL, this line could be removed, URL means a spot in World Wind
differenturl=new Array(xyn); テつ*//write an array with data of the spots
for (var i=0; i<differenturl.length; i++)
differenturl[i]=0;
var xcords=new Array();//Insert the latitude of the different spots, seperated by comma. Please use decimal point
var ycords=new Array();//Insert the longitude of the different spots, seperated by comma. Please use decimal point
//var delaytime=new Array();// If you want to move at different time or you have GPS time data, you can define an array of テつ*delaytime, remove the two slashes
//var view=new Array();// If you want to view at different Altitude, you can define an array of Altitude, remove the two slashes
document.write('<table><TR><TH CLASS="js">Latitude<\/TH><TH CLASS="js">Longitude<\/TH><TH CLASS="js">Link<\/TH><\/TR>');
i=0;
do{
テつ* テつ*var url="worldwind://goto/world=Earth&lat=" + xcords[i] +"&lon="+ ycords[i] +"&view="+view;////If you made an array of Altitude, please replace view with view[i]
テつ*document.write('<TR><Td CLASS="js">'+ycords[i]+'<\/Td>'); テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* //These 3 lines テつ*could be removed, there are only for information about the different spots
テつ* テつ*document.write('<Td CLASS="js">'+xcords[i]+'<\/Td>'); テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ* テつ*// テつ*
テつ*document.write('<Td CLASS="js">'+"<a href='"+url+"'>"+url+"</a>"+'<\/Td><\/TR>'); //
テつ*differenturl[i]=url;
テつ* テつ* テつ* テつ*i++;
}while (i<differenturl.length);
document.write('<\/table>'); //This line could be removed, end of writing the array
i=-1;
function worldwind(){ // show the current spot and start or move World Wind to this spot
i++;
changelayer_content(i);
if (i<differenturl.length){
テつ* Id = window.setTimeout("worldwind()",delaytime);//If you made an array of delaytime, please replace delaytime with delaytime[i]
テつ* location=differenturl[i];
テつ*}
else{
テつ*window.stop();
}
} //end of current spot
function changelayer_content(counter){ //function to write the current spot
msgstring="<a href='"+differenturl[counter]+"'>"+differenturl[counter]+"</a>"+"<br>";
if(document.layers){
//thisbrowser="NN4";
テつ* fredlayer = document.layers[0];
テつ* fredlayer.document.open();
テつ* fredlayer.document.write(msgstring);
テつ* fredlayer.document.close();
テつ* テつ* テつ* テつ*}
if(document.all){
テつ* //thisbrowser="ie"
テつ* fredlayer = document.all["fred"];
テつ* fredlayer.innerHTML=msgstring;
テつ* テつ* テつ* テつ*}
if(!document.all && document.getElementById){
テつ* //thisbrowser="NN6";
テつ* fredlayer = document.getElementById("fred");
テつ*fredlayer.innerHTML =msgstring;
テつ*}
}// end of function
// -->
</script>
</body>
</html>
canosso [attachmentid=248] (=Script for individual spots)
__________________
My Plug-ins for World Wind |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jan 2005
Posts: 1
![]() |
Can someone teach me how to actually make that work for ROmania?
Show me each step i need to take. Thank you in advance. Ciprian |
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Oct 2004
Location: Austria
Posts: 342
![]() |
Hello Ciprian,
Quote:
canosso
__________________
My Plug-ins for World Wind |
|
|
|
|
|
|
#8 | |
|
OnEarth admin
Join Date: Sep 2004
Posts: 183
![]() |
90% or more of that time is the conversion that WW does on your machine, from JPEG
to textures. If you just want an image, use the server OnEarth.jpl.nasa.gov directly. Lucian Quote:
__________________
Any views or opinions presented here are solely those of the author and do not necessarily represent those of Caltech, JPL or NASA. I am not a NASA employee. |
|
|
|
|
|
|
#9 |
|
Guest
Posts: n/a
|
How do you get it to run? I put the the lat, long, and changed the view to 6. I saved it as a html file on my desktop and double clicked in it and nothing happned. I also had world wind opened and tried it, and nothing happned.
Also, if I understand how this works, I can put in a lat & long block and it will download everything in that block with all view levels (I selected 6) and save it in the cashe folder? |
|
|
|
#10 | |
|
Senior Member
Join Date: Oct 2004
Location: Austria
Posts: 342
![]() |
Hello Guest,
Quote:
Yes, it will download the whole block with all levels. canosso
__________________
My Plug-ins for World Wind |
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Movie and Download Script for World Wind 1.3 | canosso | Add-ons & Scripts | 9 | 04-23-2005 03:35 PM |