public class AreaMeasurer extends LengthMeasurer implements MeasurableArea
To properly compute surface area the measurer must be provided with a list of positions that describe a closed path - one which last position is equal to the first.
Segments which are longer then the current maxSegmentLength will be subdivided along lines following the current
pathType - Polyline.LINEAR
, Polyline.RHUMB_LINE
or Polyline.GREAT_CIRCLE
.
Projected or non terrain following area is computed in a sinusoidal projection which is equivalent or equal area. Surface or terrain following area is approximated by sampling the path bounding sector with square cells along a grid. Cells which center is inside the path have their area estimated and summed according to the overall slope at the cell south-west corner.
MeasureTool
,
LengthMeasurer
Modifier and Type | Class and Description |
---|---|
protected class |
AreaMeasurer.Cell |
Modifier and Type | Field and Description |
---|---|
protected double |
projectedArea |
protected double |
surfaceArea |
length
Constructor and Description |
---|
AreaMeasurer() |
AreaMeasurer(ArrayList<? extends Position> positions) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearCachedValues() |
protected double |
computeProjectedAreaGeometry(Globe globe) |
protected double |
computeSurfaceAreaSampling(Globe globe,
double steps) |
protected double |
computeTriangleProjectedArea(Globe globe,
float[] verts,
int a,
int b,
int c) |
double |
getArea(Globe globe)
Get the surface area approximation for the current path or shape.
|
double |
getAreaTerrainSamplingSteps()
Get the sampling grid maximum number of rows or columns for terrain following surface area approximation.
|
double |
getHeight(Globe globe)
Returns the latitudanl length of the object in meters.
|
double |
getPerimeter(Globe globe)
Returns the length of the object's perimeter in meters.
|
double |
getProjectedArea(Globe globe) |
double |
getSurfaceArea(Globe globe) |
double |
getWidth(Globe globe)
Returns the longitudinal length of the object in meters.
|
void |
setAreaTerrainSamplingSteps(double steps)
Set the sampling grid maximum number of rows or columns for terrain following surface area approximation.
|
void |
setPositions(ArrayList<? extends Position> positions) |
computeLength, getBoundingSector, getLength, getLengthTerrainSamplingSteps, getMaxSegmentLength, getPathType, getPositions, isClosedShape, isFollowTerrain, setFollowTerrain, setLengthTerrainSamplingSteps, setMaxSegmentLength, setPathType, setPositions, subdividePositions, subdividePositions
protected void clearCachedValues()
clearCachedValues
in class LengthMeasurer
protected double computeProjectedAreaGeometry(Globe globe)
protected double computeSurfaceAreaSampling(Globe globe, double steps)
protected double computeTriangleProjectedArea(Globe globe, float[] verts, int a, int b, int c)
public double getArea(Globe globe)
If the measurer is set to follow terrain, the computed area will account for terrain deformations. Otherwise the area is that of the path once projected at sea level - elevation zero.
getArea
in interface MeasurableArea
globe
- the globe to draw terrain information from.IllegalArgumentException
- if globe is null
.public double getAreaTerrainSamplingSteps()
public double getHeight(Globe globe)
MeasurableArea
getHeight
in interface MeasurableArea
globe
- The globe the object is related to.public double getPerimeter(Globe globe)
MeasurableArea
getPerimeter
in interface MeasurableArea
globe
- The globe the object is related to.public double getProjectedArea(Globe globe)
public double getSurfaceArea(Globe globe)
public double getWidth(Globe globe)
MeasurableArea
getWidth
in interface MeasurableArea
globe
- The globe the object is related to.public void setAreaTerrainSamplingSteps(double steps)
steps
- the sampling grid maximum number of rows or columns.IllegalArgumentException
- if steps is less then one.public void setPositions(ArrayList<? extends Position> positions)
setPositions
in class LengthMeasurer