Assigning from node to node in ArcGIS geometric network?Assigning point IDs to respective start and end...
What's the difference between a cart and a wagon?
If a druid in Wild Shape swallows a creature whole, then turns back to her normal form, what happens?
Why proton concentration is divided by 10⁻⁷?
How to deny access to SQL Server to certain login over SSMS, but allow over .Net SqlClient Data Provider
Exponential growth/decay formula: what happened to the other constant of integration?
How would we write a misogynistic character without offending people?
How do I construct an nxn matrix?
Auto Insert date into Notepad
How can I find an Adventure or Adventure Path I need that meets certain criteria?
Can chords be played on the flute?
How can I handle a player who pre-plans arguments about my rulings on RAW?
What to do when being responsible for data protection in your lab, yet advice is ignored?
Whom do I have to contact for a ticket refund in case of denied boarding (in the EU)?
Why does the author believe that the central mass that gas cloud HCN-0.009-0.044 orbits is smaller than our solar system?
What if I store 10TB on azure servers and then keep the vm powered off?
Is there any relevance to Thor getting his hair cut other than comedic value?
Find the next monthly expiration date
How to speed up a process
What is the wife of a henpecked husband called?
Equivalent to "source" in OpenBSD?
Understanding Kramnik's play in game 1 of Candidates 2018
How to approximate rolls for potions of healing using only d6's?
Contradiction with Banach Fixed Point Theorem
Waiting for the gravy at a dinner table
Assigning from node to node in ArcGIS geometric network?
Assigning point IDs to respective start and end attributes of polyline?How to assign node IDs to links in a network?Analyzing Flow direction in Geometric Networks in ArcGISUnable to create a geometric network in a PostgreSQL Spatial Database ConnectionHow to create Network Dataset for Network Assistant using ArcPy?Automate Naming of Stormwater Network (Geometric network)How do I add all features of a Geometric Network to the the dataframe with one parameter in a custom tool that uses python?Fixing invalid connectivity in a geometric network dataset in ArcGISAdding Spatial Index for Geometric Network?Create a Geometric Network - ErrorArcGIS Trace Geometric Network Tool Trace using Find Common Ancestors gives error
I'm really new to geometric network and geodatabase, I basically finished all the arcgis tutorial.
Anyway I cannot figure out how to fill a from_node and to_node fields in a polyline shape with ids of the junctions feature (added during the geometric network creation).
Topology of the network is fine...
arcgis-desktop geometric-network
add a comment |
I'm really new to geometric network and geodatabase, I basically finished all the arcgis tutorial.
Anyway I cannot figure out how to fill a from_node and to_node fields in a polyline shape with ids of the junctions feature (added during the geometric network creation).
Topology of the network is fine...
arcgis-desktop geometric-network
You may find this relevant: gis.stackexchange.com/questions/85082/…
– Arash
Mar 14 '14 at 3:36
possible duplicate of Assign point IDs to respective start and end attributes of a polyline
– Chris W
Dec 10 '14 at 18:33
add a comment |
I'm really new to geometric network and geodatabase, I basically finished all the arcgis tutorial.
Anyway I cannot figure out how to fill a from_node and to_node fields in a polyline shape with ids of the junctions feature (added during the geometric network creation).
Topology of the network is fine...
arcgis-desktop geometric-network
I'm really new to geometric network and geodatabase, I basically finished all the arcgis tutorial.
Anyway I cannot figure out how to fill a from_node and to_node fields in a polyline shape with ids of the junctions feature (added during the geometric network creation).
Topology of the network is fine...
arcgis-desktop geometric-network
arcgis-desktop geometric-network
edited Oct 25 '16 at 22:23
PolyGeo♦
53.6k1780240
53.6k1780240
asked Mar 10 '14 at 16:25
panicellupanicellu
112
112
You may find this relevant: gis.stackexchange.com/questions/85082/…
– Arash
Mar 14 '14 at 3:36
possible duplicate of Assign point IDs to respective start and end attributes of a polyline
– Chris W
Dec 10 '14 at 18:33
add a comment |
You may find this relevant: gis.stackexchange.com/questions/85082/…
– Arash
Mar 14 '14 at 3:36
possible duplicate of Assign point IDs to respective start and end attributes of a polyline
– Chris W
Dec 10 '14 at 18:33
You may find this relevant: gis.stackexchange.com/questions/85082/…
– Arash
Mar 14 '14 at 3:36
You may find this relevant: gis.stackexchange.com/questions/85082/…
– Arash
Mar 14 '14 at 3:36
possible duplicate of Assign point IDs to respective start and end attributes of a polyline
– Chris W
Dec 10 '14 at 18:33
possible duplicate of Assign point IDs to respective start and end attributes of a polyline
– Chris W
Dec 10 '14 at 18:33
add a comment |
2 Answers
2
active
oldest
votes
These information are with geometric network system tables (topology tables). Using ArcObject you can easily query those information (from , to node) an assign them to the edge feature class. But no function exists with arcpy or python to query these information.
Therefore you have to put the geometric network aside and use spatial relationships (intersect) to find the start and end node of a line feature.
As suggested in comments:
How to assign node IDs to links in a network?
Assign point IDs to respective start and end attributes of a polyline
add a comment |
I finally solved this problem in my geometric network with python. Our old method relies on Attribute Assistant being turned on as new pipes and nodes are added, but it doesn't catch changes if pipes are edited or if someone forgot to turn it on. To rerun Attribute Assistant on the entire network is unbearably slow and somewhat unstable. To give a sense of scale, our geometric network contains 400K+ pipes and 500K+ nodes.
The geometric network build forces the X,Y of the nodes and the pipe ends to be coincident. You can access these locations with the shape tokens in arcpy cursors and match them. The shape tokens for lines return an array of the vertices in the order that they were drawn. In my network, the draw order of the pipes is heavily QA'd because we use this to set the flow directions. So, the first vertex is the start of the pipe, and the last vertex is the end of the pipe.
Reference: ASSETID = id of pipe, UNITID = node id at start of pipe, UNITID2 = node id at end of pipe.
nodes = "mergeNodes"
pipes = "SEWER_1"
nodeDict = {}
pipeDict = {}
#populate node dictionary with X,Y as the key and node ID as the value
for node in arcpy.da.SearchCursor(nodes, ["UNITID", "SHAPE@XY"]):
nodeDict[(node[1][0], node[1][1])] = node[0]
#populate pipe dictionary with pipe ID as the key and list of X,Y as values
#vertices populated in the order that the line was draw
#so that [0] is the first vertex and [-1] is the final vertex
for pipe in arcpy.da.SearchCursor(pipes, ["ASSETID", "SHAPE@"]):
for arrayOb in pipe[1]:
for point in arrayOb:
if pipe[0] in pipeDict:
pipeDict[pipe[0]].append((point.X, point.Y))
else:
pipeDict[pipe[0]] = [(point.X, point.Y)]
#populate UNITID with the first vertex of the line
#populate UNITID2 with the final vertex of the line
with arcpy.da.UpdateCursor(pipes, ["ASSETID", "UNITID", "UNITID2"]) as cur:
for pipe in cur:
if pipeDict[pipe[0]][0] in nodeDict:
pipe[1] = nodeDict[pipeDict[pipe[0]][0]]
if pipeDict[pipe[0]][-1] in nodeDict:
pipe[2] = nodeDict[pipeDict[pipe[0]][-1]]
cur.updateRow(pipe)
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f89173%2fassigning-from-node-to-node-in-arcgis-geometric-network%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
These information are with geometric network system tables (topology tables). Using ArcObject you can easily query those information (from , to node) an assign them to the edge feature class. But no function exists with arcpy or python to query these information.
Therefore you have to put the geometric network aside and use spatial relationships (intersect) to find the start and end node of a line feature.
As suggested in comments:
How to assign node IDs to links in a network?
Assign point IDs to respective start and end attributes of a polyline
add a comment |
These information are with geometric network system tables (topology tables). Using ArcObject you can easily query those information (from , to node) an assign them to the edge feature class. But no function exists with arcpy or python to query these information.
Therefore you have to put the geometric network aside and use spatial relationships (intersect) to find the start and end node of a line feature.
As suggested in comments:
How to assign node IDs to links in a network?
Assign point IDs to respective start and end attributes of a polyline
add a comment |
These information are with geometric network system tables (topology tables). Using ArcObject you can easily query those information (from , to node) an assign them to the edge feature class. But no function exists with arcpy or python to query these information.
Therefore you have to put the geometric network aside and use spatial relationships (intersect) to find the start and end node of a line feature.
As suggested in comments:
How to assign node IDs to links in a network?
Assign point IDs to respective start and end attributes of a polyline
These information are with geometric network system tables (topology tables). Using ArcObject you can easily query those information (from , to node) an assign them to the edge feature class. But no function exists with arcpy or python to query these information.
Therefore you have to put the geometric network aside and use spatial relationships (intersect) to find the start and end node of a line feature.
As suggested in comments:
How to assign node IDs to links in a network?
Assign point IDs to respective start and end attributes of a polyline
edited Apr 13 '17 at 12:33
Community♦
1
1
answered Jul 26 '15 at 12:00
Farid CheraghiFarid Cheraghi
8,26411447
8,26411447
add a comment |
add a comment |
I finally solved this problem in my geometric network with python. Our old method relies on Attribute Assistant being turned on as new pipes and nodes are added, but it doesn't catch changes if pipes are edited or if someone forgot to turn it on. To rerun Attribute Assistant on the entire network is unbearably slow and somewhat unstable. To give a sense of scale, our geometric network contains 400K+ pipes and 500K+ nodes.
The geometric network build forces the X,Y of the nodes and the pipe ends to be coincident. You can access these locations with the shape tokens in arcpy cursors and match them. The shape tokens for lines return an array of the vertices in the order that they were drawn. In my network, the draw order of the pipes is heavily QA'd because we use this to set the flow directions. So, the first vertex is the start of the pipe, and the last vertex is the end of the pipe.
Reference: ASSETID = id of pipe, UNITID = node id at start of pipe, UNITID2 = node id at end of pipe.
nodes = "mergeNodes"
pipes = "SEWER_1"
nodeDict = {}
pipeDict = {}
#populate node dictionary with X,Y as the key and node ID as the value
for node in arcpy.da.SearchCursor(nodes, ["UNITID", "SHAPE@XY"]):
nodeDict[(node[1][0], node[1][1])] = node[0]
#populate pipe dictionary with pipe ID as the key and list of X,Y as values
#vertices populated in the order that the line was draw
#so that [0] is the first vertex and [-1] is the final vertex
for pipe in arcpy.da.SearchCursor(pipes, ["ASSETID", "SHAPE@"]):
for arrayOb in pipe[1]:
for point in arrayOb:
if pipe[0] in pipeDict:
pipeDict[pipe[0]].append((point.X, point.Y))
else:
pipeDict[pipe[0]] = [(point.X, point.Y)]
#populate UNITID with the first vertex of the line
#populate UNITID2 with the final vertex of the line
with arcpy.da.UpdateCursor(pipes, ["ASSETID", "UNITID", "UNITID2"]) as cur:
for pipe in cur:
if pipeDict[pipe[0]][0] in nodeDict:
pipe[1] = nodeDict[pipeDict[pipe[0]][0]]
if pipeDict[pipe[0]][-1] in nodeDict:
pipe[2] = nodeDict[pipeDict[pipe[0]][-1]]
cur.updateRow(pipe)
add a comment |
I finally solved this problem in my geometric network with python. Our old method relies on Attribute Assistant being turned on as new pipes and nodes are added, but it doesn't catch changes if pipes are edited or if someone forgot to turn it on. To rerun Attribute Assistant on the entire network is unbearably slow and somewhat unstable. To give a sense of scale, our geometric network contains 400K+ pipes and 500K+ nodes.
The geometric network build forces the X,Y of the nodes and the pipe ends to be coincident. You can access these locations with the shape tokens in arcpy cursors and match them. The shape tokens for lines return an array of the vertices in the order that they were drawn. In my network, the draw order of the pipes is heavily QA'd because we use this to set the flow directions. So, the first vertex is the start of the pipe, and the last vertex is the end of the pipe.
Reference: ASSETID = id of pipe, UNITID = node id at start of pipe, UNITID2 = node id at end of pipe.
nodes = "mergeNodes"
pipes = "SEWER_1"
nodeDict = {}
pipeDict = {}
#populate node dictionary with X,Y as the key and node ID as the value
for node in arcpy.da.SearchCursor(nodes, ["UNITID", "SHAPE@XY"]):
nodeDict[(node[1][0], node[1][1])] = node[0]
#populate pipe dictionary with pipe ID as the key and list of X,Y as values
#vertices populated in the order that the line was draw
#so that [0] is the first vertex and [-1] is the final vertex
for pipe in arcpy.da.SearchCursor(pipes, ["ASSETID", "SHAPE@"]):
for arrayOb in pipe[1]:
for point in arrayOb:
if pipe[0] in pipeDict:
pipeDict[pipe[0]].append((point.X, point.Y))
else:
pipeDict[pipe[0]] = [(point.X, point.Y)]
#populate UNITID with the first vertex of the line
#populate UNITID2 with the final vertex of the line
with arcpy.da.UpdateCursor(pipes, ["ASSETID", "UNITID", "UNITID2"]) as cur:
for pipe in cur:
if pipeDict[pipe[0]][0] in nodeDict:
pipe[1] = nodeDict[pipeDict[pipe[0]][0]]
if pipeDict[pipe[0]][-1] in nodeDict:
pipe[2] = nodeDict[pipeDict[pipe[0]][-1]]
cur.updateRow(pipe)
add a comment |
I finally solved this problem in my geometric network with python. Our old method relies on Attribute Assistant being turned on as new pipes and nodes are added, but it doesn't catch changes if pipes are edited or if someone forgot to turn it on. To rerun Attribute Assistant on the entire network is unbearably slow and somewhat unstable. To give a sense of scale, our geometric network contains 400K+ pipes and 500K+ nodes.
The geometric network build forces the X,Y of the nodes and the pipe ends to be coincident. You can access these locations with the shape tokens in arcpy cursors and match them. The shape tokens for lines return an array of the vertices in the order that they were drawn. In my network, the draw order of the pipes is heavily QA'd because we use this to set the flow directions. So, the first vertex is the start of the pipe, and the last vertex is the end of the pipe.
Reference: ASSETID = id of pipe, UNITID = node id at start of pipe, UNITID2 = node id at end of pipe.
nodes = "mergeNodes"
pipes = "SEWER_1"
nodeDict = {}
pipeDict = {}
#populate node dictionary with X,Y as the key and node ID as the value
for node in arcpy.da.SearchCursor(nodes, ["UNITID", "SHAPE@XY"]):
nodeDict[(node[1][0], node[1][1])] = node[0]
#populate pipe dictionary with pipe ID as the key and list of X,Y as values
#vertices populated in the order that the line was draw
#so that [0] is the first vertex and [-1] is the final vertex
for pipe in arcpy.da.SearchCursor(pipes, ["ASSETID", "SHAPE@"]):
for arrayOb in pipe[1]:
for point in arrayOb:
if pipe[0] in pipeDict:
pipeDict[pipe[0]].append((point.X, point.Y))
else:
pipeDict[pipe[0]] = [(point.X, point.Y)]
#populate UNITID with the first vertex of the line
#populate UNITID2 with the final vertex of the line
with arcpy.da.UpdateCursor(pipes, ["ASSETID", "UNITID", "UNITID2"]) as cur:
for pipe in cur:
if pipeDict[pipe[0]][0] in nodeDict:
pipe[1] = nodeDict[pipeDict[pipe[0]][0]]
if pipeDict[pipe[0]][-1] in nodeDict:
pipe[2] = nodeDict[pipeDict[pipe[0]][-1]]
cur.updateRow(pipe)
I finally solved this problem in my geometric network with python. Our old method relies on Attribute Assistant being turned on as new pipes and nodes are added, but it doesn't catch changes if pipes are edited or if someone forgot to turn it on. To rerun Attribute Assistant on the entire network is unbearably slow and somewhat unstable. To give a sense of scale, our geometric network contains 400K+ pipes and 500K+ nodes.
The geometric network build forces the X,Y of the nodes and the pipe ends to be coincident. You can access these locations with the shape tokens in arcpy cursors and match them. The shape tokens for lines return an array of the vertices in the order that they were drawn. In my network, the draw order of the pipes is heavily QA'd because we use this to set the flow directions. So, the first vertex is the start of the pipe, and the last vertex is the end of the pipe.
Reference: ASSETID = id of pipe, UNITID = node id at start of pipe, UNITID2 = node id at end of pipe.
nodes = "mergeNodes"
pipes = "SEWER_1"
nodeDict = {}
pipeDict = {}
#populate node dictionary with X,Y as the key and node ID as the value
for node in arcpy.da.SearchCursor(nodes, ["UNITID", "SHAPE@XY"]):
nodeDict[(node[1][0], node[1][1])] = node[0]
#populate pipe dictionary with pipe ID as the key and list of X,Y as values
#vertices populated in the order that the line was draw
#so that [0] is the first vertex and [-1] is the final vertex
for pipe in arcpy.da.SearchCursor(pipes, ["ASSETID", "SHAPE@"]):
for arrayOb in pipe[1]:
for point in arrayOb:
if pipe[0] in pipeDict:
pipeDict[pipe[0]].append((point.X, point.Y))
else:
pipeDict[pipe[0]] = [(point.X, point.Y)]
#populate UNITID with the first vertex of the line
#populate UNITID2 with the final vertex of the line
with arcpy.da.UpdateCursor(pipes, ["ASSETID", "UNITID", "UNITID2"]) as cur:
for pipe in cur:
if pipeDict[pipe[0]][0] in nodeDict:
pipe[1] = nodeDict[pipeDict[pipe[0]][0]]
if pipeDict[pipe[0]][-1] in nodeDict:
pipe[2] = nodeDict[pipeDict[pipe[0]][-1]]
cur.updateRow(pipe)
answered 19 mins ago
PriscillaPriscilla
818414
818414
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f89173%2fassigning-from-node-to-node-in-arcgis-geometric-network%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You may find this relevant: gis.stackexchange.com/questions/85082/…
– Arash
Mar 14 '14 at 3:36
possible duplicate of Assign point IDs to respective start and end attributes of a polyline
– Chris W
Dec 10 '14 at 18:33