|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.epfl.scapetoad.CartogramGrid
public class CartogramGrid
The cartogram grid class represents the grid which is overlaid on all the layers and which is used for the deformation computation. The grid has nodes and cells. Each node has x/y-coordinates, and each cell has a density value.
Method Summary | |
---|---|
void |
computeOriginalDensityValuesWithLayer(Layer layer,
java.lang.String attrName,
boolean attrIsDensityValue)
Computes the density value given a layer and an attribute name. |
void |
conformToConstrainedDeformation()
Corrects the grid for corresponding the constrained deformation information computed by the prepareGridForConstrainedDeformation method. |
double |
coordinateXForOriginalCellIndex(int i)
Converts a grid cell index in x direction into real world x coordinate. |
double |
coordinateYForOriginalCellIndex(int j)
Converts a grid cell index in y direction into real world y coordinate. |
Envelope |
envelope()
Returns the grid's bounding box. |
void |
fillRegularDensityGrid(double[][] densityGrid,
double minX,
double maxX,
double minY,
double maxY)
Fills a regular grid with the mean density. |
double |
getMaximumDensity()
Returns the current maximum density value of the grid. |
double |
getMinimumDensity()
Returns the current minimum density value of the grid. |
double[][] |
getXCoordinates()
Returns the x coordinates array. |
double[][] |
getYCoordinates()
Returns the y coordinates array. |
double |
meanDensityError()
Returns the mean density error. |
int |
originalCellIndexForCoordinateX(double x)
Converts the provided x coordinate into the grid's cell index. |
int |
originalCellIndexForCoordinateY(double y)
Converts the provided y coordinate into the grid's cell index. |
void |
prepareGridForConstrainedDeformation(java.util.Vector layers)
Prepares the original grid for a constrained deformation process. |
Coordinate[] |
projectCoordinates(Coordinate[] coords)
Projects a coordinate sequence using this grid. |
Coordinate[] |
projectLineSegment(Coordinate c1,
Coordinate c2)
Projects a line segment. |
double[] |
projectPoint(double x,
double y)
Projects one point using this grid. |
Coordinate |
projectPointAsCoordinate(double x,
double y)
Projects one point using this grid. |
void |
scaleDensityValues(double minValue,
double maxValue)
Scales the density values given the minimum and maximum value. |
void |
updateDensityValues()
Updates the current density values. |
void |
writeToShapefile(java.lang.String shapefile)
Writes the grid into the specified shape file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Envelope envelope()
public double[][] getXCoordinates()
public double[][] getYCoordinates()
public void computeOriginalDensityValuesWithLayer(Layer layer, java.lang.String attrName, boolean attrIsDensityValue) throws java.lang.InterruptedException
layer
- the master layerattrName
- the name of the master attributeattrIsDensityValue
- is true if the master attribute is a density
value, and false if it is a population value.
java.lang.InterruptedException
public void prepareGridForConstrainedDeformation(java.util.Vector layers)
layers
- a Vector containing the constrained layer names.public void conformToConstrainedDeformation()
public void scaleDensityValues(double minValue, double maxValue)
minValue
- the new minimum value for the densities.maxValue
- the new maximum value for the densities.public int originalCellIndexForCoordinateX(double x)
x
- the real world x coordinate.
public int originalCellIndexForCoordinateY(double y)
y
- the real world y coordinate.
public double coordinateXForOriginalCellIndex(int i)
i
- the cell index in x direction.
public double coordinateYForOriginalCellIndex(int j)
i
- the cell index in y direction.
public void writeToShapefile(java.lang.String shapefile)
shapefile
- the path to the shape file.public double meanDensityError()
public void updateDensityValues()
public void fillRegularDensityGrid(double[][] densityGrid, double minX, double maxX, double minY, double maxY)
public double[] projectPoint(double x, double y)
x
- the x coordinate of the point to project.y
- the y coordinate of the point to project.
public Coordinate projectPointAsCoordinate(double x, double y)
x
- the x coordinate of the point to project.y
- the y coordinate of the point to project.
public Coordinate[] projectLineSegment(Coordinate c1, Coordinate c2)
public Coordinate[] projectCoordinates(Coordinate[] coords)
public double getMinimumDensity()
public double getMaximumDensity()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |