I am trying to use in Google Earth Engine the function
centroid() on a simple polygon. According to the documentation, there seems to exist a method
area() for objects ee.Geometry.Polygon. However, I get an error message with this simple code:
var polygon = ee.Geometry.Polygon([ [[-5, 40], [65, 40], [65, 60], [-5, 60], [-5, 60]] ]); var a = area(polygon); var aa = polygon.area();
"area" is not defined in this scope.
What am I doing wrong?