Jannik-Schilling / generate_swmm_inp

a QGIS plugin for the import and export of SWMM input files (conversion of geodata, e.g. shapefiles or geopackage into SWMM models and vice versa)
GNU General Public License v2.0
35 stars 11 forks source link

How to set up network from existing nodes and pipes in QGIS #93

Closed MikeDowner closed 4 months ago

MikeDowner commented 4 months ago

Hi Jannik, I have imported into QGIS shapefiles for pipes and manholes for a wastewater network. I have your plugin generate swmm. How can I get the conduit attribute table to populate the from node and to node (manholes) without manually inputting them, there is about 170 manholes.

Thanks, Mike

Jannik-Schilling commented 4 months ago

Hi Mike,

you can use QGIS processing tools to prepare your data:

  1. "Extract specific vertices" (from pipes) with vertex index 0 for the first vertex of each pipe (=starting nodes)
  2. with the extracted points: "join by nearest" with the manholes as layer 2 (join layer); fields to join: name of the manhole; as the result you get a points layer with the name of the pipe and the starting point
  3. in the pipes´ layer properties make a join with the resulting layer from step 2. Join field and target field are the pipes names; select only the name of the nodes in the list of "joined fields"
  4. use the field calculator to copy the information of the joined nodes names to the column "FromNode"

Repeat steps 1-4 with vertex index -1 in step 1 to get the last vertex (recieving nodes) of each pipe and rename to "ToNode" in step 4.

Regards Jannik

MikeDowner commented 4 months ago

Thank you Jannik, much appreciated.

Mike Roberts Senior Projects Engineer Utilities

@.***

M | +64274904132 E | @. 750 Lower Queen Street Richmond Tasman 7081 www.downergroup.co.nz http://www.downergroup.co.nz @.

From: Jannik-Schilling @.> Sent: Thursday, May 30, 2024 9:33 PM To: Jannik-Schilling/generate_swmm_inp @.> Cc: Mike Roberts @.>; Author @.> Subject: Re: [Jannik-Schilling/generate_swmm_inp] Generate SWMM (Issue #93)

 [External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

Hi Mike,

you can use QGIS processing tools to prepare your data:

  1. "Extract specific vertices" (from pipes) with vertex index 0 for the first vertex of each pipe (=starting nodes)
  2. with the extracted points: "join by nearest" with the manholes as layer 2 (join layer); fields to join: name of the manhole; as the result you get a points layer with the name of the pipe and the starting point
  3. in the pipes´ layer properties make a join with the resulting layer from step 2. Join field and target field are the pipes names; select only the name of the nodes in the list of "joined fields"
  4. use the field calculator to copy the information of the joined nodes names to the column "FromNode"

Repeat steps 1-4 with vertex index -1 in step 1 to get the last vertex (recieving nodes) of each pipe and rename to "ToNode" in step 4.

Regards Jannik

— Reply to this email directly, view it on GitHubhttps://github.com/Jannik-Schilling/generate_swmm_inp/issues/93#issuecomment-2139153158, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BHXP62LZWFE23PNZCVMB74LZE3W25AVCNFSM6AAAAABIQDAALGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZZGE2TGMJVHA. You are receiving this because you authored the thread.Message ID: @.***>

MikeDowner commented 4 months ago

Hi Jannik, Sorry to ask but I am getting errors when I try and generate the inp and can’t find why. Attached are the two shp files I want to use TOTSM_WW_Trunk_Features1 as junctions, TOTSM_WW_Trunk_Pipes as conduits.

@.***

Could you take a look as point me in the right direction?

Much appreciated.

Mike Roberts Senior Projects Engineer Utilities

@.***

M | +64274904132 E | @. 750 Lower Queen Street Richmond Tasman 7081 www.downergroup.co.nz http://www.downergroup.co.nz @.

From: Jannik-Schilling @.> Sent: Thursday, May 30, 2024 9:33 PM To: Jannik-Schilling/generate_swmm_inp @.> Cc: Mike Roberts @.>; Author @.> Subject: Re: [Jannik-Schilling/generate_swmm_inp] Generate SWMM (Issue #93)

 [External Email] This email was sent from outside the organisation – be cautious, particularly with links and attachments.

Hi Mike,

you can use QGIS processing tools to prepare your data:

  1. "Extract specific vertices" (from pipes) with vertex index 0 for the first vertex of each pipe (=starting nodes)
  2. with the extracted points: "join by nearest" with the manholes as layer 2 (join layer); fields to join: name of the manhole; as the result you get a points layer with the name of the pipe and the starting point
  3. in the pipes´ layer properties make a join with the resulting layer from step 2. Join field and target field are the pipes names; select only the name of the nodes in the list of "joined fields"
  4. use the field calculator to copy the information of the joined nodes names to the column "FromNode"

Repeat steps 1-4 with vertex index -1 in step 1 to get the last vertex (recieving nodes) of each pipe and rename to "ToNode" in step 4.

Regards Jannik

— Reply to this email directly, view it on GitHubhttps://github.com/Jannik-Schilling/generate_swmm_inp/issues/93#issuecomment-2139153158, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BHXP62LZWFE23PNZCVMB74LZE3W25AVCNFSM6AAAAABIQDAALGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZZGE2TGMJVHA. You are receiving this because you authored the thread.Message ID: @.***>

Jannik-Schilling commented 3 months ago

Hi Mike, as far as I know, you cannot sent attachments to github via mail.

There are two things to check:

  1. are the geometries of the features in the layers valid (e.g. not empty)?
  2. did you write suitable values in the attribute table? Here, you can have a look at the documentation file.