|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwindx.examples.util.ShapefileLoader
public class ShapefileLoader
Converts Shapefile geometry into World Wind renderable objects. Shapefile geometries are mapped to World Wind objects as follows:
| Shapefile Geometry | World Wind Object |
|---|---|
| Point | WWIcon |
| MultiPoint | List of WWIcon |
| Polyline | SurfacePolylines |
| Polygon | SurfacePolygons |
createPointAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord)createPolylineAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord)createPolygonAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord)
| Field Summary | |
|---|---|
protected int |
numPolygonsPerLayer
Indicates the maximum number of polygons to place in a layer before creating an additional layer. |
protected static RandomShapeAttributes |
randomAttrs
|
| Constructor Summary | |
|---|---|
ShapefileLoader()
Constructs a ShapefileLoader, but otherwise does nothing. |
|
| Method Summary | |
|---|---|
protected void |
addRenderablesForMultiPoints(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
RenderableLayer layer)
|
protected void |
addRenderablesForPoints(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
RenderableLayer layer)
|
protected void |
addRenderablesForPolygons(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
List<Layer> layers)
Creates renderables for all the polygons in the shapefile. |
protected void |
addRenderablesForPolylines(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
RenderableLayer layer)
|
Layer |
createLayerFromShapefile(gov.nasa.worldwind.formats.shapefile.Shapefile shp)
Creates a Layer from a general Shapefile. |
Layer |
createLayerFromSource(Object source)
Creates a Layer from a general Shapefile source. |
List<Layer> |
createLayersFromShapefile(gov.nasa.worldwind.formats.shapefile.Shapefile shp)
Creates a list of Layers containing shapes from a Shapefile. |
List<Layer> |
createLayersFromSource(Object source)
Creates a list of Layers containing shapes from a Shapefile. |
protected Renderable |
createPoint(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record,
double latDegrees,
double lonDegrees,
PointPlacemarkAttributes attrs)
|
protected PointPlacemarkAttributes |
createPointAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record)
|
protected void |
createPolygon(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record,
ShapeAttributes attrs,
RenderableLayer layer)
|
protected ShapeAttributes |
createPolygonAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record)
|
protected Renderable |
createPolyline(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record,
ShapeAttributes attrs)
|
protected Renderable |
createPolyline(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
ShapeAttributes attrs)
|
protected ShapeAttributes |
createPolylineAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record)
|
protected Double |
getHeight(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record)
Get the height of a record. |
int |
getNumPolygonsPerLayer()
Indicates the maximum number of polygon renderables to place in a single layer. |
void |
setNumPolygonsPerLayer(int numPolygonsPerLayer)
Specifies the maximum number of polygon renderables to place in a single layer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int numPolygonsPerLayer
protected static final RandomShapeAttributes randomAttrs
| Constructor Detail |
|---|
public ShapefileLoader()
| Method Detail |
|---|
protected void addRenderablesForMultiPoints(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
RenderableLayer layer)
protected void addRenderablesForPoints(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
RenderableLayer layer)
protected void addRenderablesForPolygons(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
List<Layer> layers)
shp - the shapefile to readlayers - a list in which to place the layers created. May not be null.
protected void addRenderablesForPolylines(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
RenderableLayer layer)
public Layer createLayerFromShapefile(gov.nasa.worldwind.formats.shapefile.Shapefile shp)
Layer from a general Shapefile.
shp - the Shapefile to create a layer for.
IllegalArgumentException - if the Shapefile is null, or if the Shapefile's primitive type is unrecognized.public Layer createLayerFromSource(Object source)
Layer from a general Shapefile source. The source type may be one of
the following: InputStreamURLFileString containing a valid URL description or a file or resource name available on
the classpath.
source - the source of the Shapefile.
IllegalArgumentException - if the source is null or an empty string, or if the Shapefile's primitive type
is unrecognized.public List<Layer> createLayersFromShapefile(gov.nasa.worldwind.formats.shapefile.Shapefile shp)
Layers containing shapes from a Shapefile.
For polygon shapes, the maximum number of polygons to add to a layer can be specified. By default it's 5000. If
there are more polygons in the shapefile than the maximum, new layers are created as needed, with each holding no
more than the maximum. All but the first layer is disabled to avoid bogging down the display trying to render an
excessive number of shapes. The application can enable the layers selectively to maintain performance.
shp - the source of the Shapefile.
IllegalArgumentException - if the shapefile is null or an empty string, or if the Shapefile's primitive
type is unrecognized.public List<Layer> createLayersFromSource(Object source)
Layers containing shapes from a Shapefile.
For polygon shapes, the maximum number of polygons to add to a layer can be specified. By default it's 5000. If
there are more polygons in the shapefile than the maximum, new layers are created as needed, with each holding no
more than the maximum. All but the first layer is disabled to avoid bogging down the display trying to render an
excessive number of shapes. The application can enable the layers selectively to maintain performance.
The source type may be one of the following: InputStreamURLFileString containing a valid URL description or a file
or resource name available on the classpath.
source - the source of the Shapefile.
IllegalArgumentException - if the source is null or an empty string, or if the Shapefile's primitive type
is unrecognized.
protected Renderable createPoint(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record,
double latDegrees,
double lonDegrees,
PointPlacemarkAttributes attrs)
protected PointPlacemarkAttributes createPointAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record)
protected void createPolygon(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record,
ShapeAttributes attrs,
RenderableLayer layer)
protected ShapeAttributes createPolygonAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record)
protected Renderable createPolyline(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record,
ShapeAttributes attrs)
protected Renderable createPolyline(gov.nasa.worldwind.formats.shapefile.Shapefile shp,
ShapeAttributes attrs)
protected ShapeAttributes createPolylineAttributes(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record)
protected Double getHeight(gov.nasa.worldwind.formats.shapefile.ShapefileRecord record)
record - shape for which to find height
null if there is no height.public int getNumPolygonsPerLayer()
public void setNumPolygonsPerLayer(int numPolygonsPerLayer)
numPolygonsPerLayer - the maximum number of polygons to place in a layer.
IllegalArgumentException - if the number is less than 1.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||