NASA World Wind

gov.nasa.worldwindx.examples
Class GeoJSONLoader

java.lang.Object
  extended by gov.nasa.worldwindx.examples.GeoJSONLoader

public class GeoJSONLoader
extends Object

Utility class to load data from a GeoJSON source into a layer.


Field Summary
protected static RandomShapeAttributes randomAttrs
           
 
Constructor Summary
GeoJSONLoader()
          Create a new loader.
 
Method Summary
 void addGeoJSONGeometryToLayer(gov.nasa.worldwind.formats.geojson.GeoJSONObject object, RenderableLayer layer)
          Create a layer from a GeoJSON document.
protected  void addRenderableForFeature(gov.nasa.worldwind.formats.geojson.GeoJSONFeature feature, RenderableLayer layer)
           
protected  void addRenderableForFeatureCollection(gov.nasa.worldwind.formats.geojson.GeoJSONFeatureCollection c, RenderableLayer layer)
           
protected  void addRenderableForGeometry(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, RenderableLayer layer, AVList properties)
           
protected  void addRenderableForGeometryCollection(gov.nasa.worldwind.formats.geojson.GeoJSONGeometryCollection c, RenderableLayer layer, AVList properties)
           
protected  void addRenderableForLineString(gov.nasa.worldwind.formats.geojson.GeoJSONLineString geom, RenderableLayer layer, AVList properties)
           
protected  void addRenderableForMultiPoint(gov.nasa.worldwind.formats.geojson.GeoJSONMultiPoint geom, RenderableLayer layer, AVList properties)
           
protected  void addRenderableForMultiPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONMultiPolygon geom, RenderableLayer layer, AVList properties)
           
protected  void addRenderableForMutiLineString(gov.nasa.worldwind.formats.geojson.GeoJSONMultiLineString geom, RenderableLayer layer, AVList properties)
           
protected  void addRenderableForPoint(gov.nasa.worldwind.formats.geojson.GeoJSONPoint geom, RenderableLayer layer, AVList properties)
           
protected  void addRenderableForPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONPolygon geom, RenderableLayer layer, AVList properties)
           
 void addSourceGeometryToLayer(Object docSource, RenderableLayer layer)
          Parse a GeoJSON document and add it to a layer.
 Layer createLayerFromGeoJSON(gov.nasa.worldwind.formats.geojson.GeoJSONObject object)
          Create a layer from a GeoJSON object.
 Layer createLayerFromSource(Object docSource)
          Create a layer from a GeoJSON document.
protected  Renderable createPoint(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, Position pos, PointPlacemarkAttributes attrs, AVList properties)
           
protected  PointPlacemarkAttributes createPointAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)
           
protected  Renderable createPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, Iterable<? extends Position> outerBoundary, Iterable<? extends Position>[] innerBoundaries, ShapeAttributes attrs, AVList properties)
           
protected  ShapeAttributes createPolygonAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)
           
protected  Renderable createPolyline(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner, Iterable<? extends Position> positions, ShapeAttributes attrs, AVList properties)
           
protected  ShapeAttributes createPolylineAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom, Layer layer)
           
protected  void handleUnrecognizedObject(Object o)
           
protected static boolean positionsHaveNonzeroAltitude(Iterable<? extends Position> positions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

randomAttrs

protected static final RandomShapeAttributes randomAttrs
Constructor Detail

GeoJSONLoader

public GeoJSONLoader()
Create a new loader.

Method Detail

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.

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)

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)

addRenderableForLineString

protected void addRenderableForLineString(gov.nasa.worldwind.formats.geojson.GeoJSONLineString geom,
                                          RenderableLayer layer,
                                          AVList properties)

addRenderableForMultiPoint

protected void addRenderableForMultiPoint(gov.nasa.worldwind.formats.geojson.GeoJSONMultiPoint geom,
                                          RenderableLayer layer,
                                          AVList properties)

addRenderableForMultiPolygon

protected void addRenderableForMultiPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONMultiPolygon geom,
                                            RenderableLayer layer,
                                            AVList properties)

addRenderableForMutiLineString

protected void addRenderableForMutiLineString(gov.nasa.worldwind.formats.geojson.GeoJSONMultiLineString geom,
                                              RenderableLayer layer,
                                              AVList properties)

addRenderableForPoint

protected void addRenderableForPoint(gov.nasa.worldwind.formats.geojson.GeoJSONPoint geom,
                                     RenderableLayer layer,
                                     AVList properties)

addRenderableForPolygon

protected void addRenderableForPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONPolygon geom,
                                       RenderableLayer layer,
                                       AVList properties)

addSourceGeometryToLayer

public void addSourceGeometryToLayer(Object docSource,
                                     RenderableLayer layer)
Parse a GeoJSON document and add it to a layer.

Parameters:
docSource - GeoJSON document. May be a file path String, File, URL, or URI.
layer - layer to receive the new Renderable.

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.

createLayerFromSource

public Layer createLayerFromSource(Object docSource)
Create a layer from a GeoJSON document.

Parameters:
docSource - GeoJSON document. May be a file path String, File, URL, or URI.
Returns:
the new layer.

createPoint

protected Renderable createPoint(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner,
                                 Position pos,
                                 PointPlacemarkAttributes attrs,
                                 AVList properties)

createPointAttributes

protected PointPlacemarkAttributes createPointAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom,
                                                         Layer layer)

createPolygon

protected Renderable createPolygon(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner,
                                   Iterable<? extends Position> outerBoundary,
                                   Iterable<? extends Position>[] innerBoundaries,
                                   ShapeAttributes attrs,
                                   AVList properties)

createPolygonAttributes

protected ShapeAttributes createPolygonAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom,
                                                  Layer layer)

createPolyline

protected Renderable createPolyline(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry owner,
                                    Iterable<? extends Position> positions,
                                    ShapeAttributes attrs,
                                    AVList properties)

createPolylineAttributes

protected ShapeAttributes createPolylineAttributes(gov.nasa.worldwind.formats.geojson.GeoJSONGeometry geom,
                                                   Layer layer)

handleUnrecognizedObject

protected void handleUnrecognizedObject(Object o)

positionsHaveNonzeroAltitude

protected static boolean positionsHaveNonzeroAltitude(Iterable<? extends Position> positions)

NASA World Wind