area static method
- Geometry geometry
Calculates the area of the given geometry.
This planar measurement uses 2D Cartesian mathematics to compute the area. It is based upon the SpatialReference of the input geometry. If the input geometry does not use an 'area preserving' spatial reference, the result can be inaccurate. You have two options available to calculate a more accurate result:
- Use a different spatial reference. Use the GeometryEngine.project method to project the geometry to a projected coordinate system that is better suited for area calculations. See Spatial references and Supported map projections for more information.
- Use the geodetic equivalent, GeometryEngine.areaGeodetic.
Geometry must be topologically correct to accurately calculate area. Polygons that are self-intersecting or that have inconsistent ring orientations may produce inaccurate area values. In some cases, area values for polygons with incorrect topology may be negative. Geometries returned by ArcGIS Server services are always topologically correct. To ensure that polygons constructed or modified programmatically are topologically consistent, however, it's best to simplify the input geometry using GeometryEngine.simplify before you call this method.
Supports true curves.
Parameters:
geometry
— A geometry object.
Return Value: The area of the given geometry in the same units as the geometry's spatial reference system.
Implementation
static double area(
Geometry geometry,
) {
_initializeArcGISEnvironmentIfNeeded();
return _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_GeometryEngine_area(
geometry._handle,
errorHandler,
);
});
}