NASA World Wind

gov.nasa.worldwind.examples.util
Class OpenStreetMapShapefileLoader

java.lang.Object
  extended by gov.nasa.worldwind.examples.util.OpenStreetMapShapefileLoader

public class OpenStreetMapShapefileLoader
extends Object


Nested Class Summary
protected static class OpenStreetMapShapefileLoader.Label
           
protected static class OpenStreetMapShapefileLoader.OSMShapes
           
protected static class OpenStreetMapShapefileLoader.TextAndShapesLayer
           
 
Constructor Summary
OpenStreetMapShapefileLoader()
           
 
Method Summary
static boolean isOSMPlacesSource(Object source)
          Returns true if the specified Shapefile source is an OpenStreetMap Shapefile containing placemarks, and false otherwise.
static Layer makeLayerFromOSMPlacesShapefile(gov.nasa.worldwind.formats.shapefile.Shapefile shp)
          Creates a Layer from an OpenStreetMap Shapefile of placemarks.
static Layer makeLayerFromOSMPlacesSource(Object source)
          Creates a Layer from an OpenStreetMap Shapefile source of placemarks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpenStreetMapShapefileLoader

public OpenStreetMapShapefileLoader()
Method Detail

isOSMPlacesSource

public static boolean isOSMPlacesSource(Object source)
Returns true if the specified Shapefile source is an OpenStreetMap Shapefile containing placemarks, and false otherwise. The source is considered to be an OpenStreetMap source if it can be converted to an abstract path, and the path's filename is equal to "places.shp", ignoring case.

Parameters:
source - the source of the Shapefile.
Returns:
true if the Shapefile is an OpenStreetMap Shapefile; false otherwise.
Throws:
IllegalArgumentException - if the source is null or an empty string.

makeLayerFromOSMPlacesShapefile

public static Layer makeLayerFromOSMPlacesShapefile(gov.nasa.worldwind.formats.shapefile.Shapefile shp)
Creates a Layer from an OpenStreetMap Shapefile of placemarks.

The returned Layer renders each Shapefile record as a surface circle with an associated screen label. The label text is taken from the Shapefile record attribute key "name". This determines each surface circle's appearance from the Shapefile record attribute key "type" as follows:

TypeColor
hamletBlack
villageGreen
townCyan
cityYellow

Parameters:
shp - the Shapefile to create a layer for.
Returns:
a Layer that renders the Shapefile's contents on the surface of the Globe.
Throws:
IllegalArgumentException - if the Shapefile is null, or if the Shapefile's primitive type is unrecognized.

makeLayerFromOSMPlacesSource

public static Layer makeLayerFromOSMPlacesSource(Object source)
Creates a Layer from an OpenStreetMap Shapefile source of placemarks. The source type may be one of the following:

The returned Layer renders each Shapefile record as a surface circle with an associated screen label. The label text is taken from the Shapefile record attribute key "name". This determines each surface circle's appearance from the Shapefile record attribute key "type" as follows:

TypeColor
hamletBlack
villageGreen
townCyan
cityYellow

Parameters:
source - the source of the OpenStreetMap Shapefile.
Returns:
a Layer that renders the Shapefile's contents on the surface of the Globe.
Throws:
IllegalArgumentException - if the source is null or an empty string.

NASA World Wind