deegree 2.5 (2011/06/29 09:44 build-8-official)

org.deegree.graphics
Class FeatureLayer

java.lang.Object
  extended by org.deegree.graphics.AbstractLayer
      extended by org.deegree.graphics.FeatureLayer
All Implemented Interfaces:
Layer
Direct Known Subclasses:
LazyFeatureLayer

public class FeatureLayer
extends AbstractLayer

A Layer is a collection of Features building a thematic 'unit' waterways or country borders for example. Features can be added or removed from the layer. A Feature can e changed by a modul of the application using the layer because only references to Features are stored within a layer.

Version:
$Revision: 19454 $ $Date: 2009-09-01 14:27:33 +0200 (Di, 01 Sep 2009) $
Author:
Andreas Poth

Field Summary
protected  FeatureCollection fc
           
 
Fields inherited from class org.deegree.graphics.AbstractLayer
boundingbox, cs, eventController
 
Constructor Summary
protected FeatureLayer(java.lang.String name)
          creates a layer with EPSG:4326 as default coordinate system
protected FeatureLayer(java.lang.String name, CoordinateSystem crs)
          Creates a new FeatureLayer object.
protected FeatureLayer(java.lang.String name, CoordinateSystem crs, FeatureCollection fc)
          Creates a new AbstractLayer object.
 
Method Summary
 void addFeature(Feature feature)
          adds a feature to the layer
 void addFeatureCollection(FeatureCollection featureCollection)
          adds a feature collection to the layer
 Feature[] getAllFeatures()
          returns all features
 Feature getFeature(int index)
          returns the feature that matches the submitted index
 Feature getFeatureById(java.lang.String id)
          returns the feature that matches the submitted id
 Feature[] getFeaturesById(java.lang.String[] ids)
          returns the feature that matches the submitted id
 int getSize()
          returns the amount of features within the layer.
 void removeFeature(Feature feature)
          removes a display Element from the layer
 void removeFeature(int id)
          removes the display Element from the layer that matches the submitted id
 void setCoordinatesSystem(CoordinateSystem crs)
          sets the coordinate reference system of the MapView.
 
Methods inherited from class org.deegree.graphics.AbstractLayer
addEventController, getBoundingBox, getCoordinatesSystem, getName, isValid, removeEventController
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fc

protected FeatureCollection fc
Constructor Detail

FeatureLayer

protected FeatureLayer(java.lang.String name)
                throws java.lang.Exception
creates a layer with EPSG:4326 as default coordinate system

Parameters:
name - of the feature
Throws:
java.lang.Exception

FeatureLayer

protected FeatureLayer(java.lang.String name,
                       CoordinateSystem crs)
                throws java.lang.Exception
Creates a new FeatureLayer object.

Parameters:
name -
crs -
Throws:
java.lang.Exception

FeatureLayer

protected FeatureLayer(java.lang.String name,
                       CoordinateSystem crs,
                       FeatureCollection fc)
                throws java.lang.Exception
Creates a new AbstractLayer object.

Parameters:
name -
crs -
fc -
Throws:
java.lang.Exception
Method Detail

getFeatureById

public Feature getFeatureById(java.lang.String id)
returns the feature that matches the submitted id

Parameters:
id -
Returns:
feature identified by its id

getFeaturesById

public Feature[] getFeaturesById(java.lang.String[] ids)
returns the feature that matches the submitted id

Parameters:
ids -
Returns:
features identified by their id

getFeature

public Feature getFeature(int index)
returns the feature that matches the submitted index

Parameters:
index -
Returns:
a feature

getAllFeatures

public Feature[] getAllFeatures()
returns all features

Returns:
all features as array

addFeature

public void addFeature(Feature feature)
                throws java.lang.Exception
adds a feature to the layer

Parameters:
feature -
Throws:
java.lang.Exception

addFeatureCollection

public void addFeatureCollection(FeatureCollection featureCollection)
                          throws java.lang.Exception
adds a feature collection to the layer

Parameters:
featureCollection -
Throws:
java.lang.Exception

removeFeature

public void removeFeature(Feature feature)
                   throws java.lang.Exception
removes a display Element from the layer

Parameters:
feature -
Throws:
java.lang.Exception

removeFeature

public void removeFeature(int id)
                   throws java.lang.Exception
removes the display Element from the layer that matches the submitted id

Parameters:
id -
Throws:
java.lang.Exception

getSize

public int getSize()
returns the amount of features within the layer.

Returns:
number of contained features

setCoordinatesSystem

public void setCoordinatesSystem(CoordinateSystem crs)
                          throws java.lang.Exception
sets the coordinate reference system of the MapView. If a new crs is set all geometries of GeometryFeatures will be transformed to the new coordinate reference system.

Parameters:
crs -
Throws:
java.lang.Exception

deegree 2.5 (2011/06/29 09:44 build-8-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org