Polygon area on geoid

Hi all, is it possible to estimate the area of a lat-lon-box with Geodesy.jl? Many thanks!

1 Like
using GMT
julia> r = gmt("gmtspatial -Qk -fg", [0 0; 0 1; 1 1; 1 0; 0 0])
1-element Array{GMT.GMTdataset,1}:
 GMT.GMTdataset([0.5 0.50002 12308.3], Any[], "", Any[], "", "")

julia> r[1].data
1×3 Array{Float64,2}:
 0.5  0.50002  12308.3

The area is the last figure, that is 12308.3 km^2. Se the man page of the gmtspatial GMT program for more details

Thank you very much - but the question was if this was possible using Geodesy.jl. The reason is that I use julia on a remote server where I cannot load the library “libgmt”.

@mafla you can convert the coordinates of the polygon to Cartesian coordinates with Geodesy.jl and then use Meshes.jl to compute the area with area(polygon).

1 Like

@juliohm, in order to correctly take into account the curvature of the geoid, do we need to add control points inside the polygon that lie on the geoid, to help Meshes.jl?

Thinking of an extreme case: the area above the latitude of the Artic Circle that otherwise would be calculated as a flat disk.

1 Like

Good point @rafael.guerra , probably a good idea :100:

I am planning to take a closer look at curved geometries in Meshes.jl next year :pray:t4:

1 Like

GMT.jl geomarea method calls GDAL and I think it ends up calling the a geographiclib function for geodetic polygons but I’m not finding the docs sustaining this later claim.

1 Like