<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create points along a line in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369397#M29167</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All densify programs will retain the original points and add auxiliary points as needed.&amp;nbsp;&amp;nbsp; I sounds like you want to remove the points that make up the original shapefile, however, this will change the shape of the original polyline which is not appropriate nor desired.&amp;nbsp; You will need to filter out those points, however the interpoint distance between two densified points may not be accurate if you remove one of the original points.&amp;nbsp;&amp;nbsp; You will have to clarify what you want to do if densification is not appropriate&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Dec 2013 06:49:14 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2013-12-16T06:49:14Z</dc:date>
    <item>
      <title>Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369392#M29162</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sorry to waste your time with this redundant question but I have read many threads and all the arcGIS help I could...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My aim is to position points with a specified distance along a polyline. I want to use a script so then I can automatize the thing with a model builder or something. I have arcGIS 10.1 without spatial extensions or other things.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my current code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy
import os
import sys

#import parameters from textbox

inLine = arcpy.GetParameterAsText(0)
outPoints = arcpy.GetParameterAsText(1)
interval = arcpy.GetParameterAsText(2)
lineClusTol = arcpy.GetParameterAsText(3)

#Define the function

sr = arcpy.Describe(inLine).spatialReference
inLineName = arcpy.Describe(inLine).name
segPts = outPoints
icursor = arcpy.da.InsertCursor(segPts)
with arcpy.da.SearchCursor(inLine, ("SHAPE@LENGTH","SHAPE@"),, sr) as cursor:
 for row in cursor:
&amp;nbsp; length = row[0]
&amp;nbsp; noIntervals = int(math.floor(length / interval))
&amp;nbsp; lastSegLength = length - (interval * noIntervals)
&amp;nbsp; for x in range(1, noIntervals):
&amp;nbsp;&amp;nbsp; newPt = row[1].positionAlongLine(interval * x)
&amp;nbsp;&amp;nbsp; icursor.insertRow((newPt))
&amp;nbsp; if lastSegLength &amp;lt; lineClusTol:
&amp;nbsp;&amp;nbsp; lastPt = row[1].positionAlongLine(interval * noIntervals + lastSegLength)
&amp;nbsp; else:
&amp;nbsp;&amp;nbsp; lastPt = row[1].positionAlongLine(interval * noIntervals)
icursor.insertRow((lastPt))&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And this line is the one which makes many trouble, because of a "syntax" error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;with arcpy.da.SearchCursor(inLine, ("SHAPE@LENGTH","SHAPE@"),, sr) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If anyone could explain me where I'm wrong, it'd be wonderfull!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 01:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369392#M29162</guid>
      <dc:creator>SévérianDuplaquet</dc:creator>
      <dc:date>2013-12-16T01:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369393#M29163</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Try to give the second parameter to the cursor as a python list (closed in square brackets). &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can try to use the densify GP Editing tool to create line with Vertices and then use&amp;nbsp; Feature Vertices to Points (GP Data Management -&amp;gt; Features) to create points form the Vertices.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have fun&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Mody&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 04:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369393#M29163</guid>
      <dc:creator>ModyBuchbinder</dc:creator>
      <dc:date>2013-12-16T04:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369394#M29164</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the quick answer but it didn't work. In fact I already tried &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The densify + create points from vertice tools may probably not work as my polylines are not straight: I already have vertice on my lines. I also know the way to use "events" on "roads" but I haven't yet read the help on this because my script is almost done. If nothing work I will try other methods! I also tried to download the ET Geowizzard thing but it didn't want to be instal on my computer (a dll is missing or something like this)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 05:09:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369394#M29164</guid>
      <dc:creator>SévérianDuplaquet</dc:creator>
      <dc:date>2013-12-16T05:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369395#M29165</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does this tool set return the same results?&amp;nbsp; &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=78a1185b95eb4bf18c7340353ab2364d"&gt;http://www.arcgis.com/home/item.html?id=78a1185b95eb4bf18c7340353ab2364d&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 05:53:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369395#M29165</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2013-12-16T05:53:19Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369396#M29166</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Dan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thx for the tool. It takes me some time to understand how it works!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway I gave it a try and that is almost what I want but there are still points which are incorect (I take a picture and circled). I want to avoid this kind of things &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29902[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have look at your code and that is way too hard for my current understanding. I'll however try to analyse it and maybe I can figure why my syntaxe is incorect &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 06:39:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369396#M29166</guid>
      <dc:creator>SévérianDuplaquet</dc:creator>
      <dc:date>2013-12-16T06:39:34Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369397#M29167</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;All densify programs will retain the original points and add auxiliary points as needed.&amp;nbsp;&amp;nbsp; I sounds like you want to remove the points that make up the original shapefile, however, this will change the shape of the original polyline which is not appropriate nor desired.&amp;nbsp; You will need to filter out those points, however the interpoint distance between two densified points may not be accurate if you remove one of the original points.&amp;nbsp;&amp;nbsp; You will have to clarify what you want to do if densification is not appropriate&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 06:49:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369397#M29167</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2013-12-16T06:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369398#M29168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Alright, I am sorry if it wasn't clear.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have done what I want to do mannually with the "editor". I have a polyline (a corridor for buses) and want to find stations every 500 meters. To do that I created an empty points.shp. Then I edited each feature of my polyline by using "construct points":&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29903[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I obtained this kind of thing:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]29904[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I want to do that for 400m, 450, etc...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I also would like to add other tools like buffer and calcululations around my stations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thus, I need an automatic process such as a script. And the "editor" toolbar doesn't work with modelbuilder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So I've read that I could create a SearchCursor on my polyline.shp to get the "positionAlongLine"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I would use an InsertCursor on an empty point.shp&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;That's what my script tried to do &lt;span class="lia-unicode-emoji" title=":face_with_open_mouth:"&gt;😮&lt;/span&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 07:04:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369398#M29168</guid>
      <dc:creator>SévérianDuplaquet</dc:creator>
      <dc:date>2013-12-16T07:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369399#M29169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I think that you should try with linear referencing tools. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) create route from your line&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) create a table with a list of locations along the route&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3) create point events on your line&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope this help&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 09:27:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369399#M29169</guid>
      <dc:creator>JulienRadoux</dc:creator>
      <dc:date>2013-12-16T09:27:47Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369400#M29170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The tool here creates a new point file without altering the original feature geometries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="ftp://lnnr.lummi-nsn.gov/GIS_Scripts/CreatePointsAlongALine/"&gt;ftp://lnnr.lummi-nsn.gov/GIS_Scripts/CreatePointsAlongALine/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Dec 2013 14:32:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369400#M29170</guid>
      <dc:creator>GerryGabrisch</dc:creator>
      <dc:date>2013-12-16T14:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369401#M29171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks gabrisch for your tool! I tried to install it but I probably have done a mistake as arcCatalog or ArcMap crash almost instantly when I launch it. I don't even get an error information else than "ArcMap stopped to work etc." (Sorry, no Screenshot - it's useless and my windows is in french)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also found something here : &lt;/SPAN&gt;&lt;A href="http://www.arcgis.com/home/item.html?id=a2a41c8345e24ab6a9dd2ae215710b39"&gt;http://www.arcgis.com/home/item.html?id=a2a41c8345e24ab6a9dd2ae215710b39&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;However here also my installation method should have not worked&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried the route methods. I have never used these kind of tools so I don't really know how to do but I have no location table for my events so I have to create and fill one with Distance. I'm not sure I can do this? (I haven't found a tool/method to add empty records to an empty table). I might be wrong but as I said I never used these tools.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Concerning my home script, I have changed some things in the 18th line :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;with arcpy.da.SearchCursor(inLine, ['SHAPE@LENGTH','SHAPE@']) as cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I deleted the spatial reference, and changed the " by '.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;However now the error I got is :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;type 'exceptions.AttributeError'&amp;gt;: 'module' object has no attribute 'da'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (PointAlongLine).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I understand well, it is because I haven't import the "da" module. So I tried something like "from arcpy import da" or even "from arcpy import *" but he is unable to found it.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I then reached my ArcGIS files and I can't find da.py or data_analysis.py or nothing like this in the arcpy folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I may have a trouble with my installation - it's an educational version for 1 year. If my "da" script is missing I probably can't launch your script???&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I try to found another computer with arcGIS / contact the IT services / contact Esri?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 02:20:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369401#M29171</guid>
      <dc:creator>SévérianDuplaquet</dc:creator>
      <dc:date>2013-12-17T02:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369402#M29172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry for the problems.&amp;nbsp; I just tested the tool and it runs for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;From the link download the toolbox&amp;nbsp; and the DivideLine.py into a new folder on your computer.&amp;nbsp; Add the toolbox to ArcToolbox and run like any scripting tool.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 17:18:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369402#M29172</guid>
      <dc:creator>GerryGabrisch</dc:creator>
      <dc:date>2013-12-17T17:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create points along a line</title>
      <link>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369403#M29173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It crashed again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But I did a terrible mistake: I told you I used ArcGIS 10.1 (as I thought) but after checking again it is only 10.0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll update it to 10.2 and check again. Sorry for the inconvennience and thank you all for your answers.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Dec 2013 23:37:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/create-points-along-a-line/m-p/369403#M29173</guid>
      <dc:creator>SévérianDuplaquet</dc:creator>
      <dc:date>2013-12-17T23:37:04Z</dc:date>
    </item>
  </channel>
</rss>

