create points along line varying distances

3183
7
09-25-2019 05:19 AM
HaakonJørlo_Haugerud
New Contributor

Hi,

I am trying to make a python script that will do the equivalent to that of selecting a point feature editing this and creating "Points along line" with "Varying Distances".

This will give a menu like this one:

Where you will have to plot the distances manually. The next row will indicate the distance relative to the previous point.

I have a lot of points I'd like to plot in and therefore I want the stuff to go automatically.

So far I've had a look into using something like this:

>>> arcpy.GeneratePointsAlongLines_management(line2choose,"pntsAlongLine","DISTANCE",[10,20,10])

The list i've made at the end obviously won't work.

I've also had a look to the possibility of importing an excel file with the ID and Distance columns and creating points from this. If arcpy has a function to add a single point along a line with a specific distance from start I could do a loop and generate all the points from the imported table. So far I haven't found such a function.

Br,

Haakon Haugerud

0 Kudos
7 Replies
Scott_Harris
Esri Regular Contributor

Hi,

It would be a neat enhancement for the Create Points Along Lines and the Offset editing tools (both found on the Edit ribbon > Modify features pane) to be able to import distance values from a file  - currently not possible. However, have you tried the Linear Referencing toolbox (Analysis tab > Tools > look for Linear Referencing Tools). I think the only two geoprocessing tools you would need are Create Routes and Make Route Event Layer.

An overview of the Linear Referencing toolbox—Help | ArcGIS Desktop 

These two tutorials are written for ArcMap, but show how to use the above geoprocessing tools:

Exercise 2: Creating and calibrating route data—Help | ArcGIS Desktop 

Exercise 4: Displaying and querying route events—Help | ArcGIS Desktop 

Hope this helps!

Scott

HaakonJørlo_Haugerud
New Contributor

Thanks Scott.

I am trying to use the Linear Referencing tools now, but have a question.

Right now I am trying to make a Route Event Layer with my Route and an input event table. But I got the error that "ERROR 000840 The value is not a Route Measure Event properties". Trying to find a way to choose that the Field is a route event field, but I am having problems.

0 Kudos
Scott_Harris
Esri Regular Contributor

I'm not sure about why that could be, but a quick search on Geonet reveals someone who found a solution for their specific case:

https://community.esri.com/thread/101652#comment-658022 

If that doesn't work, maybe a quick call to Esri Technical Support will help? - Esri Support Contact Support 

0 Kudos
HumaTariq
New Contributor

Hi, 

I am wondering, you had any luck in figuring that out? I also need to create thousands of points along the line at varying (known) distances but unable to find any way of doing that.

0 Kudos
JohnFenton
New Contributor

Looks like your Route Identifier Field was pointed at a Distance value in attributes of the original polyline used to create the route.  It needs to point to a unique route ID that is common to the entire polyline *and* the table of distances you'll use when you display route events. So if you add routeID as an attribute of the polyline before you turn it into a route, and then use that same routeID as an attribute of your table of distances, the two will work together nicely.

 

If you have a table with the distances down the line in it, you don't need to enter them manually using Create Points Along Line tool.

Create a route from your polyline - https://pro.arcgis.com/en/pro-app/2.9/tool-reference/linear-referencing/create-routes.htm (you'll need to add an attribute for route identifier)

Then add events to your route using that table of distances down the line - https://pro.arcgis.com/en/pro-app/2.9/help/data/linear-referencing/display-route-events.htm (you'll need to include the same attribute value for route identifier that your used on the polyline that you turned into a route in the previous step)

 

You can take the resulting events layer and export them as points along the polyline.

 

I know this is a really late response, but I searched for a long time trying to find out how to do this in a way other than entering each point distance one at a time...

0 Kudos
tari
by
New Contributor II

Hi all: 

I am in the same position as well. 

I need to make a point feature class along a line with varying and known distances but unable to find a way to do that. I have also tried using similar approach mentioned a the beginning of this thread and did not make any progress.

Any suggestions please? 

0 Kudos
fresi09
New Contributor II

Hi, 

did you got a solution?

Thanks

0 Kudos