-
October 22, 2015, 10:20 AM
#1
Adding nodes to upstream links
I have GIS data where the most upstream link on each line is missing an upstream manhole. Is there a SQL script that will allow me to add the upstream nodes to all of these lines automatically?
Thank you!
-
October 29, 2015, 07:36 AM
#2
Forum Moderator

I think the closest you'll be able to do with SQL is to add a node based on the links upstream co-ordinates. From the 'SQL in InfoWorks ICM, ICMLive Configuration Manager and Infonet help topic:-
"To add individual objects the syntax is:
INSERT INTO<table name> (field1, field 2,... fieldn) VALUES (val1,val2,... valn)
INSERT INTO node (node_id,x,y) VALUES ('N1', 123, 456)"
-
June 5, 2018, 07:45 AM
#3
When I use the following SQL to insert a node into the table, a data type error occurs.
SET $new_node_id = node_id+"S";
SET $new_x = x+10;
SET $new_y = y+10;
INSERT INTO node (node_id,x,y) VALUES ($new_node_id, $new_x, $new_y)
variable $new_node_id has already been used in a different context - this context 'Scalar', previous context 'All Nodes'
variable $new_x has already been used in a different context - this context 'Scalar', previous context 'All Nodes'
variable $new_y has already been used in a different context - this context 'Scalar', previous context 'All Nodes'
-
June 6, 2018, 01:46 AM
#4
Forum Moderator

Try the following:-
SET $new_node_id = node_id+"S";
SET $new_x = x+10;
SET $new_y = y+10;
INSERT INTO node (node_id,x,y) SELECT $new_node_id,$new_x,$new_y;
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules