Bug
Bug ID Number | BUG-000178221 |
---|---|
Submitted | July 25, 2025 |
Last Modified | September 4, 2025 |
Applies to | ArcGIS API for Python |
Version found | 2.4.1 |
Operating System | N/A |
Operating System Version | N/A |
Version Fixed | 2.4.2 |
Status | Fixed |
Use the LengthUnits class to do this:
from arcgis.geometry import Polyline
from arcgis.geometry import lengths, LengthUnits
simple_polyline = Polyline({
"paths": [[[-95.5, 30.2], [-95.6, 30.3]]],
"spatialReference": {"wkid": 4326}
})
print(type(simple_polyline))
print(simple_polyline)
usFeet_simple = lengths(
spatial_ref={"wkid": 4326},
polylines=[simple_polyline],
length_unit=LengthUnits.FOOT,
calculation_type='geodesic',
gis=gis
)
print("Length in US feet (simple):", usFeet_simple)
Bug ID: BUG-000178221
Software:
Get help from ArcGIS experts
Download the Esri Support App