Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Change linear unit of spatial reference for geometry in cursors?

$
0
0
Hi, I want to change the spatial reference linear unit for geometry calculations.

I know you can pass the sr object in cursor, so I tried this:

I read from the document that linearUnitName is both readable and writable.

Code:

sr = arcpy.Describe(inLine).spatialReference
sr.linearUnitName = "Foot"
cursor = arcpy.da.SearchCursor(fc, ["SHAPE@"], "", sr)

but it looks not working.

Could anyone help?:D

I am trying to find points along polylines based on distance, so I need the distance in another unit.

What else could I do?

Viewing all articles
Browse latest Browse all 2485

Trending Articles