diff --git a/content/tutorials/earthworks/basics.ipynb b/content/tutorials/earthworks/basics.ipynb index 546fa85..5b3b422 100644 --- a/content/tutorials/earthworks/basics.ipynb +++ b/content/tutorials/earthworks/basics.ipynb @@ -176,7 +176,8 @@ "and y-coordinates. Use the `z` parameter to set a z-coordinate for the\n", "top of the peak. Optionally use the `flat` parameter to create a plateau\n", "at the top of the peak. Using the default linear growth and decay\n", - "function $z = z_0 - r \\sqrt{\\Delta x^2 + \\Delta y^2}$, set the `rate` to\n", + "function $z = z_0 - r \\sqrt{\\Delta x^2 + \\Delta y^2}$, \n", + "set the `linear` slope parameter to\n", "0.5 to model a 50 percent slope." ] }, @@ -196,7 +197,7 @@ " coordinates=[400, 100],\n", " z=25,\n", " flat=25,\n", - " rate=0.5\n", + " linear=0.5\n", " )\n", "\n", "# Visualize\n", @@ -248,7 +249,7 @@ " coordinates=[400, 100],\n", " z=-25,\n", " flat=25,\n", - " rate=0.5\n", + " linear=0.5\n", " )\n", "\n", "# Visualize\n", @@ -298,7 +299,7 @@ " coordinates=[350, 100, 450, 100],\n", " z=[-25, 25],\n", " flat=25,\n", - " rate=0.5\n", + " linear=0.5\n", " )\n", "\n", "# Visualize\n", @@ -365,7 +366,7 @@ " earthworks=\"earthworks\",\n", " operation=\"fill\",\n", " raster=\"random\",\n", - " rate=0.25,\n", + " linear=0.25,\n", " flat=25\n", " )\n", "\n", diff --git a/content/tutorials/earthworks/basics.qmd b/content/tutorials/earthworks/basics.qmd index e6bc8be..3341ca3 100644 --- a/content/tutorials/earthworks/basics.qmd +++ b/content/tutorials/earthworks/basics.qmd @@ -187,14 +187,15 @@ Use the `z` parameter to set a z-coordinate for the top of the peak. Optionally use the `flat` parameter to create a plateau at the top of the peak. Using the default linear growth and decay function $z = z_0 - r \sqrt{\Delta x^2 + \Delta y^2}$, -set the `rate` to 0.5 to model a 50 percent slope. +set the `linear` slope parameter to 0.5 +to model a 50 percent slope. ::: {.panel-tabset group="language"} ## Command line ```{bash} -r.earthworks elevation=elevation earthworks=peak operation=fill coordinates=400,100 z=25 flat=25 rate=0.5 +r.earthworks elevation=elevation earthworks=peak operation=fill function=linear linear=0.5 coordinates=400,100 z=25 flat=25 ``` ## Python @@ -206,10 +207,11 @@ gs.run_command( elevation="elevation", earthworks="peak", operation="fill", + function="linear", + linear=0.5, coordinates=[400, 100], z=25, - flat=25, - rate=0.5 + flat=25 ) # Visualize @@ -239,7 +241,7 @@ then the slopes will climb at a given rate of growth. ## Command line ```{bash} -r.earthworks elevation=elevation earthworks=pit operation=cut coordinates=400,100 z=-25 flat=25 rate=0.5 +r.earthworks elevation=elevation earthworks=pit operation=cut function=linear linear=0.5 coordinates=400,100 z=-25 flat=25 ``` ## Python @@ -251,10 +253,11 @@ gs.run_command( elevation="elevation", earthworks="pit", operation="cut", + function="linear", + linear=0.5, coordinates=[400, 100], z=-25, - flat=25, - rate=0.5 + flat=25 ) # Visualize @@ -281,7 +284,7 @@ and another z-coordinate for the top of the peak. ## Command line ```{bash} -r.earthworks elevation=elevation earthworks=pit_and_peak operation=cutfill coordinates=350,100,450,100 z=-25,25 flat=25 rate=0.5 +r.earthworks elevation=elevation earthworks=pit_and_peak operation=cutfill function=linear linear=0.5 coordinates=350,100,450,100 z=-25,25 flat=25 ``` ## Python @@ -293,10 +296,11 @@ gs.run_command( elevation="elevation", earthworks="pit_and_peak", operation="cutfill", + function="linear", + linear=0.5, coordinates=[350, 100, 450, 100], z=[-25, 25], - flat=25, - rate=0.5 + flat=25 ) # Visualize @@ -335,7 +339,7 @@ Set input raster to the random cells. ```{bash} r.surf.random out=surface min=0 max=25 seed=2 r.random input=surface npoints=50 raster=random seed=7 -r.earthworks elevation=elevation earthworks=earthworks operation=fill raster=random rate=0.25 flat=25 +r.earthworks elevation=elevation earthworks=earthworks operation=fill raster=random function=linear linear=0.25 flat=25 ``` ## Python @@ -360,7 +364,8 @@ gs.run_command( earthworks="earthworks", operation="fill", raster="random", - rate=0.25, + function="linear", + linear=0.25, flat=25 ) @@ -401,4 +406,4 @@ m.show() ::: -![Contours](images/basics_06.webp) +![Contours](images/basics_06.webp) \ No newline at end of file diff --git a/content/tutorials/earthworks/earthworks.qmd b/content/tutorials/earthworks/earthworks.qmd index 0161ee3..f79303d 100644 --- a/content/tutorials/earthworks/earthworks.qmd +++ b/content/tutorials/earthworks/earthworks.qmd @@ -22,9 +22,7 @@ execute: ![Random fill operation with r.earthworks](images/earthworks_01.webp) -Learn how model terrain with {{< meta links.r_earthworks >}}. With this tool you can generate new terrain or modify existing terrain using cut and fill operations inspired by earthworking. The first tutorial on the basics of terrain modeling introduces key concepts such as cut and fill operations. The subsequent tutorials introduce more advanced concepts such as relative operations and growth and decay functions. These tutorials demonstrate how to generate terrain, model natural landforms, and model anthropogenic landforms - i.e. earthworks - such as roads, dams, and levees. Read our [paper](https://raw.githubusercontent.com/baharmon/r.earthworks/main/paper/paper.pdf) to learn more. - - +Learn how model terrain with {{< meta links.r_earthworks >}}. With this tool you can generate new terrain or modify existing terrain using cut and fill operations inspired by earthworking. The first tutorial on the basics of terrain modeling introduces key concepts such as cut and fill operations. The subsequent tutorials introduce more advanced concepts such as relative operations and growth and decay functions. These tutorials demonstrate how to generate terrain, model natural landforms, and model anthropogenic landforms - i.e. earthworks - such as roads, dams, and levees. Read our [paper](https://raw.githubusercontent.com/baharmon/r.earthworks/main/paper/paper.pdf) to learn more. ## Installation diff --git a/content/tutorials/earthworks/gullies.ipynb b/content/tutorials/earthworks/gullies.ipynb index 08937fb..25feef1 100644 --- a/content/tutorials/earthworks/gullies.ipynb +++ b/content/tutorials/earthworks/gullies.ipynb @@ -285,7 +285,7 @@ "and decay function $z = z_0 e^{-\\lambda \\sqrt{\\Delta x^2 + \\Delta y^2}}$\n", "to model the steep slopes of the gullies. Set `mode` to relative,\n", "`operation` to cut, `function` to exponential, `raster` to the raster\n", - "map of gullies, `z` to a negative value, and `rate` $\\lambda$ to a value\n", + "map of gullies, `z` to a negative value, and `exponential` $\\lambda$ to a value\n", "such as 0.1. Save an output `volume` raster to visualize volumetric\n", "change. This may take a minute to run. For faster results, try setting a\n", "lower resolution with\n", @@ -309,7 +309,7 @@ " operation=\"cut\",\n", " function=\"exponential\",\n", " raster=\"gullies\",\n", - " rate=0.1\n", + " exponential=0.1\n", " )\n", "gs.run_command(\"r.colors\", map=\"volume\", color=\"inferno\")\n", "\n", diff --git a/content/tutorials/earthworks/gullies.qmd b/content/tutorials/earthworks/gullies.qmd index f9da74d..cd2612d 100644 --- a/content/tutorials/earthworks/gullies.qmd +++ b/content/tutorials/earthworks/gullies.qmd @@ -305,7 +305,7 @@ Set `mode` to relative, `operation` to cut, `function` to exponential, `raster` to the raster map of gullies, -and `rate` $\lambda$ to a value such as 0.1. +and `exponential` $\lambda$ to a value such as 0.1. Save an output `volume` raster to visualize volumetric change. This may take a minute to run. @@ -317,7 +317,7 @@ with {{< meta links.g_region >}}. ## Command line ```{bash} -r.earthworks elevation=fractal earthworks=gullies volume=volume mode=relative operation=cut function=exponential raster=gullies rate=0.1 --overwrite +r.earthworks elevation=fractal earthworks=gullies volume=volume mode=relative operation=cut function=exponential raster=gullies exponential=0.1 --overwrite r.colors map=volume color=inferno ``` @@ -334,7 +334,7 @@ gs.run_command( operation="cut", function="exponential", raster="gullies", - rate=0.1 + exponential=0.1 ) gs.run_command("r.colors", map="volume", color="inferno") @@ -355,4 +355,4 @@ m.show() ![Gullies](images/gullies_03.webp) -![Volumetric change](images/gullies_04.webp) +![Volumetric change](images/gullies_04.webp) \ No newline at end of file diff --git a/content/tutorials/earthworks/levees.ipynb b/content/tutorials/earthworks/levees.ipynb index 6f4829e..ebdf8a3 100644 --- a/content/tutorials/earthworks/levees.ipynb +++ b/content/tutorials/earthworks/levees.ipynb @@ -376,7 +376,7 @@ "north. Then use a cut operation with\n", "[r.earthworks](https://grass.osgeo.org/grass-stable/manuals/addons/r.earthworks.html)\n", "to model the borrow area. Set `elevation` to the elevation raster,\n", - "`lines` to the borrow vector, `z` to -1.5, `rate` to 0.2, and `flat` to\n", + "`lines` to the borrow vector, `z` to -1.5, `linear` to 0.2, and `flat` to\n", "7.6." ] }, @@ -398,7 +398,7 @@ " operation=\"cut\",\n", " lines=\"borrow\",\n", " z=[-1.5],\n", - " rate=0.2,\n", + " linear=0.2,\n", " flat=7.6\n", " )\n", "\n", @@ -430,7 +430,7 @@ "Use a fill operation with\n", "[r.earthworks](https://grass.osgeo.org/grass-stable/manuals/addons/r.earthworks.html)\n", "to model the restored ridge. Set `elevation` to the earthworks raster,\n", - "`lines` to the ridge vector, `z` to 1.5, `rate` to 0.2, and `flat` to\n", + "`lines` to the ridge vector, `z` to 1.5, `linear` to 0.2, and `flat` to\n", "7.6." ] }, @@ -449,7 +449,7 @@ " operation=\"fill\",\n", " lines=\"ridges\",\n", " z=1.5,\n", - " rate=0.2,\n", + " linear=0.2,\n", " flat=7.6\n", " )\n", "\n", @@ -485,7 +485,7 @@ "with a ratio of 10H:1V. For\n", "[r.earthworks](https://grass.osgeo.org/grass-stable/manuals/addons/r.earthworks.html)\n", "set `elevation` to the earthworks raster, `lines` to the levee vector,\n", - "`z` to 5.5, `rate` to 0.1, and `flat` to 1.5." + "`z` to 5.5, `linear` to 0.1, and `flat` to 1.5." ] }, { @@ -503,7 +503,7 @@ " operation=\"fill\",\n", " lines=\"levees\",\n", " z=5.5,\n", - " rate=0.1,\n", + " linear=0.1,\n", " flat=1.5\n", " )\n", "\n", @@ -539,7 +539,7 @@ "built from rows of interlocking vertical segments \n", "of piles that are driven into the ground. \n", "Set `elevation` to the\n", - "earthworks raster, `lines` to the gaps vector, `z` to -0.6, `rate` to 1,\n", + "earthworks raster, `lines` to the gaps vector, `z` to -0.6, `linear` to 1,\n", "and `flat` to 10. The radius of flats should be set to the region\n", "resolution to ensure that the gaps are fully closed because we test our\n", "design with a flood simulation. To better visualize the results, use\n", @@ -563,7 +563,7 @@ " operation=\"cutfill\",\n", " lines=\"gaps\",\n", " z=-0.6,\n", - " rate=1,\n", + " linear=1,\n", " flat=10\n", " )\n", "\n", @@ -575,7 +575,7 @@ " operation=\"cutfill\",\n", " lines=\"closures\",\n", " z=1.37,\n", - " rate=1,\n", + " linear=1,\n", " flat=5\n", " )\n", "\n", diff --git a/content/tutorials/earthworks/levees.qmd b/content/tutorials/earthworks/levees.qmd index b599791..8d8bdd6 100644 --- a/content/tutorials/earthworks/levees.qmd +++ b/content/tutorials/earthworks/levees.qmd @@ -378,7 +378,7 @@ to model the borrow area. Set `elevation` to the elevation raster, `lines` to the borrow vector, `z` to -1.5, -`rate` to 0.2, +`linear` to 0.2, and `flat` to 7.6. ::: {.panel-tabset group="language"} @@ -387,7 +387,7 @@ and `flat` to 7.6. ```{bash} v.transform input=ridges output=borrow yshift=36 -r.earthworks elevation=elevation earthworks=earthworks operation=cut lines=borrow z=-1.5 rate=0.2 flat=7.6 +r.earthworks elevation=elevation earthworks=earthworks operation=cut lines=borrow z=-1.5 linear=0.2 flat=7.6 d.rast map=earthworks d.legend raster=earthworks color=white at=5,95,1,3 ``` @@ -406,7 +406,7 @@ gs.run_command( operation="cut", lines="borrow", z=[-1.5], - rate=0.2, + linear=0.2, flat=7.6 ) @@ -430,7 +430,7 @@ to model the restored ridge. Set `elevation` to the earthworks raster, `lines` to the ridge vector, `z` to 1.5, -`rate` to 0.2, +`linear` to 0.2, and `flat` to 7.6. ::: {.panel-tabset group="language"} @@ -438,7 +438,7 @@ and `flat` to 7.6. ## Command line ```{bash} -r.earthworks elevation=earthworks earthworks=earthworks operation=fill lines=ridges z=1.5 rate=0.2 flat=7.6 --overwrite +r.earthworks elevation=earthworks earthworks=earthworks operation=fill lines=ridges z=1.5 linear=0.2 flat=7.6 --overwrite d.rast map=earthworks d.legend raster=earthworks color=white at=5,95,1,3 ``` @@ -454,7 +454,7 @@ gs.run_command( operation="fill", lines="ridges", z=1.5, - rate=0.2, + linear=0.2, flat=7.6 ) @@ -483,7 +483,7 @@ For {{< meta links.r_earthworks >}} set `elevation` to the earthworks raster, `lines` to the levee vector, `z` to 5.5, -`rate` to 0.1, +`linear` to 0.1, and `flat` to 1.5. ::: {.panel-tabset group="language"} @@ -491,7 +491,7 @@ and `flat` to 1.5. ## Command line ```{bash} -r.earthworks elevation=earthworks earthworks=earthworks operation=fill lines=levees z=5.5 rate=0.1 flat=1.5 --overwrite +r.earthworks elevation=earthworks earthworks=earthworks operation=fill lines=levees z=5.5 linear=0.1 flat=1.5 --overwrite d.rast map=earthworks d.legend raster=earthworks color=white at=5,95,1,3 ``` @@ -507,7 +507,7 @@ gs.run_command( operation="fill", lines="levees", z=5.5, - rate=0.1, + linear=0.1, flat=1.5 ) @@ -535,7 +535,7 @@ of piles that are driven into the ground. Set `elevation` to the earthworks raster, `lines` to the gaps vector, `z` to -0.6, -`rate` to 1, +`linear` to 1, and `flat` to 10. The radius of flats should be set to the region resolution @@ -551,8 +551,8 @@ for hillshading. ## Command line ```{bash} -r.earthworks elevation=earthworks earthworks=earthworks operation=cutfill lines=gaps z=-0.6 rate=1 flat=10 --overwrite -r.earthworks elevation=earthworks earthworks=earthworks operation=cutfill lines=closures z=1.37 rate=1 flat=5 --overwrite +r.earthworks elevation=earthworks earthworks=earthworks operation=cutfill lines=gaps z=-0.6 linear=1 flat=10 --overwrite +r.earthworks elevation=earthworks earthworks=earthworks operation=cutfill lines=closures z=1.37 linear=1 flat=5 --overwrite r.relief input=earthworks output=relief zscale=10 --overwrite d.shade shade=relief color=earthworks brighten=36 d.legend raster=earthworks color=white at=5,95,1,3 @@ -569,7 +569,7 @@ gs.run_command( operation="cutfill", lines="gaps", z=-0.6, - rate=1, + linear=1, flat=10 ) @@ -581,7 +581,7 @@ gs.run_command( operation="cutfill", lines="closures", z=1.37, - rate=1, + linear=1, flat=5 ) @@ -643,4 +643,4 @@ m.save("images/levees_09.webp") ::: -![Flood simulation](images/levees_09.webp) +![Flood simulation](images/levees_09.webp) \ No newline at end of file diff --git a/content/tutorials/earthworks/synthesis.ipynb b/content/tutorials/earthworks/synthesis.ipynb index 0f85c2d..7f71059 100644 --- a/content/tutorials/earthworks/synthesis.ipynb +++ b/content/tutorials/earthworks/synthesis.ipynb @@ -455,7 +455,7 @@ "[r.earthworks](https://grass.osgeo.org/grass-stable/manuals/addons/r.earthworks.html).\n", "Model a fill operation with the extracted textures relative to the\n", "fractal terrain. Try setting an exponential rate of decay such as\n", - "`rate=0.025`. Add a `volume` output to visualize the volumetric change." + "`exponential=0.025`. Add a `volume` output to visualize the volumetric change." ] }, { @@ -475,7 +475,7 @@ " operation=\"fill\",\n", " function=\"exponential\",\n", " raster=\"ridges\",\n", - " rate=0.025\n", + " exponential=0.025\n", " )\n", "\n", "# Visualize\n", diff --git a/content/tutorials/earthworks/synthesis.qmd b/content/tutorials/earthworks/synthesis.qmd index b981fad..f3119f1 100644 --- a/content/tutorials/earthworks/synthesis.qmd +++ b/content/tutorials/earthworks/synthesis.qmd @@ -396,7 +396,7 @@ Model a fill operation with the extracted textures relative to the fractal terrain. Try setting an exponential rate of decay -such as `rate=0.025`. +such as `exponential=0.025`. Add a `volume` output to visualize the volumetric change. @@ -405,7 +405,7 @@ the volumetric change. ## Command line ```{bash} -r.earthworks elevation=fractal earthworks=synthesis volume=volume mode=relative operation=fill function=exponential raster=ridges rate=0.025 +r.earthworks elevation=fractal earthworks=synthesis volume=volume mode=relative operation=fill function=exponential raster=ridges exponential=0.025 ``` ## Python @@ -421,7 +421,7 @@ gs.run_command( operation="fill", function="exponential", raster="ridges", - rate=0.025 + exponential=0.025 ) # Visualize @@ -440,4 +440,4 @@ m.show() ![Terrain synthesis](images/synthesis_06.webp) -![Volumetric change](images/synthesis_07.webp) +![Volumetric change](images/synthesis_07.webp) \ No newline at end of file