Extend line to specific distance or a line

17143
13
Jump to solution
01-07-2016 12:35 AM
MonirRahman
New Contributor II

I want to extend my polyline to a given distance. How can I do this. I have attached image to clear my specification.

I am using .net in arcmap . I am also using python

Thanks.

Tags (3)
0 Kudos
13 Replies
LukeSturtevant
Occasional Contributor III

Hi Britta Schroeder‌. Sorry to hear the script isn't working for you. Amazingly after 5 years I downloaded the script tool and ran it on some sample data in a geodatabase and it worked. I'm guessing that error you are seeing is due to a schema lock on the data or perhaps the environment the data are in. Additionally, you could try initiating an edit session in the script by using arcpy.da.Editor before the script enters the update cursor near the end of the script. You could also try exporting the data to a shapefile or possibly a new geodatabase and testing the script on the new export.

Britta_Schroeder
New Contributor II

Thanks, Luke Sturtevant‌, it was user error: my dataset was GCS with degree units and I was trying to enter a number intended for meters (which exceeded 360). It works great with the right units (said NASA).

0 Kudos
LukeSturtevant
Occasional Contributor III

Ahh okay. Yes, that script could certainly be refined to do some linear conversions based on spatial reference of the input or force a consistent projected spatial reference throughout processing regardless of the inputs. Glad you got it to work though!

0 Kudos
lsturtevant
New Contributor II

Apologies for the late reply @Britta_Schroeder. We no longer have access to ArcMap on our systems so I cannot troubleshoot the error you are experiencing. Line 54 is simply compiling coordinate pairs into a list. It could be that older versions of Python in ArcMap are not compatible with the zip list function that is being called here or perhaps there is an issue with some of your lines. Also, the tools assumes that the data are in a projected coordinate system with a linear reference of meters or feet so if your data are in a geographic coordinate system this could also be causing issues.

0 Kudos