Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

How to Shrink a Polyline

icisneroz
6 - Meteoroid

I have a line that I drew using lat longs in Alteryx using the create points and then the polyline tool and I would like to shrink the length of the line by 500 feet. I've tried the buffer tool but anytime I put in a negative value it doesn't work.

 

Does Alteryx have the ability to "shrink" polylines?

2 REPLIES 2
SydneyF
Alteryx Alumni (Retired)

Hi @icisneroz

 

The following workflow is an option for shrinking your polyline:

 

2017-11-06_16-48-26.png

 

(1) Connect your polyline to the Spatial Info Tool and Create End Points as Spatial Objects (Or you can use the points you've already created to build the polylines).

(2) Using the Buffer Tool, create a 500 ft buffer around the end you want the line to shrink by. If you want to shrink from both ends, first transpose your data, setting everything but your start and end points as key fields, and create a 250 ft buffer around your Value field (an output of the Transpose Tool). Then, combine your buffers into a single object using the Summarize Tool. (Group by line name, Combine Spatial Objects: Spatial > Combine)

(3) Join your buffer object and line object back together, using the line label as the join field.

(4) Use the Spatial Process Tool to cut the buffers out of the line. The resulting object is a shrunk line.

 

I've attached the workflow that performs this process on some sample polylines. 

 

Let me know if this isn't what you were thinking!

jdunkerley79
ACE Emeritus
ACE Emeritus

I couldn't spot how to do using built in tools ( @SydneyF solution probably better than this )  but thought would have a go from geometry and using spatial formulae

2017-11-07_18-07-11.jpg

 

- keep start point same

- scale distance of each line (I chose percentage scaling but trivial to change in the formula tool)

- keep bearing constant

- use a multi row formula to walk the line producing new points

 

Formula used is in this page http://www.movable-type.co.uk/scripts/latlong.html

 

Workflow and macro attached

Labels