ESRI shapefiles

From World Wind Wiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 01:51, 1 November 2005 (edit)
140.253.201.41 (Talk)
(Adding shapefiles to World Wind)
← Previous diff
Revision as of 05:54, 1 November 2005 (edit) (undo)
Nosilleg (Talk | contribs)
m (Reverted edit of 140.253.201.41, changed back to last version by 72.43.17.50)
Next diff →
Line 1: Line 1:
'''ESRI shapfiles''' or '''shapefiles''' are a common format for storing GIS related information. Basic shapefile support is included with World Wind. '''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.+==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 <code>C:\Program Files\NASA\World Wind 1.3\</code>) there is a folder named <code>ShapeFiles</code>. You must create an xml file for your shapefile in that folder. Your shapefile files go in a folder beneath that. In your main World Wind folder (eg <code>C:\Program Files\NASA\World Wind 1.3\</code>) there is a folder named <code>ShapeFiles</code>. You must create an xml file for your shapefile in that folder. Your shapefile files go in a folder beneath that.

Revision as of 05:54, 1 November 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. This can be null, but basically this will be the name of attribute that is used to colorize the different shapes in the shapefile. If the attribute is alpha-numeric, a random coloring is used, but if the attribute is for scalar data, then a rainbow color scale is used. If null, the PolygonColor is used on all shapes. Also, color scaling is only used if the <ScaleColorsToData> element is true.
    • ScaleColorsToData - see above.
    • ScalarMin - if scalar data is specified, and the data is lower than this min value, it is 'set' to this min value.
    • ScalarMax - if scalar data is specified, and the data is higher than this max value, it is 'set' to this max value.
    • ScalarFilterMin - if scalar data is specified, and the data is lower than this min value, then the data is not shown.
    • ScalarFilterMax - if scalar data is specified, and the data is higher than this max value, then the data is not shown.
    • NoDataValue - the value to use when an element (point, line, polygon) has no data for that key. This is used to make the renderer ignore shapes with a certain data value, generally referred to as a null value. This can be specified multiple times to allow multiple "null values".
    • ActiveDataValue - basically the opposite of NoDataValue, and this means to ONLY show shapes with data values that are equal to this. This can also be specified multiple time to allow multiple "active values". eg. For hurricane tracks, you can specify only the hurricanes shown by passing in ActiveDataValues for each hurricane name that you want shown.
    • 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.
    • IconFilePath - if point data is used, file path to image to use for the display of an icon
    • IconWidth - width in screen pixels for the icon to be displayed
    • IconHeight - height in screen pixels for the icon to be displayed
    • IconOpacity - value between 0 - 255 to specify icon opacity
    • PolygonFillStyle - Polyons can have different fill patterns, which is specified in here.
      • Solid
      • BackwardDiagonal
      • Cross
      • DarkDownwardDiagonal
      • DarkHorizontal
      • DarkUpwardDiagonal
      • DarkVertical
      • DashedDownwardDiagonal
      • DashedHorizontal
      • DashedUpwardDiagonal
      • DashedVertical
      • DiagonalBrick
      • DiagonalCross
      • Divot
      • DottedDiamond
      • DottedGrid
      • ForwardDiagonal
      • Horizontal
      • LargeCheckerBoard
      • LargeConfetti
      • LargeGrid
      • LightDownwardDiagonal
      • LightHorizontal
      • LightUpwardDiagonal
      • LightVertical
      • Max
      • Min
      • NarrowHorizontal
      • NarrowVertical
      • OutlinedDiamond
      • Percent05
      • Percent10
      • Percent20
      • Percent25
      • Percent30
      • Percent40
      • Percent50
      • Percent60
      • Percent70
      • Percent75
      • Percent80
      • Percent90
      • Plaid
      • Shingle
      • SmallCheckerBoard
      • SmallConfetti
      • SmallGrid
      • SolidDiamond
      • Sphere
      • Trellis
      • Wave
      • Weave
      • WideDownwardDiagonal
      • WideUpwardDiagonal
      • ZigZag

Not all shapefile types are supported. These are: Points, Arcs (aka PolyLine), and Polygons. Multipoints are not. Also, (currently) if a shapefile contains Arcs with zero or one points, WW will not render any arcs out of that file.

Examples

External Link

Personal tools