convert geometry measurement into meters

719
1
09-18-2012 03:57 AM
alessandroferrucci
New Contributor
Hi I have a polyline that I'm drawing on the map and I'd like to calculate its length in meters.

Currently I do this:
distanceSeg=new Polyline();
double  len1=distanceSeg.calculateLength2D();
double m_len=Unit.convertUnits(len1, Unit.create(AngularUnit.Code.DEGREE) ,Unit.create(LinearUnit.Code.METER));


but the call to Unit.convertUnits throws  a GeometryException...any idea what I'm doing wrong?

Thanks,
0 Kudos
1 Reply
NimeshJarecha
Esri Regular Contributor
Which platform are you working with? This forum is for ArcGIS Runtime SDK for iOS. Please post your question in appropriate forum.

Regards,
Nimesh
0 Kudos