ESRI shapefiles

From World Wind Wiki

(Redirected from ESRI shapefile)
Jump to: navigation, search

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



Contents

[edit] Adding shapefiles to World Wind

There is a GUI available (in the "Plug-Ins" menu) to use in loading a shapefile, but the default values in the xml it generates are very basic and may or may not work for any particular file.


The more flexible way is the manual method described below:

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.

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: relative (starting at the ShapeFile directory) or absolute (starting with a disk letter)
    • 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

Only a few 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.

[edit] Examples

[edit] Suggestions

Everything that can be specified in the xml file has a sensible default. Thus, I don't think that the xml fille should be required. Or, rather, it's possible that J. Random Shapefile could be downloaded off the 'net, and the downloader could create a default xml file. RussNelson 23:14, 16 Feb 2006 (GMT)

[edit] External Link

Personal tools