create points along line varying distances

1649
5
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
5 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
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