Shrink Lines — GP Tool

8637
28
03-20-2023 10:24 AM
Status: Open
Labels (1)
Bud
by
Legendary Contributor

It would be helpful if there were an OOTB geoprocessing tool for shrinking lines at each end. By a measure or a percentage.

Bud_0-1679333021202.png

It would also be good if the tool could stretch out lines too -- using the angle of the last segment at each end. Or make that separate GP tool.

Thanks.

Related: Batch shrink lines at each end

28 Comments
DanLee
by Esri Regular Contributor

Glad to hear that!  

Bud
by

@DanLee and @SeanLim 

Feel free to delete some of the old comments in this thread, such as the comments where I gave feedback, if you think it's appropriate. They might not add much value now that the they've been implemented.

Also, out of curiosity, is the plan to keep the tool shared publicly online -- indefinitely? Or was it planned as a mockup for a future GP tool? Etc.

DanLee
by Esri Regular Contributor

I am not making the decision, but it's likely that the sample tool will be available for as long as people are using it. Regarding future GP tool, I think it would all depends on demand/votes.

 

Giare
by

I have tried to use the tool. The "Percentage" method works well but the "Length" method does not work, at least for me. This is the error i get: 

ValueError: The units value is either invalid or not supported

I have tried to use different units but i keep getting the same error. Anyone else has the same problem? 

DanLee
by Esri Regular Contributor

Hi Giare,

Could you provide a sample data and details about the parameters you used so we can try to reproduce and explain the problem? If you are concerned about posting your data here, please feel free to attach your data in email to me at [email protected].  We will only use your data for internal testing/debugging purposed.  Thanks! - Dan

SeanLim

Hi @Giare, I just did some quick debugging. This seems to be happening because the input data used is not using a Projected Coordinate System, but using a Geographic Coordinate System instead. As you know, linear units do not work in GCSs. A workaround for now is to make sure the input layer is projected to a PCS. I will work on a warning/error to prevent users from encountering this error and update the tool soon. The tool is now updated to throw an error when the input is not projected. Thanks for reporting!

Tool link: https://www.arcgis.com/home/item.html?id=09ac91c60633484c811b79418c5c871d#overview

Giare
by

Hi Sean and Dan. Thank you both for your replies. The problem was indeed the input layer not being projected to a PCS. The tool is now working fine! Thanks

 

 

DanLee
by Esri Regular Contributor

Hi Giare, you are welcome! Thank you for letting us know. I am glad the tool is working for your projected data.