Esri / geometry-api-java

The Esri Geometry API for Java enables developers to write custom applications for analysis of spatial data. This API is used in the Esri GIS Tools for Hadoop and other 3rd-party data processing solutions.
Apache License 2.0
694 stars 260 forks source link

hello calculateArea2D() What is the unit of the result? #289

Closed coikoo closed 2 years ago

stolstov commented 2 years ago

@coikoo The units of the result are the units of the geometry. Whatever the X and Y units are, the area units are the XY unit squared.

coikoo commented 2 years ago

thanks but the default unit miles of X or Y ?

stolstov commented 2 years ago

You could make a square polygon 0 0, 0 10, 10 10, 10 0, 0 0. This has area of 100. It is a simple geometric calculation and no units are assumed.

coikoo commented 2 years ago

ok Geometry geometry = OperatorImportFromWkt.local().execute(WktImportFlags.wktImportDefaults, Geometry.Type.Polygon, "POLYGON ((116.36595368385314 39.90577767315247, 116.37009501457214 39.90577767315247, 116.37009501457214 39.91022178037102, 116.36595368385314 39.91022178037102, 116.36595368385314 39.90577767315247))", null); System.out.println(geometry.calculateArea2D()); This is the area I selected I know the value of area, but I don't know how to express it. Square meters or square miles

DaveInCaz commented 2 years ago

@coikoo It entirely depends on the input data.

For example, were the points such as (116.36595368385314 39.90577767315247) measured in meters? If so than the area is m². If miles, then its square miles, and so on.

To the best of my knowledge this library does not know anything about these units and its up to you to format and display the data appropriately.

randallwhitman commented 2 years ago

If the coordinate unit is degrees, then the area unit is square degrees.

coikoo commented 2 years ago

thanks