HAZE
haze is a drop-in replacement to process water vapor to be used with FORCE
Loading...
Searching...
No Matches
Fast Geodesic Area Calculation

Functions

double fastLinearRingGeodesicArea (const OGRGeometryH geometry, const struct geod_geodesic *g)
 Fast Computation of Geodesic Area for Linear Rings.
double fastPolygonialGeodesicArea (const OGRGeometryH geometry, const struct geod_geodesic *g)
 Fast Computation of Geodesic Area for Polygons.
double fastMultipolygonialGeodesicArea (const OGRGeometryH geometry, const struct geod_geodesic *g)
 Fast Computation of Geodesic Area for Multipolygons.
double fastGeodesicArea (const OGRGeometryH geometry, const OGRSpatialReferenceH spatialReference)
 Fast Computation of Geodesic Area for Polygons and Multipolygons.

Detailed Description

Function Documentation

◆ fastGeodesicArea()

double fastGeodesicArea ( const OGRGeometryH geometry,
const OGRSpatialReferenceH spatialReference )

Fast Computation of Geodesic Area for Polygons and Multipolygons.

This function implements geodesic area calculation for polygons and multipolygons. In contrast to GDAL's/OGR's methods, this not not only supports fewer geometry types but also assumes that input geometries are in a CRS suitable for geodesic calculations. GDAL/OGR performs reprojection on the fly which is the main source of runtime overhead. Both implementations rely on PROJ's geod_polygonarea.

Note
This function takes direct insipiration from GDAL's/OGR's OGR_G_GeodesicArea and the implementation specifics of the respective C++ methods – one could call this a copy-cat version to a certain extent. Equality of results was tested against a complete WRS-2 dataset and the entirety of the GADM v4.1 database.
Warning
This function will not warn about incorrect CRS's. The only cases in which projection errors may be caught are: a previous reprojection resulted in invalid geometries, the supplied spatial reference object does not have it's semi-major or inverse-flattening set, latitudinal values exceed +/- 90°.

fastMultipolygonialGeodesicArea(), fastPolygonialGeodesicArea(), fastLinearRingGeodesicArea()

Parameters
geometryReference to a valid geometry object whose area should be calculated. The object is not required to have a CRS assigned to it.
spatialReferenceReference to spatial reference object which describes the CRS of geometry.
Returns
double Area of geometry, -1.0 on error.

◆ fastLinearRingGeodesicArea()

double fastLinearRingGeodesicArea ( const OGRGeometryH geometry,
const struct geod_geodesic * g )

Fast Computation of Geodesic Area for Linear Rings.

Perform geodesic area calculation in case geometry is a linear ring. This geometry type is not a standard WKB/WKT type but represents the individual exterior/interior rings that comprise polygons, multipolygons, etc. The same restrictions as for fastGeodesicArea(), fastMultipolygonialGeodesicArea() and fastPolygonialGeodesicArea() apply, i.e. no checks for the validity and/or adequacy of the geometrie's CRS is performed. However, in contrast to those functions, the notion of a "valid geometry" does not hold and the caller is responsible for making sure the input is sensible, e.g. extracted from an already exisitng polygon.

Warning
This function will not warn about incorrect CRS's. The only cases in which projection errors may be caught are: latitudinal values exceed +/- 90°.

fastGeodesicArea(), fastMultipolygonialGeodesicArea(), fastPolygonialGeodesicArea()

Parameters
geometryReference to linear ring geometry.
gReference to an initialized struct geod_geodesic. Needed by PROJ for geodesic operations.
Returns
double Area of geometry, -1.0 on error.

◆ fastMultipolygonialGeodesicArea()

double fastMultipolygonialGeodesicArea ( const OGRGeometryH geometry,
const struct geod_geodesic * g )

Fast Computation of Geodesic Area for Multipolygons.

Perform geodesic area calculation in case geometry is a multi- polygon. The same restrictions as for fastGeodesicArea(), fastPolygonialGeodesicArea() and fastLinearRingGeodesicArea() apply, i.e. no checks for the validity and/or adequacy of the geometrie's CRS is performed.

Warning
This function will not warn about incorrect CRS's. The only cases in which projection errors may be caught are: latitudinal values exceed +/- 90°.

fastGeodesicArea(), fastPolygonialGeodesicArea(), fastLinearRingGeodesicArea()

Parameters
geometryReference to a valid multipolygonal geometry.
gReference to an initialized struct geod_geodesic. Needed by PROJ for geodesic operations.
Returns
double Area of geometry, -1.0 on error.

◆ fastPolygonialGeodesicArea()

double fastPolygonialGeodesicArea ( const OGRGeometryH geometry,
const struct geod_geodesic * g )

Fast Computation of Geodesic Area for Polygons.

Perform geodesic area calculation in case geometry is a polygon. The same restrictions as for fastGeodesicArea(), fastMultipolygonialGeodesicArea() and fastLinearRingGeodesicArea() apply, i.e. no checks for the validity and/or adequacy of the geometrie's CRS is performed.

Warning
This function will not warn about incorrect CRS's. The only cases in which projection errors may be caught are: latitudinal values exceed +/- 90°.

fastGeodesicArea(), fastMultipolygonialGeodesicArea(), fastLinearRingGeodesicArea()

Parameters
geometryReference to a valid polygonal geometry.
gReference to an initialized struct geod_geodesic. Needed by PROJ for geodesic operations.
Returns
double Area of geometry, -1.0 on error.