imod.prepare.linestring_to_square_zpolygons#

imod.prepare.linestring_to_square_zpolygons(barrier_x: List[float], barrier_y: List[float], barrier_ztop: List[float], barrier_zbottom: List[float]) List[PolygonType][source]#

Create square vertical polygons from linestrings, with a varying ztop and zbottom over the line. Note: If the lists of x and y values of length N, the list of z values need to have length N-1. These are shaped as follows:

xy0,zt0 -- xy1,zt0
   |          |
   |       xy1,zt1 ---- xy2,zt1
   |          |            |
xy0,zb0 -- xy1,zb0         |
              |            |
              |            |
           xy1,zb1 ---- xy2,zb1
Parameters:
  • barrier_x (list of floats) – x-locations of barrier, length N

  • barrier_y (list of floats) – y-locations of barrier, length N

  • barrier_ztop (list of floats) – top of barrier, length N-1

  • barrier_zbot (list of floats) – bottom of barrier, length N-1

Return type:

List of polygons with z dimension.

Examples

>>> x = [-10.0, 0.0, 10.0]
>>> y = [10.0, 0.0, -10.0]
>>> ztop = [10.0, 20.0]
>>> zbot = [-10.0, -20.0]
>>> polygons = linestring_to_square_zpolygons(x, y, ztop, zbot)

You can use these polygons to construct horizontal flow barriers:

>>> geometry = gpd.GeoDataFrame(geometry=polygons, data={
>>>         "resistance": [1e3, 1e3],
>>>     },
>>> )
>>> hfb = imod.mf6.HorizontalFlowBarrierResistance(geometry, print_input)