Some noob suggested transparency, which is a bad idea

What he should have told you is to use a more conventional masking technique.
Here's one...
Create two shaders, one for the terrain, and one for not the terrain.
Create your mask and plug it into the fractal breakup of each shader.
Set the coverage for both to 0.5, and fractal breakup to 1
Invert the fractal breakup for the "NOT terrain" shader
Connect the surfacing for each part into the child layer input of the corresponding masked shader.
Alternatively you could use a merge shader, using the mask as the merge function with your two surfaces as the input.
Here's a sample TGD (minus terrain) using a function mask I created for merging terrains. The TER Metres node is the equivalent of the image width. (may not render with 1.08)