Adding Data
Two rasters can be combined in a way when one raster supplies a certain layer of information - for example, one raster might contain only a road network (surface and labels), and another raster works as a background.
Classifying only road related cells from the raster map requires quite a complex condition - it should consider major routes (yellow), regular roads (white), and labels on both kinds of roads (labels have different colors). If if the cell satisfies the condition, we can take it from the road raster, otherwise we use the background raster:
if((B[0]==B[1] && B[0]==B[2]) || (abs(B[0]-B[1])<=5 && (B[0]-B[2]>6 && B[0]<100) || (B[0]-B[2]>20 && B[0]>100)), B[0], A[0]);
if((B[0]==B[1] && B[0]==B[2]) || (abs(B[0]-B[1])<=5 && (B[0]-B[2]>6 && B[0]<100) || (B[0]-B[2]>20 && B[0]>100)), B[1], A[1]);
if((B[0]==B[1] && B[0]==B[2]) || (abs(B[0]-B[1])<=5 && (B[0]-B[2]>6 && B[0]<100) || (B[0]-B[2]>20 && B[0]>100)), B[2], A[2])
This is how the result looks:
|
Roads |
Background |
|---|
|

|

|
|
Combined |
|---|
 |
You may note that the condition stays the same for all three bands and only index of the band is changing in the last portion of the statement. We can redesign our workspace in a way that would require only one condition, but it requires many more transformers.
-
See attachment: AddingLayer.fmwt