Terrain Modifier
Default UI Menu: Architecture/Add Terrain Modifier
Ribbon UI Menu:

You can add or remove material from a terrain around a closed, 2D profile.
- Start with a terrain, and create a closed 2D shape, such as a rectangle.

- In this example, the shape is placed vertically so that part of it is below the terrain, and part of it is above.

- Activate Terrain Modifier, and select the terrain to modify. Then select the closed shape. Material is added or removed as needed to meet the shape.

- To slope the terrain around the modified shape, add an Offset value.

This is the result:
