POST
|
Darren, Yes, that was it!! I felt like I made a touchdown in a football game after watching it begin to run! Thanks for the help!
... View more
02-15-2017
04:17 AM
|
1
|
0
|
1483
|
POST
|
Greetings, I have trying to snap points to a line only where an attribute matches between the two, however, python skills are limited. I have a point shapefile called snappingtooltest with the field "LRSLRM" that contains a matching attribute and a feature class called Funct_Cl_3 with a field named "RCLINK" that contains the attribute to match to. I am running ArcGIS through the Citrix environment. Here is my code with the inserted values I have: import arcpy
arcpy.env.workspace = "\\gdot.ad.local\gdot\Operations\Traffic_Operations\tmc\TSafety\Maps\FunctionalClass\TestingData\snappingtooltest"
print "creating cursor..." #creating cursor for a list of all the names in crash layer
cursor_snappingtooltest = arcpy.SearchCursor("snappingtooltest")
print "emptying list for snappingtooltest names..." #empty list for names
list_snappingtooltest_names = []
print "filling the list with names from snappingtooltest layer..."#filling the list with names from snappingtooltest layer
for row in cursor_snappingtooltest:
list_snappingtooltest_names.append(row.getValue("LRSLRM")
print "another empty list..."
#another empty list for storing only unique names from list_snappingtooltest_names
s = []
for i in list_snappingtooltest_names:
if i not in s:
s.append(i)
print "selecting snappingtooltest and Funct_Cl_3 by name..." #selecting snappingtooltest and Funct_CL3 by name:
for name in s:
print "selecting ....",name
layer1 = arcpy.SelectLayerByAttribute_management("snappingtooltest", "NEW_SELECTION", "LRSLRM="+"'"+name+"'")
layer2 = arcpy.SelectLayerByAttribute_management ("Funct_Cl_3", "NEW_SELECTION", "RCLINK="+"'"+name+"'")
print "executing snap"
arcpy.Snap_edit("snappingtooltest", [["Funct_Cl_3", "Edge", "350 feet"]])
print "Clear the selection and refresh the active view...." # Clear the selection and refresh the active view
arcpy.SelectLayerByAttribute_management(snappingtooltest, "CLEAR_SELECTION")
arcpy.SelectLayerByAttribute_management("Funct_Cl_3", "CLEAR_SELECTION")
print "done !!" And, at this point anyway and I know there will be more, here is the error I am getting: Parsing error SyntaxError: invalid syntax (line 10) Thanks for the help!!
... View more
02-13-2017
06:05 AM
|
0
|
4
|
1483
|
POST
|
Darren, I finally got the script to work by exporting the fc into a shapefile. And now receiving this error message: Runtime error Traceback (most recent call last): File "<string>", line 49, in <module> File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 3052, in AddField raise e ExecuteError: ERROR 000732: Input Table: Dataset in_memory\points does not exist or is not supported Brian
... View more
02-16-2016
07:10 PM
|
0
|
0
|
1494
|
POST
|
Darren, I also thought of completing this task similar to what your image shows. It seems it should be somewhat simple; buffer points at intersections by 100 ft, convert the buffers to a line, and simply clip the arc of each resulting line where the roads intersect the circular line. Any circular line that has been clipped from a roadway line that has a arc length between the parameters of 1ft to 122.17ft (at a radius of 100ft) would be an intersection where a roadway has an intersecting roadway of less than 70 degrees. The problem I had with this method is that the process returned many arcs lengths from the buffered lines that were actually not due to the clipping function but rather due to the fact that they were not completely closed lines and thus left short arcs... Your model looks very promising and seems a good method to use; however, I keep getting error messages when put into the python window. I haven’t much experience with python. example: Runtime error Traceback (most recent call last): File "<string>", line 9, in <module> File "c:\program files (x86) \arcgis\desktop10.2\arcpy\arcpy\management.py", line 4021, in Dissolve raise e ExecuteError: ERROR 000369: Invalid input field(s) Hope this makes sense... And, thanks for the help!!
... View more
02-14-2016
06:28 PM
|
0
|
0
|
1494
|
POST
|
Hi Wes, It's me again with problems with the angles of roadways. I have found the tool you provided, which is pretty awesome, has the tendency to produce a point on angles that are greater than the parameters set in the model. Although the tool does find these angles at intersections, it tends to produce some outside the parameters set. These extra points that are suppose to signify angles within the tool parameters are always located where buffers overlap. What do you think? Can these be removed somehow via your tool? Thanks!
... View more
02-04-2016
11:45 AM
|
0
|
1
|
1494
|
POST
|
Wes, I edited the model again using file geodatabases instead of the "in_memory" modules and YES, the model completes and stores the intersection locations that have the upper and lower limit angles. Awesome! I HAVE to learn Python!! Thanks!!
... View more
01-27-2016
11:10 AM
|
0
|
3
|
4520
|
POST
|
The last reply didn't have an "attach" tool located on it... Attached is a county dataset. As I said earlier, the model will not offer any results on this county either, although it does run and complete. I have also attached here again the "findAngle" tool to check if I have corrupted it... Thanks again for your help! Brian
... View more
01-27-2016
09:50 AM
|
0
|
0
|
4520
|
POST
|
Wes, Sorry for the delayed response. Been kind of busy. Yes, I have attached a county with a roadway layer here. I have tried running the model several more times and now I cannot get any results at all to show in the table of contents. Did I mess something up? I have also attached the model again here to verify whether or not I have corrupted it... I even tried removing the original model and reinstalling it into the "Toolbox" in ArcMap... Thanks, Brian
... View more
01-27-2016
09:35 AM
|
0
|
0
|
4520
|
POST
|
Wes, Thanks! I ran the model and it failed with this error: Assembling Features... Succeeded at Mon Jan 25 11:06:26 2016 (Elapsed Time: 2 minutes 4 seconds) Executing (Generate Near Table): GenerateNearTable in_memory\roadsIntersect in_memory\Roads_Intersect_Buffer_Inter in_memory\nearTable "51 Feet" NO_LOCATION ANGLE ALL 0 PLANAR Start Time: Mon Jan 25 11:06:27 2016 Determining data processing extents... Building a neighborhood index from the Near Features... Generating Near Table... Found 346 feature(s) within 51.000000 Succeeded at Mon Jan 25 11:06:27 2016 (Elapsed Time: 0.56 seconds) Executing (findLessThanAngle): findLessThanAngle 50 5 in_memory\roadsIntersect in_memory\nearTable Start Time: Mon Jan 25 11:06:27 2016 Running script findLessThanAngle... Failed script findLessThanAngle... Traceback (most recent call last): File "Y:\GISData\Tools\FindAngletoolbox\findAngle.tbx#findLessThanAngle.py", line 37, in <module> NameError: name 'each' is not defined Failed to execute (findLessThanAngle). Failed at Mon Jan 25 11:06:28 2016 (Elapsed Time: 0.23 seconds) I deleted the "each" out of the python code, ran it, but it only gave me 22 intersecting roadways with angles of < than 50 degrees out of 2299 total...I wasn't sure if it was my python code editing that gave me the short list. I know very little about python. It is in my toolbox of things to do, no pun intended. Other than that, it does look promising! Thanks again for your help!
... View more
01-25-2016
09:49 AM
|
0
|
7
|
4520
|
POST
|
Thanks for the help Wes! It looks as though this tool returns angle values in relation to North, South, East, or West. I am looking for a method that returns an angle where 2 lines intersect. In addition, I have a least a few hundreds of thousands of intersecting lines to measure those angles... We are trying to find all the intersecting roadways in the state that are at an angle of less than 40 degrees, where they intersect, and run crash rates and analyses. Do you still think this tool will do the job of measuring those angles? Thanks again for the prompt response!
... View more
01-23-2016
12:13 PM
|
0
|
10
|
4520
|
POST
|
I need to find angles of streets where they intersect with roadways covering the entire state. Does anyone have a method and/or tools in mind?
... View more
01-21-2016
11:17 AM
|
0
|
32
|
19641
|
Title | Kudos | Posted |
---|---|---|
1 | 02-15-2017 04:17 AM |
Online Status |
Offline
|
Date Last Visited |
05-22-2023
01:24 PM
|