Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't enter the weirs dimensions using the shp_to_inp function #43

Open
ghost opened this issue Apr 29, 2020 · 5 comments
Open

Can't enter the weirs dimensions using the shp_to_inp function #43

ghost opened this issue Apr 29, 2020 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 29, 2020

Hello, I need to insert a series of weirs using the shp_to_inp function. To do this I created the following test shapefile according to the wording of the manual:
Shp Weirs

At this point, the function creates the correct .inp file, but it is not possible to enter the height and length of the weirs (they are set to 1) and the CrestHt field is inserted as Inlet Offset as you can see in the following image:
Weir properties

I then manually entered the values through SWMM and realized that the dimensions of the weirs are entered by SWMM inside the [XSECTIONS] section as for the other linear elements, and therefore inside the Link, Shape, Geom1 and Geom2 fields:
parametri

However it is not possible to insert these parameters inside the shapefile, so how can I do? where am I wrong? I also tried using the example 8 provided with the SWMM manual and from this example I created the shapefiles using the inp_to_files function but also in this case the parameters referring to the height and length of the weirs do not appear inside the shapes as happens instead for the shapefile relating to the pipes. Consequently, converting it back to the .inp file using the shp_to_inp function, these parameters will not be loaded. Could you kindly help me in this operation? I attach the Example 8.inp and my code, thank you very much.

Example8.txt


PAULLO <- shp_to_inp(
  path_options = file.path(out_dir,"SWMM/Paullo_Opzioni.txt"),
  path_timeseries = file.path(out_dir,"PIOGGE/Paullo_TS1.dat"),
  path_polygon = file.path(out_dir,"SWMM/Paullo_polygon.shp"),
  path_line = file.path(out_dir,"SWMM/Paullo_link.shp"),
  path_point = file.path(out_dir,"SWMM/Paullo_point.shp"),
  path_outfall = file.path(out_dir,"SWMM/Paullo_outfall.shp"),
  path_pumps = file.path(out_dir,"SWMM/Paullo_pumps.shp"),
  path_pump_curve = file.path(out_dir,"SWMM/Paullo_Pcurve.txt"),
  path_storage = file.path(out_dir,"SWMM/Paullo_storages.shp"),
  path_weirs = file.path(out_dir,"SWMM/Paullo_weirs.shp"),
)
summary(PAULLO)
write_inp(PAULLO, file.path(out_dir, "PAULLO.inp"))

While this is the code I used to get the shapefiles from the .inp file of Example 8

inp_file <- "C:/Users/Enrico/Tesi/Paullo/Example8.inp"
out_dir <- "C:/Users/Enrico/Tesi/Paullo"

Esempio <- read_inp(x = inp_file)
summary(Esempio)

inp_to_files(x = Esempio, name = "Esempio", path_out = out_dir)

list.files(out_dir)
c("shp", "txt", "dat") %>% 
  map( ~ file.path(out_dir, .)) %>% 
  map(list.files)
@dleutnant
Copy link
Owner

@DoeringA, do you have an idea?

@ghost
Copy link
Author

ghost commented May 5, 2020

Here is a quick diagram of the quantities necessary for the correct representation of a weir on SWMM: The height of the crest (CrestHt from the Shapefile) is correctly entered by the function shp_to_inp in the "Inlet Offset" item, while the shape and the two dimensions Height (Geom1) and Length (Geom2) must be contained in the [XSECTIONS] section of the .inp file. Thanks again for your availability in helping me.
WEIR

@dleutnant
Copy link
Owner

@Enrilok Thank you! I put it on the list but this may take while. But eventually @DoeringA will take of it.

@ghost
Copy link
Author

ghost commented May 5, 2020

Thanks for your reply, hope you can solve the problem. However, I also wanted to ask if by chance you had been able to take a look also at the problem related to the insertion of the pump curves (issues # 41) which was also open by me. thanks for your help!
Enrico

@dleutnant
Copy link
Owner

@Enrilok No, not yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant