es.unex.sextante.shapesTools
Class ShapesTools

java.lang.Object
  extended by es.unex.sextante.shapesTools.ShapesTools

public class ShapesTools
extends java.lang.Object

Additional methods for working with vector layers

Author:
Victor Olaya

Constructor Summary
ShapesTools()
           
 
Method Summary
static IVectorLayer addFields(OutputFactory outputFactory, IVectorLayer layer, IOutputChannel channel, java.lang.String[] sFieldNames, java.lang.Object[][] addedValues, java.lang.Class[] fieldTypes)
          Returns a new vector layer identical to a given one but with additional fields in its attributes table
static com.vividsolutions.jts.geom.Geometry createCircle(double x, double y, double radius)
          Creates a circle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapesTools

public ShapesTools()
Method Detail

addFields

public static IVectorLayer addFields(OutputFactory outputFactory,
                                     IVectorLayer layer,
                                     IOutputChannel channel,
                                     java.lang.String[] sFieldNames,
                                     java.lang.Object[][] addedValues,
                                     java.lang.Class[] fieldTypes)
                              throws UnsupportedOutputChannelException,
                                     IteratorException
Returns a new vector layer identical to a given one but with additional fields in its attributes table

Parameters:
outputFactory - the output factory to use to create the new layer
layer - the base layer
channel - the output channel for the resulting layer
sFieldNames - an array with field names of the new fields to add
addedValues - the values to add
fieldTypes - an array with field types of the fields to add
Returns:
a new layer with added attributes
Throws:
UnsupportedOutputChannelException
IteratorException

createCircle

public static com.vividsolutions.jts.geom.Geometry createCircle(double x,
                                                                double y,
                                                                double radius)
Creates a circle

Parameters:
x - the x coordinate of the center
y - the y coordinate of the center
radius - the radius of the circle
Returns:
a circle-shaped polygon