ESRI shapefiles

From World Wind Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 15:05, 27 October 2005 (edit)
72.43.17.50 (Talk)
(Adding some preliminary documentation for shapefiles)
← Previous diff
Revision as of 15:07, 27 October 2005 (edit) (undo)
72.43.17.50 (Talk)
(Adding shapefiles to World Wind)
Next diff →
Line 11: Line 11:
* An XML file appears as its own top level in the Layers menu. * An XML file appears as its own top level in the Layers menu.
-* An XML file lists one or more layers, each of which may be turned on or off.+* An XML file lists one or more layers, each of which may be turned on or off. If you have only one layer, it should be pre-selected (ShowAtStartup="true").
* An XML file may specify that only one layer should be shown at a time (ShowOnlyOneLayer="true") * An XML file may specify that only one layer should be shown at a time (ShowOnlyOneLayer="true")
* An XML file may default to being turned on when WW starts (ShowAtStartup="true") * An XML file may default to being turned on when WW starts (ShowAtStartup="true")

Revision as of 15:07, 27 October 2005

ESRI shapfiles or shapefiles are a common format for storing GIS related information. Basic shapefile support is included with World Wind.

Adding shapefiles to World Wind

Adding shapfiles to World Wind is currently a simple manual process. A user interface will be added in a future version of World Wind.

In your main World Wind folder (eg C:\Program Files\NASA\World Wind 1.3\) there is a folder named ShapeFiles. You must create an xml file for your shapefile in that folder. Your shapefile files go in a folder beneath that.

Complete documention is still being written, however it's a simple process and you can use these sample shapefiles to get an idea of how it works.

Until the documentation is written, here are a few notes on the contents of the XML file:

  • An XML file appears as its own top level in the Layers menu.
  • An XML file lists one or more layers, each of which may be turned on or off. If you have only one layer, it should be pre-selected (ShowAtStartup="true").
  • An XML file may specify that only one layer should be shown at a time (ShowOnlyOneLayer="true")
  • An XML file may default to being turned on when WW starts (ShowAtStartup="true")
  • It can describe multiple layers derived from one or more shapefiles. Each view requires its own ShapeFileDescriptor section containing one or more of the following elements:
 * Name - the name visible to the user in the Layers menu underneath the LayerSet's name.
 * ShapeFilePath - the path, starting at the WW directory, to the shapefile.
 * DataKey - the key of the data in the shapefile's dbf file.
 * NoDataValue - the value to use when an element (point, line, polygon) has no data for that key.
 * ShowLabels - true or false if the data should be shown as a label.
 * PolygonFill - true or false if polygons should be filled.
 * OutlinePolygons - true or false if Polygons should be outlined.
 * PolygonColor - contains three elements: Red, Blue, and Green, integer values between 0 and 255.
 * LineColor - contains three elements: Red, Blue, and Green, integer values between 0 and 255.
 * LabelColor - contains three elements: Red, Blue, and Green, integer values between 0 and 255.
 * LineWidth - contains a floating point number describing the width of the line in pixels.
 * ScaleColorsToData - polygons are filled with a color proportional to the data.
 * ScalarMin and ScalarMax determine which values will be assigned to the lightest and darkest colors.
 *

Examples

External Link

Personal tools