Package gov.nasa.worldwindx.examples
Class GeoJSONLoader
- java.lang.Object
-
- gov.nasa.worldwindx.examples.GeoJSONLoader
-
public class GeoJSONLoader extends java.lang.ObjectUtility class to load data from a GeoJSON source into a layer.
-
-
Field Summary
Fields Modifier and Type Field Description protected static RandomShapeAttributesrandomAttrs
-
Constructor Summary
Constructors Constructor Description GeoJSONLoader()Create a new loader.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGeoJSONGeometryToLayer(gov.nasa.worldwind.formats.geojson.GeoJSONObject object, RenderableLayer layer)Create a layer from a GeoJSON document.protected voidaddRenderableForFeature(gov.nasa.worldwind.formats.geojson.GeoJSONFeature feature, RenderableLayer layer)protected voidaddRenderableForFeatureCollection(gov.nasa.worldwind.formats.geojson.GeoJSONFeatureCollection c, RenderableLayer layer)protected voidaddRenderableForGeometry(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, RenderableLayer layer, AVList properties)protected voidaddRenderableForGeometryCollection(gov.nasa.worldwind.formats.geojson.GeoJSONGeometryCollection c, RenderableLayer layer, AVList properties)protected voidaddRenderableForLineString(gov.nasa.worldwind.formats.geojson.GeoJSONLineString geom, RenderableLayer layer, AVList properties)protected voidaddRenderableForMultiPoint(gov.nasa.worldwind.formats.geojson.GeoJSONMultiPoint geom, RenderableLayer layer, AVList properties)protected voidaddRenderableForMultiPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONMultiPolygon geom, RenderableLayer layer, AVList properties)protected voidaddRenderableForMutiLineString(gov.nasa.worldwind.formats.geojson.GeoJSONMultiLineString geom, RenderableLayer layer, AVList properties)protected voidaddRenderableForPoint(gov.nasa.worldwind.formats.geojson.GeoJSONPoint geom, RenderableLayer layer, AVList properties)protected voidaddRenderableForPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONPolygon geom, RenderableLayer layer, AVList properties)voidaddSourceGeometryToLayer(java.lang.Object docSource, RenderableLayer layer)Parse a GeoJSON document and add it to a layer.LayercreateLayerFromGeoJSON(gov.nasa.worldwind.formats.geojson.GeoJSONObject object)Create a layer from a GeoJSON object.LayercreateLayerFromSource(java.lang.Object docSource)Create a layer from a GeoJSON document.protected RenderablecreatePoint(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, Position pos, PointPlacemarkAttributes attrs, AVList properties)protected PointPlacemarkAttributescreatePointAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)protected RenderablecreatePolygon(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, java.lang.Iterable<? extends Position> outerBoundary, java.lang.Iterable<? extends Position>[] innerBoundaries, ShapeAttributes attrs, AVList properties)protected ShapeAttributescreatePolygonAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)protected RenderablecreatePolyline(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, java.lang.Iterable<? extends Position> positions, ShapeAttributes attrs, AVList properties)protected ShapeAttributescreatePolylineAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)protected voidhandleUnrecognizedObject(java.lang.Object o)protected static booleanpositionsHaveNonzeroAltitude(java.lang.Iterable<? extends Position> positions)
-
-
-
Field Detail
-
randomAttrs
protected static final RandomShapeAttributes randomAttrs
-
-
Method Detail
-
addSourceGeometryToLayer
public void addSourceGeometryToLayer(java.lang.Object docSource, RenderableLayer layer)Parse a GeoJSON document and add it to a layer.- Parameters:
docSource- GeoJSON document. May be a file pathString,File,URL, orURI.layer- layer to receive the new Renderable.
-
addGeoJSONGeometryToLayer
public void addGeoJSONGeometryToLayer(gov.nasa.worldwind.formats.geojson.GeoJSONObject object, RenderableLayer layer)Create a layer from a GeoJSON document.- Parameters:
object- GeoJSON object to be added to the layer.layer- layer to receive the new GeoJSON renderable.
-
createLayerFromSource
public Layer createLayerFromSource(java.lang.Object docSource)
Create a layer from a GeoJSON document.- Parameters:
docSource- GeoJSON document. May be a file pathString,File,URL, orURI.- Returns:
- the new layer.
-
createLayerFromGeoJSON
public Layer createLayerFromGeoJSON(gov.nasa.worldwind.formats.geojson.GeoJSONObject object)
Create a layer from a GeoJSON object.- Parameters:
object- GeoJSON object to use to create a Renderable, which will be added to the new layer.- Returns:
- the new layer.
-
handleUnrecognizedObject
protected void handleUnrecognizedObject(java.lang.Object o)
-
addRenderableForGeometry
protected void addRenderableForGeometry(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, RenderableLayer layer, AVList properties)
-
addRenderableForGeometryCollection
protected void addRenderableForGeometryCollection(gov.nasa.worldwind.formats.geojson.GeoJSONGeometryCollection c, RenderableLayer layer, AVList properties)
-
addRenderableForFeature
protected void addRenderableForFeature(gov.nasa.worldwind.formats.geojson.GeoJSONFeature feature, RenderableLayer layer)
-
addRenderableForFeatureCollection
protected void addRenderableForFeatureCollection(gov.nasa.worldwind.formats.geojson.GeoJSONFeatureCollection c, RenderableLayer layer)
-
addRenderableForPoint
protected void addRenderableForPoint(gov.nasa.worldwind.formats.geojson.GeoJSONPoint geom, RenderableLayer layer, AVList properties)
-
addRenderableForMultiPoint
protected void addRenderableForMultiPoint(gov.nasa.worldwind.formats.geojson.GeoJSONMultiPoint geom, RenderableLayer layer, AVList properties)
-
addRenderableForLineString
protected void addRenderableForLineString(gov.nasa.worldwind.formats.geojson.GeoJSONLineString geom, RenderableLayer layer, AVList properties)
-
addRenderableForMutiLineString
protected void addRenderableForMutiLineString(gov.nasa.worldwind.formats.geojson.GeoJSONMultiLineString geom, RenderableLayer layer, AVList properties)
-
addRenderableForPolygon
protected void addRenderableForPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONPolygon geom, RenderableLayer layer, AVList properties)
-
addRenderableForMultiPolygon
protected void addRenderableForMultiPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONMultiPolygon geom, RenderableLayer layer, AVList properties)
-
createPoint
protected Renderable createPoint(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, Position pos, PointPlacemarkAttributes attrs, AVList properties)
-
createPolyline
protected Renderable createPolyline(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, java.lang.Iterable<? extends Position> positions, ShapeAttributes attrs, AVList properties)
-
createPolygon
protected Renderable createPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, java.lang.Iterable<? extends Position> outerBoundary, java.lang.Iterable<? extends Position>[] innerBoundaries, ShapeAttributes attrs, AVList properties)
-
positionsHaveNonzeroAltitude
protected static boolean positionsHaveNonzeroAltitude(java.lang.Iterable<? extends Position> positions)
-
createPointAttributes
protected PointPlacemarkAttributes createPointAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)
-
createPolylineAttributes
protected ShapeAttributes createPolylineAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)
-
createPolygonAttributes
protected ShapeAttributes createPolygonAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)
-
-