I am having issues with using a user defined feature class for identifying starting point locations. I have thoroughly read through the following discussions already addressing some issues of similar nature, however, I am still receiving error when I input my user defined starting points into the Trace tool:
I get the impression from the above discussions and from the Starting points documentation that the SOURCEID/FEATUREGLOBALID are not required in the user defined feature class. When creating my starting point feature class, I am ensuring that my points are not only snapped to a network feature end point, but also to the location of a system junctions created when the trace network is established. My starting point feature class has two points as I am attempting to trace using the shortest path trace type. When using the TN_Temp_Starting_Points feature class created by the Trace Locations tool, I can successfully trace, however, when using a user defined trace location feature class (exact same point locations) I have received the following errors on different occasions:
I have also tired adding SOURCEID/FEATUREGLOBALID fields to my trace locations feature class and populating the FEATUREGLOBALID with the corresponding network feature GLOBALID and populating the SOURCEID with the OBJECT ID of the system junction, with no success. I am hoping to be able to use a user defined feature class for identifying trace start points without the need to populate the SOURCEID/FEATUREGLOBALID fields, as I will have a script that will create and iterate through hundreds of trace start point combinations and trace the shortest path.
I am using ArcGIS Pro 2.7. Unfortunately I am not a liberty share any of my network data, so if any additional information is needed other thy the errors I am encountering, please let me know and I would be glad to provide further detail.
Thanks in advance for any insight into my issue!
Cheers,
Austen
Solved! Go to Solution.
As @JonDeRose mentioned my issue was related to placement of user-defined starting points on junction features when performing a shortest path trace.
Since I am a newb Python scripter, I was unsure how to access/use the TN_385_SystemJunctions feature that is created when the trace network is generated in order to assign the GLOBALID from these features as the FEATUREGLOBALID in my user defined start points. Discussing further with @JonDeRose , the arcpy.ListFeatureClasses or arcpy.ListDatasets does not appear to identify sublayers/features within the trace network.
My workaround was to add my user defined "start points" as an input junction into the trace network and assign the FEATUREGLOBALID of a separate start point feature class the GLOBALID of the junction feature using a spatial join. This allowed me to initial shortest path traces on what was before a system generated junction feature that was the source of the error. Not optimal, but works!
Cheers,
Austen
Hi Austen,
I am sorry to hear of the challenges you are running into. You are correct that the SOURCEID/FEATUREGLOBALID are not required for trace locations coming from a user defined feature class. When these fields are absent from the schema, the geometry of the input feature class is used to intersect the geometry of the network feature and place the starting points.
The team addressed issues related to trace locations placed on junction features in the 2.7 release. It sounds as though the issues you are seeing are specific to Shortest Path traces alone? Is that correct or are you seeing this with other trace types as well?
One issue that we were unable to get into 2.7 related to placement of starting points on junction features when performing a shortest path trace. If this is encountered only with Shortest Path traces you may be encountering this behavior; however, in that scenario populating FEATUREGLOBALID enabled you to work around that limitation. One additional scenario that could trigger 002512 is when more (or less) than 2 trace locations exist.
To confirm, I reproduced this again with a 2.7 client before testing with a recent 2.8 build where I was no longer able to reproduce the issue.
Can you confirm whether creating a new junction feature class and populating this with the GLOBALID of the source network feature allows you to run the trace? It is possible I am missing a component of your workflow.
One other potential. am not sure if this would be feasible based on the length of your edge features in the network; however, one potential solution in the interim would be to place the user-defined starting points along an edge.
Thanks,
Jon
Hi Jon,
Thanks for the prompt reply. To address your comments/questions see below:
Austen -
I am not able to reproduce this behavior with 2.7. I'll reach out to you separately to see if we can identify differences between our two approaches or determine if working with Support might be a better avenue.
A note on SOURCEID. If you are going to populate it, it should be the ID of the feature class with respect to its participation in the trace network, NOT the ObjectID of the feature. Given a trace network layer, and a feature layer participating in a trace network, here's a function that illustrates how to identify the SOURCEID. I use this in my script tools as I'm getting ready to perform traces. I do not know how to see the SOURCEID from the user interface without using arcpy.Describe.
def get_source_id(network, network_layer):
d = arcpy.Describe(network_layer)
fc_name = d.featureClass.name
d = arcpy.Describe(network)
for s in d.sources:
if s.name == fc_name:
return s.sourceID
arcpy.AddError(
'Could not determine network source ID for ' + network_layer.name)
raise arcpy.ExecuteError
If you've taken the conversation offline, will you please post the solution here once you've found one? I'm curious!
As I have taken a closer look at my user defined start point issue, it turns out my problem all along was what Jon initially indicated: "One issue that we were unable to get into 2.7 related to placement of starting points on junction features when performing a shortest path trace. If this is encountered only with Shortest Path traces you may be encountering this behavior"
Since I am a newb Python scripter, I was unsure how to access/use the TN_385_SystemJunctions feature that is created when the trace network is generated in order to assign the GLOBALID from these features as the FEATUREGLOBALID in my user defined start points. The arcpy.ListFeatureClasses or arcpy.ListDatasets does not appear to identify sublayers/features within the trace network.
My workaround was to add my user defined "start points" as an input junction into the trace network and assign the FEATUREGLOBALID of a separate start point feature class the GLOBALID of the junction feature using a spatial join. This allowed me to initial shortest path traces on what was before a system generated junction feature that was the source of the error.
Jon has confirmed that this will be addressed in ArcPro 2.8. Again, I think Jon as ESRI for his assistance with this problem.
Cheers,
Austen
Thanks for the reminder @TimWhiteaker ! I discussed with @AustenCutrell2 a bit further and we identified that the only remaining issues encountered were related to placement of user-defined starting points on junction features when performing a shortest path trace.
This issue was addressed as part of the 2.8 work. In this use case, populating FEATUREGLOBALID for the trace location enables a work around.
To your point @TimWhiteaker , you are correct arcpy.Describe would be the method to get access to the SOURCEID; however, as I mentioned previously, this is NOT required for user-defined trace locations.
When working with a trace network in a file geodatabase we can supply the FEATUREGLOBALID to provide granularity over which features in a trace locations feature class will be honored. If this field is absent from the schema of the trace locations feature class, the geometry of the feature class is used to intersect the network feature geometry and place starting points or barriers. Note that this does not apply to Trace Network Services with the upcoming release of Enterprise 10.9, in that case, FEATUREGLOBALID is a requirement.
- Jon
As @JonDeRose mentioned my issue was related to placement of user-defined starting points on junction features when performing a shortest path trace.
Since I am a newb Python scripter, I was unsure how to access/use the TN_385_SystemJunctions feature that is created when the trace network is generated in order to assign the GLOBALID from these features as the FEATUREGLOBALID in my user defined start points. Discussing further with @JonDeRose , the arcpy.ListFeatureClasses or arcpy.ListDatasets does not appear to identify sublayers/features within the trace network.
My workaround was to add my user defined "start points" as an input junction into the trace network and assign the FEATUREGLOBALID of a separate start point feature class the GLOBALID of the junction feature using a spatial join. This allowed me to initial shortest path traces on what was before a system generated junction feature that was the source of the error. Not optimal, but works!
Cheers,
Austen