Select to view content in your preferred language

incorrect geodeticLengthOperator geodeticArea Operator measurements in imperial units.

139
1
a week ago
LefterisKoumis
Frequent Contributor

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

LefterisKoumis_1-1763576466016.png

LefterisKoumis_2-1763576497026.png

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!!

LefterisKoumis_3-1763576705256.png

LefterisKoumis_4-1763576725215.png

I don't see anywhere in the documentation stating to use unit instead of units for geodetic measurements.

 

 

0 Kudos
1 Reply
AndyGup
Esri Regular Contributor

@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..

0 Kudos