I am using the example as posted here to calculate the geodetic length and area of a location. Wanted to use imperial units (ft and miles).
So, I changed
const geodesicLength = geodeticLengthOperator.execute(line, { units: "kilometers" });
const planarLength = lengthOperator.execute(line, { units: "kilometers" });
const geodesicArea = geodeticAreaOperator.execute(polygon, { units: "square-kilometers" });
const planarArea = areaOperator.execute(polygon, { units: "square-kilometers" });to:
const geodesicLength = geodeticLengthOperator.execute(line, { units: "miles" });
const planarLength = lengthOperator.execute(line, { units: "feet" });
const geodesicArea = geodeticAreaOperator.execute(polygon, { units: "square-miles" });
const planarArea = areaOperator.execute(polygon, { units: "square-feet" });
Then I noticed that the geodetic measurements were way off incorrect
Then I changed the "units" to "unit" for geodetic measurements
const geodesicLength = geodeticLengthOperator.execute(line, { unit: "miles" });
const planarLength = lengthOperator.execute(line, { units: "feet" });
const geodesicArea = geodeticAreaOperator.execute(polygon, { unit: "square-miles" });
const planarArea = areaOperator.execute(polygon, { units: "square-feet" });
and now I get correct results!!
I don't see anywhere in the documentation stating to use unit instead of units for geodetic measurements.
@LefterisKoumis good catch on the documentation bug in the tutorial. We'll get it changed from unit(s) to unit, which is the correct parameter. It's documented in both the geodeticAreaOperator and geodeticLengthOperator under options..