Class OpenStreetMapShapefileLoader
- java.lang.Object
-
- gov.nasa.worldwindx.examples.util.OpenStreetMapShapefileLoader
-
public class OpenStreetMapShapefileLoader extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classOpenStreetMapShapefileLoader.Labelprotected static classOpenStreetMapShapefileLoader.OSMShapesprotected static classOpenStreetMapShapefileLoader.TextAndShapesLayer
-
Constructor Summary
Constructors Constructor Description OpenStreetMapShapefileLoader()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisOSMPlacesSource(java.lang.Object source)Returns true if the specified Shapefile source is an OpenStreetMap Shapefile containing placemarks, and false otherwise.static LayermakeLayerFromOSMPlacesShapefile(gov.nasa.worldwind.formats.shapefile.Shapefile shp)Creates aLayerfrom an OpenStreetMap Shapefile of placemarks.static LayermakeLayerFromOSMPlacesSource(java.lang.Object source)Creates aLayerfrom an OpenStreetMap Shapefile source of placemarks.
-
-
-
Method Detail
-
isOSMPlacesSource
public static boolean isOSMPlacesSource(java.lang.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:
java.lang.IllegalArgumentException- if the source is null or an empty string.
-
makeLayerFromOSMPlacesSource
public static Layer makeLayerFromOSMPlacesSource(java.lang.Object source)
Creates aLayerfrom an OpenStreetMap Shapefile source of placemarks. The source type may be one of the following:InputStreamURL- absolute
URI FileStringcontaining a valid URL description or a file or resource name available on the classpath.
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:
Mapping Type Color hamlet Black village Green town Cyan city Yellow - Parameters:
source- the source of the OpenStreetMap Shapefile.- Returns:
- a Layer that renders the Shapefile's contents on the surface of the Globe.
- Throws:
java.lang.IllegalArgumentException- if the source is null or an empty string.
-
makeLayerFromOSMPlacesShapefile
public static Layer makeLayerFromOSMPlacesShapefile(gov.nasa.worldwind.formats.shapefile.Shapefile shp)
Creates aLayerfrom 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:
Mapping Type Color hamlet Black village Green town Cyan city Yellow - 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:
java.lang.IllegalArgumentException- if the Shapefile is null, or if the Shapefile's primitive type is unrecognized.
-
-