Polyline.Lengths returns Degrees (as defined per SpatialReference.Unit,) but I would rougher display it in meters.
However AngularUnit does not have a ConvertToMeters methods...
(B.T.W the snippet "LinearUnit - Convert between centimeters and millimeters" is so pathetic...)
You could reproject the data to a Projected Coordinate System.
Project—Data Management toolbox | ArcGIS for Desktop
OR
You could define a Projected coordinate system to new data frame, add the layer using appropriate transformation method. Then, add a new field (say "Len_mtr"; Datatype="Double"). Using Calculate Geometry, you could define the length in linear unit using the coordinate system of the data frame.
I believe you are looking for this ArcGIS Pro 1.3 API Reference Guide
Not Exactly:
While measuring Geodesic lengths is nice, It does not interest me much since I measure roads length.
However the result I get is in Degrees, and I would want it in Meters, which others have given hints but not solutions (like in code...)
The geodesic length is providing shortest path on the ellipsoid. Depending on the length of your geometry you will indeeed see a difference in the actual length value for computed planar length or geodesic length - in either case the GeodesicLength method will provide you the answer in meter in the case the original geometry is a geographic coordinate system.
It is not possible to just convert an angular unit value to a linear unit as there is a dependency on the location on the sphere/geoid/ellipsoid. To transform the information from a geographic coordinate system to a projected system (using linear units) you need to project the geometry. Here is a very nice description about the principles of map projections.
For code examples please take at look at this location.
- Thomas