POST
|
It crashed again. 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. I'll update it to 10.2 and check again. Sorry for the inconvennience and thank you all for your answers.
... View more
12-17-2013
03:37 PM
|
0
|
0
|
142
|
POST
|
Hi, 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) I also found something here : http://www.arcgis.com/home/item.html?id=a2a41c8345e24ab6a9dd2ae215710b39 However here also my installation method should have not worked 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. Concerning my home script, I have changed some things in the 18th line : with arcpy.da.SearchCursor(inLine, ['SHAPE@LENGTH','SHAPE@']) as cursor: I deleted the spatial reference, and changed the " by '. However now the error I got is : <type 'exceptions.AttributeError'>: 'module' object has no attribute 'da' Failed to execute (PointAlongLine). 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. 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. 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??? Should I try to found another computer with arcGIS / contact the IT services / contact Esri? Thanks
... View more
12-16-2013
06:20 PM
|
0
|
0
|
848
|
POST
|
Alright, I am sorry if it wasn't clear. 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": [ATTACH=CONFIG]29903[/ATTACH] I obtained this kind of thing: [ATTACH=CONFIG]29904[/ATTACH] Now I want to do that for 400m, 450, etc... I also would like to add other tools like buffer and calcululations around my stations. Thus, I need an automatic process such as a script. And the "editor" toolbar doesn't work with modelbuilder. So I've read that I could create a SearchCursor on my polyline.shp to get the "positionAlongLine" Then I would use an InsertCursor on an empty point.shp That's what my script tried to do 😮
... View more
12-15-2013
11:04 PM
|
0
|
0
|
848
|
POST
|
Hi Dan, Thx for the tool. It takes me some time to understand how it works! 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 🙂 [ATTACH=CONFIG]29902[/ATTACH] 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 😞
... View more
12-15-2013
10:39 PM
|
0
|
0
|
848
|
POST
|
Hi, Thanks for the quick answer but it didn't work. In fact I already tried 😞 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)
... View more
12-15-2013
09:09 PM
|
0
|
0
|
848
|
POST
|
Hello, I'm sorry to waste your time with this redundant question but I have read many threads and all the arcGIS help I could... 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. Here is my current code: 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:
length = row[0]
noIntervals = int(math.floor(length / interval))
lastSegLength = length - (interval * noIntervals)
for x in range(1, noIntervals):
newPt = row[1].positionAlongLine(interval * x)
icursor.insertRow((newPt))
if lastSegLength < lineClusTol:
lastPt = row[1].positionAlongLine(interval * noIntervals + lastSegLength)
else:
lastPt = row[1].positionAlongLine(interval * noIntervals)
icursor.insertRow((lastPt)) And this line is the one which makes many trouble, because of a "syntax" error. with arcpy.da.SearchCursor(inLine, ("SHAPE@LENGTH","SHAPE@"),, sr) as cursor: If anyone could explain me where I'm wrong, it'd be wonderfull! Thx!
... View more
12-15-2013
05:11 PM
|
1
|
11
|
4819
|
Title | Kudos | Posted |
---|---|---|
1 | 12-15-2013 05:11 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|