|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.epfl.scapetoad.CartogramLayer
public class CartogramLayer
Constructor Summary | |
---|---|
CartogramLayer()
|
Method Summary | |
---|---|
static void |
addAttribute(Layer lyr,
java.lang.String name,
AttributeType type)
Adds a new attribute to an existing layer. |
static void |
addDensityAttribute(Layer layer,
java.lang.String populationAttr,
java.lang.String densityAttr)
Adds a new attribute containing the density value for a given attribute. |
static void |
cleanAttributeValues(Layer layer,
java.lang.String attrName)
Checks the attribute values for invalid values and replaces them with a zero value. |
static double |
computeCartogramSizeError(Layer cartogramLayer,
java.lang.String cartogramAttribute,
Layer originalLayer,
java.lang.String errorAttribute)
Computes the cartogram size error and stores it in the layer's attribute with the provided name. |
static Geometry |
contour(Layer layer)
Computes the contour of this layer. |
static FeatureSchema |
copyFeatureSchema(FeatureSchema fs)
Creates a new FeatureSchema using the provided FeatureSchema. |
static double |
maxValueForAttribute(Layer layer,
java.lang.String attrName)
Returns the maximum value for the given attribute. |
static double |
meanDensityWithAttribute(Layer layer,
java.lang.String attrName)
Computes the mean value for the given attribute weighted by the feature area. |
static double |
meanValueForAttribute(Layer layer,
java.lang.String attrName)
Returns the mean value for the given attribute. |
static double |
minValueForAttribute(Layer layer,
java.lang.String attrName)
Returns the minimum value for the given attribute. |
static double |
percentileForAttribute(Layer layer,
java.lang.String attrName,
int n)
Returns the n-th percentile of the provided attribute. |
static Layer |
projectLayerWithGrid(Layer lyr,
CartogramGrid grid)
Projects a layer using a cartogram grid. |
static void |
regularizeLayer(Layer lyr,
double maxlen)
Regularizes a layer. |
static void |
replaceAttributeValue(Layer layer,
java.lang.String attrName,
double oldValue,
double newValue)
Replaces a double attribute value with another. |
static void |
snapLayer(Layer lyr,
double snappingDistance,
Envelope snapRegion)
Snaps all points of the layer to a grid with given cell size. |
static double |
standardDeviationForAttribute(Layer layer,
java.lang.String attrName)
Computes the standard deviation of the provided attribute. |
static double |
sumForAttribute(Layer layer,
java.lang.String attrName)
Computes the sum of the provided attribute. |
static double |
totalArea(Layer layer)
Computes the total area of all features in this layer. |
static double |
varianceForAttribute(Layer layer,
java.lang.String attrName)
Computes the variance of the provided attribute. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CartogramLayer()
Method Detail |
---|
public static void addAttribute(Layer lyr, java.lang.String name, AttributeType type)
lyr
- the layer to which we should add the new attribute.name
- the name of the new attribute.type
- the type of the new attribute.public static void addDensityAttribute(Layer layer, java.lang.String populationAttr, java.lang.String densityAttr)
populationAttr
- the name of the (existing) attribute for which
we shall compute the density.densityAttr
- the name of the new density attribute.public static double meanDensityWithAttribute(Layer layer, java.lang.String attrName)
public static double meanValueForAttribute(Layer layer, java.lang.String attrName)
public static double minValueForAttribute(Layer layer, java.lang.String attrName)
public static double maxValueForAttribute(Layer layer, java.lang.String attrName)
public static double sumForAttribute(Layer layer, java.lang.String attrName)
public static double varianceForAttribute(Layer layer, java.lang.String attrName)
public static double standardDeviationForAttribute(Layer layer, java.lang.String attrName)
public static double percentileForAttribute(Layer layer, java.lang.String attrName, int n)
n
- the percentile, must be between 0 and 100.public static void replaceAttributeValue(Layer layer, java.lang.String attrName, double oldValue, double newValue)
public static double totalArea(Layer layer)
public static Geometry contour(Layer layer)
layer
- the layer for which we should compute the layer.
public static void regularizeLayer(Layer lyr, double maxlen)
lyr
- the layer to regularize.maxlen
- the maximum length of the line segments.public static void snapLayer(Layer lyr, double snappingDistance, Envelope snapRegion)
lyr
- the layer to snap.snappingDistance
- the size of the grid cells.snapRegion
- a envelope with the snapping region. This enables
the snapping to the same grid over several different layers.public static Layer projectLayerWithGrid(Layer lyr, CartogramGrid grid)
public static double computeCartogramSizeError(Layer cartogramLayer, java.lang.String cartogramAttribute, Layer originalLayer, java.lang.String errorAttribute)
public static void cleanAttributeValues(Layer layer, java.lang.String attrName)
public static FeatureSchema copyFeatureSchema(FeatureSchema fs)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |