2015年9月24日 星期四

QGIS : Merge two layers using Raster calculator 合併圖層

Press Ctrl+Alt+M open commander

Open Processing algorithm: Raster calculator



QGIS 2.10.x 


  • Main input layer 
Select first input layer ( as variable a, high resolution DEM, sea level == 0 )





  • Additonal layers 
Select second input layer ( as variable b, low resolution Bathymetry )


  • Formula 

ifelse(eq(a,0), b, a)
if a == 0 then output b else output a

  • Result 

The resulting layer ( the resolution of the main input layer will be used. )




Note :
Replace the values zero (sea level) of the first layer with the values from the second layer (Bathymetry).
The layer variables name are named using letters a, b, c... or g1, g2, g3...

Operator for formula :

+ Addition

- Subtraction

* Multiplication

/ Division

^ power

abs(x) - absolute value

sqrt(x) - square root

ln(x) - natural logarithm

log(x) - base 10 logarithm

exp(x) - exponential

sin(x) - sine

cos(x) - cosine

tan(x) - tangent

asin(x) - arcsine

acos(x) - arccosine

atan(x) - arctangent

atan2(x, y) - arctangent of x/y

gt(x, y) - if x>y the result is 1.0, else 0.0

lt(x, y) - if x<y the result is 1.0, else 0.0

eq(x, y) - if x=y the result is 1.0, else 0.0

mod(x, y) - returns the floating point remainder of x/y

ifelse(c, x, y) - if c=1 the result is x, else y

int(x) - integer part of floating point value x

pi() - returns the value of Pi

沒有留言:

張貼留言