This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I've attached a simple spatial line feature which is about 28km long. How can I easily generate evenly spaced point features along this line? For example, create a point at the start point of the line, and then at each 1km until the end of the feature?
I know I can explode a polyline into its point nodes using poly-split, and I suppose I could do some trigonometry to further subdivide these straight line node-to-node edges to position a point exactly 1km apart. However that sounds like a lot of work.
Is there an easier way to create points along a line? I think in ArcGIS this is trivial, but I appreciate comparing Alteryx with ArcGIS is like comparing apples and pears.
Thank you to @OllieClarke and @jrgo for your speedy and ingenious solutions. I hate to be ungrateful, but what if my line isn't so simple, see attached? I had considered the buffer / radius approach, but realised it would only work for relatively 'unbendy' lines. What about the example below?
yeah, that would definitely through a wrench in my solution. May have to go the macro/iterative route as @OllieClarke had done. Not something I can explore at the moment, but I'll try when i have a chance to if no solution has been marked yet.
I generated a lot of points (0.001 Km intervals) along the original polyline line segments. This retained the accuracy of the original polyline points and gave me very granular distances to group into 1 Km sequences.
Could I trouble you to explain your X and Y calculations?
I have the original polyline input into this section as linear line segments and I've already assigned a number of how many segments I want to break it into (based on the accuracy intervals per length of that linear segment).
- Spatial Info generates start and end points as SpatialObjs. In hindsight, I could make the workflow a little more efficient by generating the Lat/Lon values of the points since that's what I actually use.
- Generate Rows creates a record for each of the accuracy intervals.
- While reviewing this, I realized the Tile tool is redundant since I already have RowCount. I removed it and updated the formulas to reflect this. Sorry for this oversight.
- Now that I know I know the start and end X/Y values and the portion of that distance each accuracy interval needs to travel, I calculate new X and Y values as moving from the start to the end by the X/Y portion that each record represents of that segment. In other words, if I start at 3 and have 4 parts that end at 4, each part is 0.25 closer since everything is linear at this point.
- These new X/Y values create spatial objects with the Create Points tool.
- Select removes unnecessary fields.
I made the version 2 attached that simplifies this section in the ways I mention above.
I downloaded some bike hire data and infilled probable routes between the origin and destination points. I then used the ride duration to subdivide the route into chunks where each output frame = 1 minute of time. I adapted @CharlieS code and changed an integer to a double to split each line differently depending on the ride duration.
Thanks again for your help, I will be presenting on this tomorrow and will flag up how amazing this community is!
This animation was created to publicise the inaugural Edinburgh Alteryx User Group meetup on Wed 30th Oct 2019 - https://www.eventbrite.com/e/edinburgh-alteryx-user-group-mtg-inaugural-registration-73880824535