es.unex.sextante.dataObjects
Interface IVectorLayer

All Superinterfaces:
IDataObject, ILayer
All Known Implementing Classes:
AbstractVectorLayer

public interface IVectorLayer
extends ILayer

This is the base interface that all vector layers have to implement to be able to be used by SEXTANTE algorithms. Instead of implementing this class directly, it is recommended to extend AbstractVectorLayer.

Author:
Victor Olaya. volaya@unex.es

Field Summary
static int SHAPE_TYPE_LINE
           
static int SHAPE_TYPE_POINT
           
static int SHAPE_TYPE_POLYGON
           
 
Method Summary
 void addFeature(com.vividsolutions.jts.geom.Geometry geometry, java.lang.Object[] attributes)
          Adds a new feature to the layer
 void addFeature(IFeature feature)
          Adds a new feature to the layer
 int getFieldCount()
           
 int getFieldIndexByName(java.lang.String fieldName)
          Returns the index of a field from its name.
 java.lang.String getFieldName(int index)
          Returns the name of a given field in the attributes table
 java.lang.String[] getFieldNames()
          Returns the names of the fields in the attributes table
 java.lang.Class getFieldType(int index)
          Return a class representing the data type of a given field
 java.lang.Class[] getFieldTypes()
          Returns an array of classes representing the data types of the fields in the attributes table
 int getShapesCount()
          Returns the number of features in this layer
 int getShapeType()
          Returns the type of geometries in this layer
 IFeatureIterator iterator()
          Returns an iterator to iterate through the entities of this layer
 
Methods inherited from interface es.unex.sextante.dataObjects.ILayer
getCRS, getFullExtent
 
Methods inherited from interface es.unex.sextante.dataObjects.IDataObject
close, getBaseDataObject, getFilename, getName, open, postProcess, setName
 

Field Detail

SHAPE_TYPE_POINT

static final int SHAPE_TYPE_POINT
See Also:
Constant Field Values

SHAPE_TYPE_LINE

static final int SHAPE_TYPE_LINE
See Also:
Constant Field Values

SHAPE_TYPE_POLYGON

static final int SHAPE_TYPE_POLYGON
See Also:
Constant Field Values
Method Detail

addFeature

void addFeature(com.vividsolutions.jts.geom.Geometry geometry,
                java.lang.Object[] attributes)
Adds a new feature to the layer

Parameters:
geometry - the geometry
attributes - the attributes associated with the geometry

addFeature

void addFeature(IFeature feature)
Adds a new feature to the layer

Parameters:
feature - the feature to add

iterator

IFeatureIterator iterator()
Returns an iterator to iterate through the entities of this layer

Returns:
an iterator to iterate the layer

getFieldName

java.lang.String getFieldName(int index)
Returns the name of a given field in the attributes table

Parameters:
index - the zero-based field index
Returns:
the name of the selected attribute field

getFieldType

java.lang.Class getFieldType(int index)
Return a class representing the data type of a given field

Parameters:
index - the zero-based field index
Returns:
the data type of the selected attribute field

getFieldCount

int getFieldCount()
Returns:
the number of attributes associates to each geometry

getFieldTypes

java.lang.Class[] getFieldTypes()
Returns an array of classes representing the data types of the fields in the attributes table

Returns:
the data types of attribute fields

getFieldNames

java.lang.String[] getFieldNames()
Returns the names of the fields in the attributes table

Returns:
the names of the attribute fields

getShapesCount

int getShapesCount()
Returns the number of features in this layer

Returns:
the number of features in this layer

getShapeType

int getShapeType()
Returns the type of geometries in this layer

Returns:
the type of geometries in this layer

getFieldIndexByName

int getFieldIndexByName(java.lang.String fieldName)
Returns the index of a field from its name. Returns -1 if there is not a field with that name.

Parameters:
fieldName - the name of the field
Returns:
the index of the given field