Results 1 to 4 of 4

Thread: Adding nodes to upstream links

  1. #1

    Join Date
    Oct 2015
    Posts
    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!

  2. #2
    Forum Moderator

    Innovyze Employee



    Join Date
    Feb 2013
    Posts
    133
    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)"

  3. #3

    Join Date
    Aug 2013
    Posts
    22
    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'





  4. #4
    Forum Moderator

    Innovyze Employee



    Join Date
    Feb 2013
    Posts
    133
    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
  •