Class: AreaMeasurer

AreaMeasurer(wwd)

new AreaMeasurer(wwd)

Utility class to compute approximations of projected and surface (terrain following) area on a globe.

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 - WorldWind.LINEAR, WorldWind.RHUMB_LINE or WorldWind.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.

Parameters:
Name Type Description
wwd WorldWindow The WorldWindow associated with AreaMeasurer.
Source:
Throws:
If the specified WorldWindow is null or undefined.
Type
ArgumentError

Members

areaTerrainSamplingSteps :Number

The sampling grid maximum number of rows or columns for terrain following surface area approximation.
Type:
  • Number
Source:

maxSegmentLength :Number

The maximum length a segment can have before being subdivided along a line following the current pathType.
Type:
  • Number
Source:

Methods

computeProjectedAreaGeometry(globe, positions, pathType) → {Number}

Tessellate the path in lat-lon space, then sum each triangle area.
Parameters:
Name Type Description
globe Globe
positions Array.<Position>
pathType String One of WorldWind.LINEAR, WorldWind.RHUMB_LINE or WorldWind.GREAT_CIRCLE
Source:
Returns:
area in square meters
Type
Number

computeSurfaceAreaSampling(globe, positions, pathType) → {Number}

Sample the path bounding sector with square cells which area are approximated according to the surface normal at the cell south-west corner.
Parameters:
Name Type Description
globe Globe
positions Array.<Position>
pathType String One of WorldWind.LINEAR, WorldWind.RHUMB_LINE or WorldWind.GREAT_CIRCLE
Source:
Returns:
area in square meters
Type
Number

computeTriangleProjectedArea(globe, verts) → {Number}

Compute triangle area in a sinusoidal projection centered at the triangle center. Note sinusoidal projection is equivalent or equal area.
Parameters:
Name Type Description
globe Globe
verts Array.<Number> A list of 9 positions in radians describing a triangle
Source:
Returns:
area in square meters
Type
Number

getArea(positions, followTerrain, pathType) → {Number}

Get the sampling grid maximum number of rows or columns for terrain following surface area approximation.
Parameters:
Name Type Description
positions Array.<Position> A list of positions describing a polygon
followTerrain Boolean If true, the computed length will account for terrain deformations as if someone was walking along that path
pathType String One of WorldWind.LINEAR, WorldWind.RHUMB_LINE or WorldWind.GREAT_CIRCLE
Source:
Returns:
area in square meters
Type
Number

tessellatePolygon(count, vertices) → {Array.<Number>}

Tessellate a Polygon
Parameters:
Name Type Description
count Number the number of vertices
vertices Array.<Number> A list of positions in radians
Source:
Returns:
a list of tessellated vertices
Type
Array.<Number>