ST_GeodesicArea

ST_GeodesicArea takes a geometry column and returns a double column. The output column contains the geodesic area of the input geometry in square meters. For point, multipoint, and linestring geometries this function will always return 0. This function is more accurate but less performant than ST_Area and requires that a spatial reference is set on the input geometry column. To learn more about the difference between planar and geodesic calculations see Coordinate systems and transformations.

FunctionSyntax
Pythongeodesic_area(geometry)
SQLST_GeodesicArea(geometry)
ScalageodesicArea(geometry)

For more details, go to the GeoAnalytics Engine API reference for geodesic_area.

This function implements the OpenGIS Simple Features Implementation Specification for SQL 1.2.1.

Examples

PythonPythonSQLScala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

from geoanalytics.sql import functions as ST, Polygon
from pyspark.sql import functions as F

data = [
    (Polygon([[[202900.46, 8452626.36], [125775.16, 9047372.23], [592624.25, 9047372.23],
               [956021.25, 8452626.36], [202900.46, 8452626.36]]]),)
]

df = spark.createDataFrame(data, ["polygon"])\
          .withColumn("polygon", ST.srid("polygon", srid=54008))\
          .withColumn("geodesic_area", F.round(ST.geodesic_area("polygon"),3))\
          .withColumn("planar_area", F.round(ST.area("polygon"), 3))

df.select("geodesic_area","planar_area").show(truncate=False)
Result
1
2
3
4
5
+-------------------+-------------------+
|geodesic_area      |planar_area        |
+-------------------+-------------------+
|3.49464648969709E11|3.62786023827199E11|
+-------------------+-------------------+

Version table

ReleaseNotes

1.0.0

Python and SQL functions introduced

1.5.0

Scala function introduced

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close