|10-29-2005, 10:02 PM||#1|
Join Date: Oct 2004
I made a Plug-in where you can easy add and edit placenames for World Wind. The Plug-in works only for World Wind 1.3.2 and higher, it's called PlaceNameMaker. Please download the placenamemaker.zip, from below and unzip it into your World Wind directory.
The code for writing and reading the placename files is taken from the World Wind Source.
Never use the PlaceNameMaker with the Place Finder of World Wind at same time. If you change a placename file the Place Finder will be stopped, you can't use it anymore and could not close it. World Wind will not be affected and after reload of World Wind the Place Finder will work correct.
To start it, choose Plugins and load there PlaceNameMaker. Afterwards choose in the Tools menu, the item PlaceName Maker. You are now in the Edit Tab., you can easily add placenames to Place names below, a table where all placenames including the coordinates and information about this place will be shown.
You can edit existing placename files but you make it on your own risk, normally a corrupt file does not affect the other files.
Add a place name simple:
Go to the place where you want to add a placename, load either the form in PlaceName Maker or press in the form the button "Insert the current coordinates" to get the current coordinates. Insert the Place Name. Input Data about this place (=Country, State, State Code, County, Type, Elevation and Population) if wanted, for this point.
Press the Add to Place names button and now the placename Place names. Go to an other place and add this place if you wanted. If you have added all places, select the Save Tab, choose the at Save as ASCII, ANSI or UTF-8 Placename WWP file the Encoding format of the file and save the file. If you want to make only file and not tiled files for the whole world, this option would be the standard, save the file as 0000_0000.wwp. You will need to add information in the ^Placenames.xml or make an extra file and add a ww.wpl or copy this file from a directory with the same file structure.
For adding a ww.wpl in a directory with only the 0000_0000.wwp press the Write a simple PlaceName List File button and save it. To delete the ww.idx file, needed for searching in the placenames, press Select an Index File and delete with right-click Delete.
Excursus about Place Names
At the moment, all place names are only loaded in ASCII which means a restriction to normal Roman letters but not Unicode (=UTF8). I already made an Issue (with the improved files) for this problem. I made an own build with the changed source and could load UTF8 placenames, I am sorry that too much files are involved in this change, so I will not provide any binaries. As showcase I include the file UnicodeCapitals.zip, this will not work only if you changed the source of World Wind and build it for yourself.
The place names are saved in a WWP file in a own directory for the different types. In the directory is a ww.wpl file, this file includes the list of the WWP files in the directory and there geographic limitations.
If this directory was already indexed by the place finder, there is also a ww.idx file. You have to delete this file if you changed any WWP file of this directory otherwise the place finder will not find anything.
As far as I see, placenames could be changed during runtime of WW but only if the Place Finder window isn't open.
Make a Place Names directory
To add new placenames category, you need do make a directory at Data\Earth\Placenames and save there the 0000_0000.wwp file or more WWP files and ww.wpl. Delete, if existing, the ww.idx file in this directory.
Add in the file the ^Placenames.xml before <ExtendedInformation> the code snippet below with the name of the directory and the Name of PlaceName Category. Change the MaximumDisplayAltitude, if wanted After loading World Wind the placenames they will be shown.
<TiledPlacenameSet ShowAtStartup="true"> ﾃつ*<Name> Category </Name> ﾃつ*<DistanceAboveSurface>0</DistanceAboveSurface> ﾃつ*<MinimumDisplayAltitude>0</MinimumDisplayAltitude> ﾃつ*<MaximumDisplayAltitude>200000</MaximumDisplayAltitude> ﾃつ*<PlacenameListFilePath>Data\Earth\Placenames\ Directory \ww.wpl</PlacenameListFilePath> ﾃつ*<DisplayFont> ﾃつ* <Family>Arial</Family> ﾃつ* <Size>8</Size> ﾃつ* <Style> ﾃつ* ﾃつ*<IsBold>true</IsBold> ﾃつ* </Style> ﾃつ*</DisplayFont> ﾃつ*<WinColorName>Pink</WinColorName> </TiledPlacenameSet>
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 form, the 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.
Editing, Searching, Removing and Inserting new points
For Search in the Place names List, input the name at Search for a Place and Search for a Country, the cursor will go to this place in the DataGrid, the table, and World Wind will go to this place. Take care of pressing Enter, the cursor will be at this row and you could delete the content of this placename.
For removing the current Favorite you can use Remove Current Entry, Remove All Entries deletes all entries except the first, this one will be replaced with your input.
For Editing a placename press Edit Current Entry, the form will filled with data of this entry also World Wind will move to this place if the placename has coordinates. You can now edit this data in the form. If you press "Add to Place names ", the placename 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 <U>no</U> at Replace Placename at Insert Position, if you also choose <U>yes</U> at Insert multiple lines you will insert all input until you choose <U>no</U> at this option. You can also simple input a number at "Insert Position" and choose <U>no</U> for the first option and <U>yes</U> for the second and you insert all points at the entry number, you filled in.
Moving the Place names List
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 the Place names list
You can either import a WWP file, GPX waypoint file, a Text/CSV file, a layer file or a GEOnet Name file, the first one for editing, append and so on.
For all imported files, except WWP files, you can add the Country, State, State Code, County and Type information, this information will be added to all imported placenames.
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 a GPX file you can choose if you want to use the type, the desc or the sym Tag as Type for the placename.
For a Text/CSV File you have to change the column headers of this file. Mandatory is Latitude and Longitude and IconName. You can also have a Country, State, Codestate, County, Type, Elevation and Population column.
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 there 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".
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), Designation (=The type name) or WW Types (=this are the type names of the existing US Types).
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.
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 or want to add the State name instead of the number.
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. Press Copy List of PlaceNames to Clipboard and you will have the list of the States.
Now select the State Number, Yes at Load only a State data and add at State the name of this state, you will have the state information added.
The import works only for country files. For the large single compressed file only a Selected PlaceType could be imported, e.g. castle, mountain, this import will take about 5 minutes and will your computer almost down.
This is a Perl script for importing the single compressed file as whole and sorting the places similar to the US features. The file is even to large for Perl therefore it will be loaded first and only the needed information saved in a second file. This second file will be loaded then and tiled like the GEONET_p_ppl, there will be 4 different directories, UnicodeGEONET_p_ppl for places, world_anthropogenic, world_terrain and world_water. Total runtime 3 hours on a AMD XP 64 3200. Total size 257 MB without index files and 55 MB in zip files.
You can use this script also for smaller files, there are options for Encoding, Adding the Country name, if you want the files tiled or in one and you can also choose if you want all in a single directory or choose only one designate to import.
I included the file ^GEOnetAll.xml to geonettoplacenamemaker.zip, this file would load all the directories.
Unicode placenames aren't supported yet.
The single compressed GEOnet file could not be loaded as whole file, only a Selected PlaceType .
My Plug-ins for World Wind
|10-30-2005, 07:10 PM||#3|
Join Date: Sep 2004
Donate to support your community!
Please donate if you can - every donation helps improve World Wind
World Wind Central - FAQs, Hotspots, Wiki and more...READ before posting!
Need to upload files? Use my free 50Mb uploader!
Or, how about some web hosting or web design?
|Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)|
|Thread||Thread Starter||Forum||Replies||Last Post|
|xml scripts to .sc for movie plug in||Guest||WorldWind General||9||04-21-2006 05:12 PM|
|Help! Connection problems with plug ins.||Misha||Technical Support||5||07-18-2005 12:39 AM|
|need this plug in||Guest_milocs_*||Add-ons & Scripts||2||06-05-2005 08:33 AM|
|Plugin Scripting in HEAD and Scripting Tutorial||adamhill||Developers' Corner||9||06-02-2005 10:49 PM|
|World Wind gets a plug in "Science"||PhilBock||WorldWind General||1||05-16-2005 02:11 AM|