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

POLYGONS #59

Closed csimoncosmostechnologiesinc closed 1 year ago

csimoncosmostechnologiesinc commented 1 year ago

Typo in g_s_defaults.py and generate_swmm_import_inp_file.py of the word 'Polygons' that should be wrote in capitals as 'POLYGONS'. The typo prevents to import the polygons and rise an error in the subcatchments that uses a function defined in the polygons section.

Jannik-Schilling commented 1 year ago

@csimoncosmostechnologiesinc: ~I couldn´t repoduce the error so far.~ Edit: I could (unfortunately). As far as I know, current versions of SWMM (5.1, 5.2) write the "Polygons" section like this: "[Polygons]". That´s why the plugin looked for exactly this word, so far. SWMM is (with regards to reading the sections) not case sensitive at all (even a "[PolYGOnS]" section would be identified correctly). As mentioned in the SWMM User's Manual Version 5.2 (p. 135), also "user-assigned object names in SWMM are not case sensitive. E.g., NODE123 is equivalent to Node123". Python and QGIS, by contrast are case sensitive.

Anyway, I´ll make at least the section titles (in square brackets) case insensitive in the plugin. This will be a part of the next version of the plugin. As a quick fix for your error you could simply replace "[POLYGONS]" by "[Polygons]" in your input file. Then, the tool should import the input file correctly.

Jannik-Schilling commented 1 year ago

756881b68f5b8e44cd1745ce390a63ddd257a224

csimoncosmostechnologiesinc commented 1 year ago

Good morning, Jannik

We are using version=0.28.1 We changed the lower to upper case for the word ‘polygons’ to ‘POLYGONS’ in the two files we mentioned. Unfortunately, I do not have a screenshot of the error. However, it was described that the function to get the polygons of the subcatchments was called before declared because it was defined in the structure of the polygons that were not found in the key list because it was lowercase.

So I also recommend defining the function outside the polygons sections in the import file, as it will be called in both polygons and subcatchments.

Thank you,

Cesar A. Simon, EIT, PhD OSHA, NASSCO Civil Engineer

[A picture containing logo Description automatically generated]

DBE / MBE / SBE Pittsburgh @.,-79.9969302,17z/data=!3m1!4b1!4m5!3m4!1s0x8834f3e4b94aeb0d:0x6630550090453c64!8m2!3d40.4500713!4d-79.9969302> | @.,-76.8928585,17z/data=!3m1!4b1!4m5!3m4!1s0x89c8c13947da1cb3:0x39861b8184d37058!8m2!3d40.2771621!4d-76.8906698> | @.,-81.6893236,17z/data=!3m1!4b1!4m5!3m4!1s0x8830fa809f82f103:0xb536c6b5709ad50d!8m2!3d41.4997673!4d-81.6871349> | @.,-81.5277502,17z/data=!3m1!4b1!4m5!3m4!1s0x8830d623232da979:0xb570486c52da429f!8m2!3d41.0724959!4d-81.5255615> | @.***,-85.7080744,17z/data=!3m1!4b1!4m5!3m4!1s0x8869730b65ea26d5:0xf3f46c70d5de71e4!8m2!3d38.2741325!4d-85.7058857> 700 River Ave., Suite 100, Pittsburgh, PA 15212 O: 412.321.3951 ext. 402 F: 412.321.3954

E: @.**@.> W: www.cosmostechnologiesinc.comhttp://www.cosmostechnologiesinc.com/

From: Jannik-Schilling @.> Sent: Thursday, April 27, 2023 3:16 AM To: Jannik-Schilling/generate_swmm_inp @.> Cc: Cesar Simon @.>; Mention @.> Subject: Re: [Jannik-Schilling/generate_swmm_inp] POLYGONS (Issue #59)

@csimoncosmostechnologiesinchttps://github.com/csimoncosmostechnologiesinc: I couldn´t repoduce the error so far. Can you please provide some more Information:

— Reply to this email directly, view it on GitHubhttps://github.com/Jannik-Schilling/generate_swmm_inp/issues/59#issuecomment-1524943250, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7OOTD6P5PYCPANQ5BSOTQLXDIMK3ANCNFSM6AAAAAAXM7AZNI. You are receiving this because you were mentioned.Message ID: @.**@.>>

Jannik-Schilling commented 1 year ago

Hello Cesar, thank you for your comment. I just discovered some more issues, because for the subcatchment section, SWMM doesn´t need polygons at all...

csimoncosmostechnologiesinc commented 1 year ago

You are welcome, Jannik. Is it not POLYGONS used to represent the border of the subcatchment?

Thank you,

Cesar A. Simon, EIT, PhD OSHA, NASSCO Civil Engineer

[A picture containing logo Description automatically generated]

DBE / MBE / SBE Pittsburgh @.,-79.9969302,17z/data=!3m1!4b1!4m5!3m4!1s0x8834f3e4b94aeb0d:0x6630550090453c64!8m2!3d40.4500713!4d-79.9969302> | @.,-76.8928585,17z/data=!3m1!4b1!4m5!3m4!1s0x89c8c13947da1cb3:0x39861b8184d37058!8m2!3d40.2771621!4d-76.8906698> | @.,-81.6893236,17z/data=!3m1!4b1!4m5!3m4!1s0x8830fa809f82f103:0xb536c6b5709ad50d!8m2!3d41.4997673!4d-81.6871349> | @.,-81.5277502,17z/data=!3m1!4b1!4m5!3m4!1s0x8830d623232da979:0xb570486c52da429f!8m2!3d41.0724959!4d-81.5255615> | @.***,-85.7080744,17z/data=!3m1!4b1!4m5!3m4!1s0x8869730b65ea26d5:0xf3f46c70d5de71e4!8m2!3d38.2741325!4d-85.7058857> 700 River Ave., Suite 100, Pittsburgh, PA 15212 O: 412.321.3951 ext. 402 F: 412.321.3954

E: @.**@.> W: www.cosmostechnologiesinc.comhttp://www.cosmostechnologiesinc.com/

From: Jannik-Schilling @.> Sent: Thursday, April 27, 2023 11:18 AM To: Jannik-Schilling/generate_swmm_inp @.> Cc: Cesar Simon @.>; Mention @.> Subject: Re: [Jannik-Schilling/generate_swmm_inp] POLYGONS (Issue #59)

Hello Cesar, thank you for your comment. I just discovered some more issues, because for the subcatchment section SWMM doesn´t need polygons at all...

— Reply to this email directly, view it on GitHubhttps://github.com/Jannik-Schilling/generate_swmm_inp/issues/59#issuecomment-1525885212, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7OOTDYQMZ7LW676FBJ73VLXDKE3FANCNFSM6AAAAAAXM7AZNI. You are receiving this because you were mentioned.Message ID: @.**@.>>

Jannik-Schilling commented 1 year ago

That´s correct. But as far as I know, SWMM was a command line tool in the beginning. Therefore, "visible" geometries (polygons, lines, points) are not neccessary to perform a simulation, as long as the parameters for each object are set up correctly

csimoncosmostechnologiesinc commented 1 year ago

You are right. However, having the subcatchment boundaries for the import function is essential because it is the reason to use the QGIS plugin vs. the SWMM interface.

Best,

Cesar A. Simon, EIT, PhD OSHA, NASSCO Civil Engineer

[A picture containing logo Description automatically generated]

DBE / MBE / SBE Pittsburgh @.,-79.9969302,17z/data=!3m1!4b1!4m5!3m4!1s0x8834f3e4b94aeb0d:0x6630550090453c64!8m2!3d40.4500713!4d-79.9969302> | @.,-76.8928585,17z/data=!3m1!4b1!4m5!3m4!1s0x89c8c13947da1cb3:0x39861b8184d37058!8m2!3d40.2771621!4d-76.8906698> | @.,-81.6893236,17z/data=!3m1!4b1!4m5!3m4!1s0x8830fa809f82f103:0xb536c6b5709ad50d!8m2!3d41.4997673!4d-81.6871349> | @.,-81.5277502,17z/data=!3m1!4b1!4m5!3m4!1s0x8830d623232da979:0xb570486c52da429f!8m2!3d41.0724959!4d-81.5255615> | @.***,-85.7080744,17z/data=!3m1!4b1!4m5!3m4!1s0x8869730b65ea26d5:0xf3f46c70d5de71e4!8m2!3d38.2741325!4d-85.7058857> 700 River Ave., Suite 100, Pittsburgh, PA 15212 O: 412.321.3951 ext. 402 F: 412.321.3954

E: @.**@.> W: www.cosmostechnologiesinc.comhttp://www.cosmostechnologiesinc.com/

From: Jannik-Schilling @.> Sent: Thursday, April 27, 2023 12:01 PM To: Jannik-Schilling/generate_swmm_inp @.> Cc: Cesar Simon @.>; Mention @.> Subject: Re: [Jannik-Schilling/generate_swmm_inp] POLYGONS (Issue #59)

That´s correct. But as far as I know, SWMM was a command line tool in the beginning. Therefore, "visible" geometries (polygons, lines, points) are not neccessary to perform a simulation, as long as the parameters for each object are set up correctly

— Reply to this email directly, view it on GitHubhttps://github.com/Jannik-Schilling/generate_swmm_inp/issues/59#issuecomment-1525951707, or unsubscribehttps://github.com/notifications/unsubscribe-auth/A7OOTD34MHCS63BBWAPETXTXDKJ33ANCNFSM6AAAAAAXM7AZNI. You are receiving this because you were mentioned.Message ID: @.**@.>>

Jannik-Schilling commented 1 year ago

d5dba58