World Wind Forums

Go Back   World Wind Forums > Community > Add-ons & Scripts

Add-ons & Scripts Find add-ons, scripts, and utilities for World Wind.

Reply
 
Thread Tools Display Modes
Old 07-28-2005, 07:12 PM   #1
canosso
Senior Member
 
Join Date: Oct 2004
Location: Austria
Posts: 342
canosso
Default

Hello,
I made a plug-in where you can make, edit, import and save a Layer for World Wind. The script works only for World Wind 1.3.2 and higher, it's called Layer Edit. Please download the layeredit.zip, from below and unzip it into your World Wind directory.

First I have to say, I'm one those evil copy-cats who taken the code of TomServo's Earthquake plugin to make the layer visible. I thank him and ShockFire for the inspiration.
The forms are overloaded but include almost everything to make a Layer.



To start it, choose Plugins and load there LayerEdit. Afterwards choose in the Tool menu, the item Layer Edit. Now will see a form with three tabs: Edit Icons, Icon Description, Edit Path List Import from File, Path Maker and Save with a Insert Coordinates Menu. You are now in the Edit Tab., you can easily add points to a script

International users could use their chars, e.g. Chinese, Japanese, Korean, Cyrillic etc., they are not restricted to the standard chars like the placenames do.

Thai chars are at the moment not supported. If you have the layer manager open, the Layer manager will changed as the only viewing window, the other map will be frozen. Clicking on this icon will remove all icons, also of other plugins. You can test it with Krung Thep, Krung Thep Maha Nakhon, Γ*¸Γ*ΒΈΒ£Γ*ΒΈΒΈΓ*¸‑Γ*¹€Γ*ΒΈβ€”Γ *ΒΈΕΎ Γ*ΒΈΒ―, Γ*¸Γ*ΒΈΒ£Γ*ΒΈΒΈΓ*¸‑Γ*¹€Γ*ΒΈβ€”Γ *ΒΈΕΎΓ*ΒΈΒ‘Γ*ΒΈΒ«Γ*ΒΈΒ²Γ*ΒΈβ„’Γ*ΒΈβ€žΓ*Β ΈΒ£, http://en.wikipedia.org/wiki/Bangkok.


Make a Layer simple:
First fill in the Directory Name of the Layer, this is the sub-directory of Add-ons where your layer data (Icons and Paths) will be stored, the script is very aggressively to ask for this input.
You will see in the form the current coordinates with Icon above Surface (= until which altitude the Icon will be still viewable), and the altitude which is only used for editing the Layer. Insert the Name of the Icon, this will be shown later in the Layer Manager. Change if wanted the Icon above Surface.
Input a Description if wanted, you can also press the button Description Form to go to Icon Description, where you have a larger form to fill in the Description.

Press either Pick an Icon or Pick an common Icon to choose the icon for the current Icon Name.
Change if wanted the Icon Width Pixels and Icon Height Pixels, these are the pixels sizes, how large the icon will be shown in World Wind. Change if wanted Show Icon at StartUp to No, so the Icon will not be shown if the Layer is enabled.

Change if wanted the Min Display Altitude and the Max Display Altitude, at the moment this information will not be used for Icons, hopefully in the future. Input if wanted a ClickableUrl, that should be a normal Internet Link (http://, ftp:// etc.) or a World Wind Link (worldwind://).

You can add this data as a first layer icon with "Add to Layer". If the Icon File Path is a path to an existing image, you can choose this at Layer Icons and Child Layers and then change in the World Wind Window. You will see now the Icon, if you choose it you see the name and if you have inserted a ClickableUrl, after double-click your browser will start with the link.

You can move to next point where you want to insert an Icon, press the button "Insert the current coordinates" and add this to the layer. If you have filled in all points you want to have in the layer, choose the "Save" Tab, fill in a Layer name. Change if wanted Show only this Layer to Yes, so only this Layer will be shown, no Image Layer, nothing else. Change if wanted Show this Layer at World Wind Start to Yes, so the Layer will be shown at World Wind Start. Press Pick an Toolbar Icon to choose the Icon for the toolbar, best size of this Icon is 128x128 pixels. Choose if you want to insert Min Display Altitude and the Max Display Altitude for the Icon Layers and if you want to Use the Texture Width/Height parameters, these aren't necessary for newer versions then WW 1.3.2.

Then click the "Save the Layer" button, save the Layer as .xml file in the Config/Earth directory. After restart of World Wind the Toolbar Icon should be visible and if press on it the Layer should be shown.

If you know already the coordinates, you can fill them at Latitude and Longitude and add them, you don't need to move World Wind to them.

Make Child Layers
Child Layers are useful if you want to separate the Icons, e.g. for each sports activity one Child Layer or if you have for a geographic point more information and you want to distinguish them from Icons without loosing your order.
To start a child layer Input a name at Name of a Child Layer , change if wanted Show only this Layer and Show this Layer at Start to Yes, so only this child layer will be shown respectively the child layer will be shown at layer start and press Start Child Layer. Now the child layer is added to Layer Icons and Child Layers: and you see at child the number 1 and the color of this cell changed. To add icons to this child layer input a name and choose an icon and add this to the layer, this rows will have the same number as the child layer and also the color in the first cell.

To close the child layer press Close Child Layer.

Excursus about sorting the Child Layers by World Wind
World Wind sorts the child layers not correct, as far as I see. The child layers will be shown on the bottom of the list after all icons instead according to the layer file, find below the example NewYork.xml which shows the problem, here a diagram of the source structure and the result of World Wind:



Icon options
There a different icon options for choosing an icon. The easiest is Pick an Icon, here the directory which filled in at Directory Name of the Layer will be shown first. If you choose an icon from an other directory, the icon will be saved in your directory. If you press Pick an common Icon, the Data/Icons directory will be shown, you can choose there an icon but this icon will not be moved to your directory of the layer.
If you check Number at Use Icon File Path Input, Number or Name of the Icon as Icon File Path, after input a text at Name of the Icon the Icon Number will be added at Icon File Path. if this image already exists it will be shown in the Icon preview. To make this number icons please use the WWAcid Icon maker by kln. If you want only to insert one number, check at Insert multiple icon numbers to No.
If you check Name of the Icon at Use Icon File Path Input, Number or Name of the Icon as Icon File Path, after input a text at Name of the Icon this text will be added lower case and without blank at Icon File Path. if this image already exists it will be shown in the Icon preview.

With Copy List of Icon File Paths to Clipboard you will get a list of all names of the icon files, so you can either rename or make this files.

Add a Path to a Layer
To add a Path made by PathListArchiver.exe (pathlist.idx and pathlist.pkg) or a WWB file to the layer choose the Tab Edit Path List, input a Name of the Path. Change if wanted the Distance Above Surface, the Min Display Altitude and the Max Display Altitude, the first parameter is for the altitude of the path, the second for the minimum viewing altitude and the third for the maximum viewing altitude.
Change if wanted Show Path at StartUp to No, so the Path will not be shown if the Layer is enabled.
Either Pick a Path Directory for a Path made by PathListArchiver.exe or Pick a .wwb file for a wwb file, select for the first the directory where the pathlist.pkg is and for the second the .wwb file, you want to add to the layer.
Choose a color with Pick a Path Color, if the color has a HTML name it would be named after that otherwise there will the HTML code for the color.
Now press Add to Paths so the information will be stored in the datagrid below. You can also add more paths.

Insert an URI, GPX Data or DMS Coordinates:
Under the Insert Coordinates Menu you'll find 3 items.
1. Insert URI, here you can past an URI in the form, World Wind will go to the coordinates, for this function is the shortcut Crtl+U available.
2. Insert a GPX Track Point, here you can past a GPX Trackpoint in the form, World Wind will go to the coordinates, for this function is the shortcut Crtl+G available.
2. Insert DMS Coordinates, here you can past DMS coordinates in the formthe coordinates should be formatted XX°XX'XX" XX°XX'XX", e.g. 37°49'35" 122°25'18" with the orientation char before or after the coordinates,World Wind will go to the coordinates, for this function is the shortcut Crtl+D available.

These are all input options.

Path Maker
This tab is not needed for making a layer but you can use it if you only want to make a path of different points instead of moving with mouse like the World Wind PathMaker (Press P). To input, either input the coordinates or press the button Insert the current coordinates and Add to Path Points, so this input will added to Path Points. If you finished your path, save with Save the Path.
You can also Import GPX Track File or Import wwb File, they both import the coordinates of this files.

Opening a backup file
The plug-in writes a backup file for each data change. This file is named BackupLayer.xml and will be saved in the sub-directory of the Plugins directory LayerEdit. To load this file, select the Tab Import from File, switch to Yes at Open Backup Layer File and open the Layer file. You will get the file of your last changes.

Editing, Removing and Inserting new points
For removing the current entry "Remove Current Entry", "Remove All Entries" deletes all entries except the first, this one will be replaced with your input.
For Editing an entry press "Edit Current Entry", the form will filled with data of this entry also World Wind will move to this place if the entry has coordinates. You can now edit this data in the form, add messages, remove the heading/tilt, change the delay and so on. If you press "Add to ..", the entry will be replaced with the data of the form, normally.

You see on the right side the Textbox "Insert Position", normally there is no number in the box, only after you press "Edit Current Entry", you see a number, that is the entry number.

You can insert not replace the entry if you choose no at "Replace Entry at Insert Position", if you also choose yes at "Insert multiple lines" you will insert all input until you choose no at this option. You can also simple input a number at "Insert Position" and choose no for the first option and yes for the second and you insert all points at the entry number, you filled in.

Moving the points of the dataGrid
For moving the current entry there are 4 options, the Arrow buttons. First choose the row you want to move and then press the button.

The ^-Button is for moving the entry up. The v-Button is for moving the entry below. The ArrowUp-Button is for moving the entry on top of the list. The ArrowDown-Button is for moving the entry on the bottom of the list.

Import Files to a Layer
You can either import a GPX waypoint file, KML Placename file, Text/CSV file or a layer file, the last one for editing, append and so on.

At Icon for all points you can insert below a name for an Icon, this Icon will be used for all imported data.


Import a GPX waypoint file to a Layer

Change if wanted the Distance Above Surface, the Min Display Altitude and the Max Display Altitude, the first parameter is for the altitude of the path, the second for the minimum viewing altitude and the third for the maximum viewing altitude. Change also if wanted the Icon Width Pixels and Icon Height Pixels, these are the pixels sizes.
Also you can choose, if you want to Append to Layer to the script or not. If no is checked, it has the same function like "Remove All Entries".

For both options you can choose, what kind of icon file path you want, only for GPX waypoints and Text/CSV you can choose also icon file paths of the child layer.

Before you import a GPX waypoint file, choose if you want to Show the Icon for the Waypoint at StartUp and then press "Open a GPX file", open the file and the points will be added to the Layer Icons and Child Layers:.

You have also for the GPX waypoint file the opportunity to make child layers for <desc>, <sym> and <type> Tags of this file. You can choose at Choose if you want to make Child Layers and if yes, how to sort them one of the three bottom options. You can also change if wanted Show only this Layer and Show this Layer at Start to Yes, so only this child layer will be shown respectively the child layer will be shown at layer start. If the tags aren't empty, you will have then child layers for each different tag. With this options you can also use the fourth option at the Icon File Path options, the Icon File Path will be now a lowercase name of the child layer.

Import a Layer file

For a Layer file if you choose no at Use the Min/Max Altitude of the Layer, Use the Texture Width/Height or Use the Icon File Path of the Layer, the Min/Max Altitude, the TextureWidthPixels/TextureHeightPixels or Icon File Path will not be imported, If no at Import the Child Layers of the Layer is checked, all child layer information will be ignored and not imported.

Import a KML Placename file

Change if wanted the Distance Above Surface, the Min Display Altitude and the Max Display Altitude, the first parameter is for the altitude of the path, the second for the minimum viewing altitude and the third for the maximum viewing altitude. Change also if wanted the Icon Width Pixels and Icon Height Pixels, these are the pixels sizes.

Import a Text/CSV File to a Layer

For a Text/CSV File you have to change the column headers of this file. Mandatory is Latitude, Longitude and IconName. You can also have a Description, TextureFilePath, ClickableUrl, Category, DistanceAboveSurface, IconWidthPixels and IconHeightPixels column, the last three if you want to place the icon on a different altitude respectively have varying icon sizes.

Please first choose how the values are separated or better in which format you saved it. The best format to use, is separated by Tabs, you will not have the problems to look in the file how it is separated. Because in countries with comma as decimal separator, the CSV file will be separated by a semicolon. Then choose the Kind of coordinates, Decimal Point or Comma for standard coordinates or DMS for DMS coordinates, e.g. N 47°40'43" E 15°43'52". You can change if you want to Show the Icon for the Waypoint at StartUp.

You can also make child Layers if you have a column Category. Please check Sort by "Category". You can also change if wanted Show only this Layer and Show this Layer at Start to <U>yes</U>, so only this child layer will be shown respectively the child layer will be shown at layer start. If the column isn't empty, you will have then child layers for each different category. With this options you can also use the fourth option at the Icon File Path options, the Icon File Path will be now a lowercase name of the child layer.

Import GEOnet Name files

You can download at http://earth-info.nga.mil/gns/html/cntry_files.html, they are name of places including information about the type of place.

You can decide which kind of Placename you want to import, ASCII (=FULL_NAME_ND), Unicode (FULL_NAME), Capital Letters (=SORT_NAME). The Unicode names aren't real Unicode names, there aren't Chinese, Thai etc. chars.

Then you can decide, how the types will be written, Designation Code (=Abbrevations) or Designation (=The type name), this is useful for ChildLayers or if you want to add the Type as Description.

Then you can choose, what kind of places, you want to import. The source designations could be found at ftp://ftp.nga.mil/pub/gns_data/Designations.html, this are sorted in different types. For the information what is included in the different types load below designate.zip or look in the source of the file. You can also select at Selected PlaceType a single Type to import.

You can make ChildLayers for PlaceTypes or Country. The first one if you import country data, the second one if you choose Selected PlaceType and import the single compressed file.

You can also choose if you want to add the Country or all useful information (Country, Type, State and Elevation) as Description.

If you don't want to import the Country Name switch to No at Use Country Name of the file.

The State Number switch is useful if you want to import only one State of the Country.
First you select ADM1 first-order administrative division and choose Selected PlaceType at Kind of Places andat State Number yes. Now you will have the names of the different states with the state number in the State column.
Now select the State Number, Yes at Load only a State data , you will have loaded only one state data.

The import works only for country files, the large single compressed file will not work as whole, only for single types, e.g. castle, mountain etc..

Saving the File
Please fill in a Layer name. Change if wanted Show only this Layer to Yes, so only this Layer will be shown, no Image Layer, nothing else. Change if wanted Show this Layer at World Wind Start to Yes, so the Layer will be shown at World Wind Start. Press Pick an Toolbar Icon to choose the Icon for the toolbar, best size of this Icon is 128x128 pixels. Then click the Save the Layer button, save the Layer as .xml file in the Config/Earth directory. After restart of World Wind the Toolbar Icon should be visible and if press on it the Layer should be shown.

Known Problems

World Wind seems to have a problem if Icons are added to the "virtual" Layer Layer Edit, I had sometimes CPU Usage of 95 % although without this option it has a CPU Usage of 0 %.

Child Layers are not shown at the moment at the "virtual" Layer Layer Edit in the layer manager.

Importing the single compressed GEOnet file, i.e the whole world data, will only work for a Selected PlaceType.

I made also layereditlarge.zip, there is a seperate tab for the Layer Icons and Child Layer.

I hope that I helped you.

canosso
Attached Files
File Type: xml NewYork.xml (4.3 KB, 1102 views)
File Type: zip layeredit.zip (66.9 KB, 4548 views)
File Type: zip layereditlarge.zip (66.9 KB, 885 views)
__________________
My Plug-ins for World Wind
canosso is offline   Reply With Quote
Old 07-28-2005, 07:44 PM   #2
bull
Cosmic Overlord
 
bull's Avatar
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 2,362
bull is an unknown quantity at this point
Default

To qoute Adam w00t!
bull is offline   Reply With Quote
Old 07-28-2005, 07:56 PM   #3
coostal
Junior Member
 
Join Date: Jul 2005
Posts: 1
coostal
Default

that great! I ws exactly looing for that!
may it work with WW 1.3.1, or where can I download WW 1.3.2?
Thanks
coostal is offline   Reply With Quote
Old 07-28-2005, 08:02 PM   #4
bull
Cosmic Overlord
 
bull's Avatar
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 2,362
bull is an unknown quantity at this point
Default

1.3.2 is not officialy released yet, you can use the beta found here - http://forum.worldwindcentral.com/...showtopic=4063
bull is offline   Reply With Quote
Old 07-31-2005, 09:21 PM   #5
Mashiharu
Member
 
Mashiharu's Avatar
 
Join Date: Jan 2005
Location: Trondheim, Norway
Posts: 94
Mashiharu
Default

Amazing!!! Nice work canosso!

BTW: I don't think texture width/height values are in use anymore?
__________________
Bjørn Reppen
Developer on http://punt.sourceforge.net
mashi on #punt (irc.freenode.net)
Home: http://www.mashiharu.com
Mashiharu is offline   Reply With Quote
Old 07-31-2005, 10:54 PM   #6
Beansprout
Cosmic laser
 
Join Date: Sep 2004
Posts: 2,998
Beansprout is an unknown quantity at this point
Default

Wow
Beansprout is offline   Reply With Quote
Old 08-04-2005, 12:29 AM   #7
Guest_bob_*
Guest
 
Posts: n/a
Default

now all we need is a skilled artist out there to map us up a middle earth.. oh wait .. that wasn't round was it..
  Reply With Quote
Old 08-05-2005, 05:53 PM   #8
canosso
Senior Member
 
Join Date: Oct 2004
Location: Austria
Posts: 342
canosso
Default

Hello,
I included now CSV/Text import, for this feature you have to name the column header. Mandatory is Latitude, Longitude and IconName. You can also have a Description, TextureFilePath, ClickableUrl, Category, DistanceAboveSurface, IconWidthPixels and IconHeightPixels column, the last three if you want to place the icon on a different altitude respectively have varying icon sizes.
The script searches automaticly for this headers, you don't need to sort them. You can also make child layers by sorting them by a Category column.

The Icons could be now removed and replaced. After replacement they will be on the bottom in the virtual "Layer Edit"-Layer but in the layer file it will be on the right place.

@Mashiharu:
I know that the new versions don't use TextureWidth/HeightPixels but they are included in WW 1.3, as I seen in the CVS, therefore I included them, backwards compatibility and so .

canosso
__________________
My Plug-ins for World Wind
canosso is offline   Reply With Quote
Old 08-05-2005, 06:05 PM   #9
bull
Cosmic Overlord
 
bull's Avatar
 
Join Date: Oct 2004
Location: United Kingdom
Posts: 2,362
bull is an unknown quantity at this point
Default

great work
bull is offline   Reply With Quote
Old 09-06-2005, 07:55 PM   #10
canosso
Senior Member
 
Join Date: Oct 2004
Location: Austria
Posts: 342
canosso
Default

Hello,
I improved the plugin a little bit and removed minor bugs. The bugs where the wrong saving of the ToolbarIcon if it wasn't in the Directory of the layer. remove the icon in the layer manager if the iconname was changed, was the second bug, they did not have any impact on saving the layer and it's code.

Now there are international chars supported for import not only saving. Except Thai chars, they make the layer manager to the viewing window.

Also the &, ampersand, could be used because they will replaced with HTML code, normally the XML file read them as the begin of a special char and the loading of this file will be stopped due not following code with semi-colon.

canosso
__________________
My Plug-ins for World Wind
canosso 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
Plugin: My favorite Icons - Add Icons/Favorite canosso Add-ons & Scripts 26 03-02-2010 03:06 AM
Layer Priority WWG Add-on & Script Development 3 12-08-2005 01:01 PM
Access to Layer Manager object, from a plugin jp09 Add-on & Script Development 0 10-12-2005 04:13 PM
stereo viewer plugin jumpjack Add-ons & Scripts 15 08-19-2005 09:48 PM
GPX to Track and Layer, Waypoints to Layer canosso Add-ons & Scripts 14 03-05-2005 06:37 PM


All times are GMT +1. The time now is 05:38 PM.


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