|
POST
|
It’s hard to say without tinkering and knowing the data set, but I would try the Locate features Along Routes tool. You could create point or line segments within a certain radius that show where the line segments intersect..
... View more
10-28-2015
04:50 AM
|
0
|
1
|
2020
|
|
POST
|
You should be able to open the table and the should be a column named SHAPE and it would say something like “Polyline M” there may even be a Shape length column..
... View more
10-27-2015
01:59 PM
|
0
|
4
|
2020
|
|
POST
|
Filip, Do you have any experience dealing with in_memory data? I have created a model and the last tool in the model is Make Route event Layer. the problem is the point file that I create earlier in the model gets stored in the GPInMemoryworkspace so the tool fails. Any idea how to access this point layer so I can create my line segment? Thanks, Terry
... View more
10-27-2015
01:54 PM
|
0
|
8
|
3637
|
|
POST
|
Are these line poly line segments and are they measured segments?
... View more
10-27-2015
01:47 PM
|
0
|
6
|
2020
|
|
POST
|
seems to clear memory now but still get this error.. The type of out_event_properties does not match the type of in_features.
... View more
10-27-2015
09:21 AM
|
0
|
0
|
3789
|
|
POST
|
I'm wondering if you can manually edit data paths for a geoprocessing service that is running on your Arcserver that is on Linux? I have a model that I have created that works when I run it in ArcMap unless I set the final segment as an output parameter. The final tool in the model is a make route event layer. The problem is the event points file is in memory. I have tried to export the model to a python script and set the parameter and point the points file to in_memory location but when I create the tool from the python script and run it, it just errors out. I'm trying to find another option to get this thing to work. TIA for any help or direction
... View more
10-27-2015
07:05 AM
|
0
|
0
|
2296
|
|
POST
|
Jake, well I was rooting for your Eagles last night, cant stand Carolina.. I entered that line of code but still get this attached error.
... View more
10-26-2015
06:33 AM
|
0
|
2
|
3789
|
|
POST
|
My first try I created a Python toolbox and received the same error message..
... View more
10-23-2015
08:55 AM
|
0
|
0
|
3789
|
|
POST
|
Jake, When I add the script to the model and run it, it gives the following error.. What I don't understand is that when I run the model before exporting it to the python script it does not hang on the LocateFeaturesAlongRoute. Is there a different syntax in python for this? The input is a line and a table and the output is a point.. Here is the error I get.. Its not even getting to the code that I made changes to..
... View more
10-23-2015
08:48 AM
|
0
|
6
|
3789
|
|
POST
|
I have a model I built in ArcMap. I exported it to a python script and made some changes. Can I import this python script back into model builder?
... View more
10-23-2015
07:37 AM
|
0
|
8
|
7264
|
|
POST
|
Tim, I had a question along this line. I have a model that creates a points table. I wanted to add the Make Route Event Layer tool to the model to create a segment from the points. the problem is when I create the GP service and run it, the points table is in "GPInMemoryWorkspace" so the "Make Route Event" does not see the point event to generate the segment. Can you think of a way around this? Can I point the tool to the in memory location? I exported the model to python. I have searched ESRI help but have not found anything on this subject. # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# seg.py
# Created on: 2015-10-22 10:41:12.00000
# (generated by ArcGIS/ModelBuilder)
# Usage: seg <first_point> <end_point> <merge__3_> <points> <points_Events>
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Load required toolboxes
arcpy.ImportToolbox("E:/MDTAPPS/terry/ref segment.tbx")
# Script arguments
first_point = arcpy.GetParameterAsText(0)
if first_point == '#' or not first_point:
first_point = "E:\\MDTAPPS\\terry\\Default.gdb\\first_point" # provide a default value if unspecified
end_point = arcpy.GetParameterAsText(1)
if end_point == '#' or not end_point:
end_point = "E:\\MDTAPPS\\terry\\Default.gdb\\end_point" # provide a default value if unspecified
merge__3_ = arcpy.GetParameterAsText(2)
if merge__3_ == '#' or not merge__3_:
merge__3_ = "E:\\MDTAPPS\\terry\\Default.gdb\\merge" # provide a default value if unspecified
points = arcpy.GetParameterAsText(3)
if points == '#' or not points:
points = "E:\\MDTAPPS\\terry\\Default.gdb\\points" # provide a default value if unspecified
points_Events = arcpy.GetParameterAsText(4)
if points_Events == '#' or not points_Events:
points_Events = "points Events3" # provide a default value if unspecified
# Local variables:
first_point__2_ = first_point
first_point_Event = first_point__2_
first_point_ev = first_point_Event
Output_Event_Table_Properties = first_point_Event
end_point__2_ = end_point
end_point_Event = end_point__2_
end_point_ev = end_point_Event
end_point_ev_View = end_point_ev
Output_Event_Table_Properties__2_ = end_point_Event
MDTGIS_ROUTES_LRM_RM = "MDTGIS.ROUTES_LRM_RM"
MDTGIS_ROUTES_LRM_DC_MI = "MDTGIS.ROUTES_LRM_DC_MI"
MDTGIS_ROUTES_LRM_DC_MI__2_ = "MDTGIS.ROUTES_LRM_DC_MI"
Default_gdb = "E:\\MDTAPPS\\terry\\Default.gdb"
MDTGIS_ROUTES_LRM_DC_MI__3_ = "MDTGIS.ROUTES_LRM_DC_MI"
# Process: Calculate Field
arcpy.CalculateField_management(first_point, "Corridor", "str(!Corridor!) + \"_\" + str(!RM!)", "PYTHON_9.3", "")
# Process: Make Route Event Layer
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_RM, "ROUTE_ID", first_point__2_, "Corridor POINT beg_offset", first_point_Event, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Locate Features Along Routes
arcpy.LocateFeaturesAlongRoutes_lr(first_point_Event, MDTGIS_ROUTES_LRM_DC_MI, "CORRIDOR", "0 Meters", first_point_ev, Output_Event_Table_Properties, "FIRST", "DISTANCE", "ZERO", "FIELDS", "M_DIRECTON")
# Process: Calculate Field (2)
arcpy.CalculateField_management(end_point, "Corridor", "str(!Corridor!) + \"_\" + str(!RM!)", "PYTHON_9.3", "")
# Process: Make Route Event Layer (2)
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_RM, "ROUTE_ID", end_point__2_, "Corridor POINT end_offset", end_point_Event, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Locate Features Along Routes (2)
arcpy.LocateFeaturesAlongRoutes_lr(end_point_Event, MDTGIS_ROUTES_LRM_DC_MI__2_, "CORRIDOR", "0 Meters", end_point_ev, Output_Event_Table_Properties__2_, "FIRST", "DISTANCE", "ZERO", "FIELDS", "M_DIRECTON")
# Process: Make Table View
arcpy.MakeTableView_management(end_point_ev, end_point_ev_View, "", "", "OBJECTID OBJECTID VISIBLE NONE;RID RID VISIBLE NONE;to_MEAS to_MEAS VISIBLE NONE;Distance Distance VISIBLE NONE;RM RM VISIBLE NONE")
# Process: Merge
arcpy.Merge_management("E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev;end_point_ev_View", merge__3_, "RID \"CORRIDOR\" true true false 10 Text 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev,RID,-1,-1,end_point_ev_View,RID,-1,-1;from_MEAS \"from_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev,from_MEAS,-1,-1;to_MEAS \"to_MEAS\" true true false 0 Double 0 0 ,First,#,end_point_ev_View,to_MEAS,-1,-1")
# Process: Table to Table
arcpy.TableToTable_conversion(merge__3_, Default_gdb, "points", "", "RID \"CORRIDOR\" true true false 10 Text 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,RID,-1,-1;from_MEAS \"from_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,from_MEAS,-1,-1;to_MEAS \"to_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,to_MEAS,-1,-1", "")
# Process: Make Route Event Layer (3)
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_DC_MI__3_, "CORRIDOR", points, "rid LINE from_MEAS to_MEAS", points_Events, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Script1
arcpy.gp.toolbox = "E:/MDTAPPS/terry/ref segment.tbx";
# Warning: the toolbox E:/MDTAPPS/terry/ref segment.tbx DOES NOT have an alias.
# Please assign this toolbox an alias to avoid tool name collisions
# And replace arcpy.gp.Script1(...) with arcpy.Script1_ALIAS(...)
arcpy.gp.Script1()
... View more
10-23-2015
07:02 AM
|
0
|
0
|
1009
|
|
POST
|
Thank you, I thought I posted that I was able to figure it out.. Here is what ended up working for me. table = r"E:\MDTAPPS\terry\Default.gdb\points"
ridList = []
with arcpy.da.SearchCursor(table, ["RID"]) as cursor:
for row in cursor:
ridList.append(row[0])
del cursor
ridList = set(ridList)
for RID in ridList:
toMeasList = []
with arcpy.da.SearchCursor(table, ["RID", "to_MEAS"], "RID = '" + RID + "'") as cursor:
for row in cursor:
toMeasList.append(row[1])
del cursor
toMeasList.sort()
with arcpy.da.UpdateCursor(table, ["to_MEAS"], "RID = '" + RID + "'") as cursor:
for row in cursor:
row[0] = toMeasList[-1]
cursor.updateRow(row)
del cursor
toMeasList.sort()
with arcpy.da.UpdateCursor(table, ["OBJECTID"]) as cursor:
for row in cursor:
if row[0] == 2:
cursor.deleteRow()
del cursor
... View more
10-23-2015
05:53 AM
|
0
|
0
|
818
|
|
POST
|
I exported the model to python and this is the code. I would have thought there would be a local variable for the points_Events # -*- coding: utf-8 -*-
# ---------------------------------------------------------------------------
# seg.py
# Created on: 2015-10-22 10:41:12.00000
# (generated by ArcGIS/ModelBuilder)
# Usage: seg <first_point> <end_point> <merge__3_> <points> <points_Events>
# Description:
# ---------------------------------------------------------------------------
# Import arcpy module
import arcpy
# Load required toolboxes
arcpy.ImportToolbox("E:/MDTAPPS/terry/ref segment.tbx")
# Script arguments
first_point = arcpy.GetParameterAsText(0)
if first_point == '#' or not first_point:
first_point = "E:\\MDTAPPS\\terry\\Default.gdb\\first_point" # provide a default value if unspecified
end_point = arcpy.GetParameterAsText(1)
if end_point == '#' or not end_point:
end_point = "E:\\MDTAPPS\\terry\\Default.gdb\\end_point" # provide a default value if unspecified
merge__3_ = arcpy.GetParameterAsText(2)
if merge__3_ == '#' or not merge__3_:
merge__3_ = "E:\\MDTAPPS\\terry\\Default.gdb\\merge" # provide a default value if unspecified
points = arcpy.GetParameterAsText(3)
if points == '#' or not points:
points = "E:\\MDTAPPS\\terry\\Default.gdb\\points" # provide a default value if unspecified
points_Events = arcpy.GetParameterAsText(4)
if points_Events == '#' or not points_Events:
points_Events = "points Events3" # provide a default value if unspecified
# Local variables:
first_point__2_ = first_point
first_point_Event = first_point__2_
first_point_ev = first_point_Event
Output_Event_Table_Properties = first_point_Event
end_point__2_ = end_point
end_point_Event = end_point__2_
end_point_ev = end_point_Event
end_point_ev_View = end_point_ev
Output_Event_Table_Properties__2_ = end_point_Event
MDTGIS_ROUTES_LRM_RM = "MDTGIS.ROUTES_LRM_RM"
MDTGIS_ROUTES_LRM_DC_MI = "MDTGIS.ROUTES_LRM_DC_MI"
MDTGIS_ROUTES_LRM_DC_MI__2_ = "MDTGIS.ROUTES_LRM_DC_MI"
Default_gdb = "E:\\MDTAPPS\\terry\\Default.gdb"
MDTGIS_ROUTES_LRM_DC_MI__3_ = "MDTGIS.ROUTES_LRM_DC_MI"
# Process: Calculate Field
arcpy.CalculateField_management(first_point, "Corridor", "str(!Corridor!) + \"_\" + str(!RM!)", "PYTHON_9.3", "")
# Process: Make Route Event Layer
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_RM, "ROUTE_ID", first_point__2_, "Corridor POINT beg_offset", first_point_Event, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Locate Features Along Routes
arcpy.LocateFeaturesAlongRoutes_lr(first_point_Event, MDTGIS_ROUTES_LRM_DC_MI, "CORRIDOR", "0 Meters", first_point_ev, Output_Event_Table_Properties, "FIRST", "DISTANCE", "ZERO", "FIELDS", "M_DIRECTON")
# Process: Calculate Field (2)
arcpy.CalculateField_management(end_point, "Corridor", "str(!Corridor!) + \"_\" + str(!RM!)", "PYTHON_9.3", "")
# Process: Make Route Event Layer (2)
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_RM, "ROUTE_ID", end_point__2_, "Corridor POINT end_offset", end_point_Event, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Locate Features Along Routes (2)
arcpy.LocateFeaturesAlongRoutes_lr(end_point_Event, MDTGIS_ROUTES_LRM_DC_MI__2_, "CORRIDOR", "0 Meters", end_point_ev, Output_Event_Table_Properties__2_, "FIRST", "DISTANCE", "ZERO", "FIELDS", "M_DIRECTON")
# Process: Make Table View
arcpy.MakeTableView_management(end_point_ev, end_point_ev_View, "", "", "OBJECTID OBJECTID VISIBLE NONE;RID RID VISIBLE NONE;to_MEAS to_MEAS VISIBLE NONE;Distance Distance VISIBLE NONE;RM RM VISIBLE NONE")
# Process: Merge
arcpy.Merge_management("E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev;end_point_ev_View", merge__3_, "RID \"CORRIDOR\" true true false 10 Text 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev,RID,-1,-1,end_point_ev_View,RID,-1,-1;from_MEAS \"from_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\first_point_ev,from_MEAS,-1,-1;to_MEAS \"to_MEAS\" true true false 0 Double 0 0 ,First,#,end_point_ev_View,to_MEAS,-1,-1")
# Process: Table to Table
arcpy.TableToTable_conversion(merge__3_, Default_gdb, "points", "", "RID \"CORRIDOR\" true true false 10 Text 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,RID,-1,-1;from_MEAS \"from_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,from_MEAS,-1,-1;to_MEAS \"to_MEAS\" true true false 0 Double 0 0 ,First,#,E:\\MDTAPPS\\terry\\Default.gdb\\merge,to_MEAS,-1,-1", "")
# Process: Make Route Event Layer (3)
arcpy.MakeRouteEventLayer_lr(MDTGIS_ROUTES_LRM_DC_MI__3_, "CORRIDOR", points, "rid LINE from_MEAS to_MEAS", points_Events, "", "ERROR_FIELD", "NO_ANGLE_FIELD", "NORMAL", "ANGLE", "LEFT", "POINT")
# Process: Script1
arcpy.gp.toolbox = "E:/MDTAPPS/terry/ref segment.tbx";
# Warning: the toolbox E:/MDTAPPS/terry/ref segment.tbx DOES NOT have an alias.
# Please assign this toolbox an alias to avoid tool name collisions
# And replace arcpy.gp.Script1(...) with arcpy.Script1_ALIAS(...)
arcpy.gp.Script1()
... View more
10-22-2015
09:45 AM
|
0
|
0
|
1290
|
|
POST
|
I'm having the same issue and I think its because the layer in in the "GPInMemoryWorkspace" and not on a disk.
... View more
10-21-2015
02:11 PM
|
0
|
1
|
833
|
|
POST
|
I tried this but get a syntaxError at line 21 and don't see what the indent issue is.. table = "Export_Output_3"
ridList = []
with arcpy.da.SearchCursor(table, ["RID"]) as cursor:
for row in cursor:
ridList.append(row[0])
del cursor
ridList = set(ridList)
for RID in ridList:
toMeasList = []
with arcpy.da.SearchCursor(table, ["RID", "to_MEAS"], "RID = '" + RID + "'")
as cursor:
for row in cursor:
toMeasList.append(row[1])
del cursor
toMeasList.sort()
with arcpy.da.UpdateCursor(table, ["to_MEAS"], "RID = '" + RID + "'") as
cursor:
for row in cursor:
row[0] = toMeasList[-1]
cursor.updateRow(row)
del cursor
toMeasList.sort()
with arcpy.da.UpdateCursor(table, ["OBJECTID"]) as
cursor:
for row in cursor:
if row[1] == 2:
cursor.deleteRow()
del cursor
... View more
10-21-2015
12:25 PM
|
0
|
2
|
1488
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-19-2015 02:57 PM | |
| 1 | 03-10-2016 08:36 AM | |
| 1 | 03-10-2016 09:00 AM | |
| 1 | 07-16-2015 01:15 PM | |
| 1 | 09-14-2015 06:48 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:25 AM
|