deegree 2.3 (2010/04/09 10:10 build-4-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(String name)
          creates a layer with EPSG:4326 as default coordinate system
protected FeatureLayer(String name, CoordinateSystem crs)
          Creates a new FeatureLayer object.
protected FeatureLayer(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(String id)
          returns the feature that matches the submitted id
 Feature[] getFeaturesById(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(String name)
                throws Exception
creates a layer with EPSG:4326 as default coordinate system

Parameters:
name - of the feature
Throws:
Exception

FeatureLayer

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

Parameters:
name -
crs -
Throws:
Exception

FeatureLayer

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

Parameters:
name -
crs -
fc -
Throws:
Exception
Method Detail

getFeatureById

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

Parameters:
id -
Returns:
feature identified by its id

getFeaturesById

public Feature[] getFeaturesById(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 Exception
adds a feature to the layer

Parameters:
feature -
Throws:
Exception

addFeatureCollection

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

Parameters:
featureCollection -
Throws:
Exception

removeFeature

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

Parameters:
feature -
Throws:
Exception

removeFeature

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

Parameters:
id -
Throws:
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 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:
Exception

deegree 2.3 (2010/04/09 10:10 build-4-official)

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