BobTheBuilder¶
Builds an artifact into an elevation model: a dam, an embankment, a levee, a ramp. The artifact is given as a polygon, its outline, and as points with its elevations, as the crest of a dam. Inside the polygon, the module interpolates the elevations of the points and puts them into the raster; outside, the raster is not changed.
By default the artifact is only added: where the terrain is higher than the artifact, the terrain is kept. So the polygon of a dam can be drawn wider than the valley, into its slopes, and the dam ends where it meets them, without cutting them. With erosion enabled, the interpolated elevations replace the terrain everywhere in the polygon, also lowering it, as for an excavation or a channel.
The modified elevation model is the input of the hydrological analyses of the scenario with the artifact: the flow directions and the basins with a dam, the areas protected by a levee.
Details¶
The elevations inside the polygon are interpolated with the inverse distance weighting, with the square of the distance, from the points within the maximum radius of each cell. The cells with no point within the radius keep their elevation. The cells outside the polygon are not changed.
Without erosion, the artifact is only added: the cells where the raster is higher than the interpolated elevation keep their value, so a dam can be drawn wider than the valley, into its slopes. With erosion, the interpolated elevations replace the raster in the whole polygon, also lowering it, as for an excavation.
With the border of the polygon, the raster elevations along it are added to the points, so that the interpolated surface joins the surrounding terrain, as for a ramp.
Parameters¶
Builds an artifact, as a dam, an embankment or a levee, into an elevation model: inside a polygon, the elevations are interpolated from points with the elevation of the artifact, and replace the ones of the raster where they are higher, or everywhere if erosion is enabled.
Toolbox folder: Raster Processing
Status: Experimental
Keywords: Build, Raster
Authors: Andrea Antonello
Class: org.hortonmachine.modules.BobTheBuilder
Inputs
Parameter |
Type |
Unit |
Default |
Description |
|---|---|---|---|---|
|
raster file |
The elevation model to modify. |
||
|
vector file |
The vector with the single polygon of the artifact, within the raster. |
||
|
vector file |
The vector of the points with the elevations of the artifact, at least 4. |
||
|
double |
m |
|
The maximum distance of the points used to interpolate a cell. If negative, the largest side of the bounds of the polygon. |
|
String |
The field of the points with their elevation. |
||
|
boolean |
|
If true, the interpolated elevations replace the raster also where it is higher, lowering it. |
|
|
boolean |
|
If true, only the points inside the polygon are used, else all of them. |
|
|
boolean |
|
If true, the raster elevations along the border of the polygon are added to the points, to join the artifact to the terrain. |
Outputs
Parameter |
Type |
Unit |
Description |
|---|---|---|---|
|
output file |
The elevation model with the artifact. |
Example¶
The example builds a dam across a valley of the sample elevation model of the manual, dtm_flanginec.tif in docs/manual/modules/maps/data. The polygon of the dam, dam.geojson, is 30 m thick and crosses the valley into its slopes; the points of its crest, dam_crest.geojson, are all at 1310 m:
import org.hortonmachine.modules.BobTheBuilder
// the folder with the elevation model: change it to yours
var folder = "/data/flanginec/"
// a dam across a valley, drawn as a polygon wider than the valley,
// with points along its crest at 1310 m
var bob = new BobTheBuilder()
bob.inRaster = folder + "dtm_flanginec.tif"
bob.inArea = folder + "dam.geojson"
bob.inElevations = folder + "dam_crest.geojson"
bob.fElevation = "elev"
bob.outRaster = folder + "dtm_dam.tif"
bob.process()
The two vectors, as they would be drawn in a GIS, here written as GeoJSON in the coordinates of the elevation model, declared by their crs member (EPSG:3003). The polygon of the dam, whose field height is used by the example of RasterExtruder:
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "EPSG:3003" } },
"features": [
{
"type": "Feature",
"properties": { "name": "dam", "height": 20.0 },
"geometry": {
"type": "Polygon",
"coordinates": [[
[1638200, 5112420], [1638220, 5112440], [1638460, 5112200], [1638440, 5112180], [1638200, 5112420]
]]
}
}
]
}
The points of the crest, with their elevation in the field elev:
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "EPSG:3003" } },
"features": [
{ "type": "Feature", "properties": { "elev": 1310.0 }, "geometry": { "type": "Point", "coordinates": [1638210, 5112430] } },
{ "type": "Feature", "properties": { "elev": 1310.0 }, "geometry": { "type": "Point", "coordinates": [1638270, 5112370] } },
{ "type": "Feature", "properties": { "elev": 1310.0 }, "geometry": { "type": "Point", "coordinates": [1638330, 5112310] } },
{ "type": "Feature", "properties": { "elev": 1310.0 }, "geometry": { "type": "Point", "coordinates": [1638390, 5112250] } },
{ "type": "Feature", "properties": { "elev": 1310.0 }, "geometry": { "type": "Point", "coordinates": [1638450, 5112190] } }
]
}
The elevation model with the dam in 3D, in the NWW Viewer, looking up the valley: the dam closes the valley as a wall, and ends where the slopes are higher than its crest. The output dtm_dam.tif is used as the terrain and draped with its elevation colors, under a half transparent map of its aspect, from Aspect, which brings out the faces of the dam.¶
The height of the dam over the terrain: highest over the bottom of the valley, zero on the slopes higher than the crest.¶