Closed coikoo closed 2 years ago
thanks but the default unit miles of X or Y ?
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.
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
@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.
If the coordinate unit is degrees, then the area unit is square degrees.
thanks
@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.