Outdated version of the documentation. Find the latest one here.

` `

외부 응용 프로그램 환경 설정

The processing framework can be extended using additional applications. Currently, SAGA, GRASS, OTB (Orfeo Toolbox) and R are supported, along with some other command-line applications that provide spatial data analysis functionalities. Algorithms relying on an external applications are managed by their own algorithm provider.

This section will show you how to configure the processing framework to include these additional applications, and it will explain some particular features of the algorithms based on them. Once you have correctly configured the system, you will be able to execute external algorithms from any component like the toolbox or the graphical modeler, just like you do with any other geoalgorithm.

기본적으로, QGIS가 내장하지 않은 외부 응용 프로그램에 의존하는 모든 알고리즘은 활성화된 상태가 아닙니다. 설정 대화창에서 이런 알고리즘을 활성화시킬 수 있지만, 사용자 시스템에 해당 응용 프로그램이 이미 설치돼 있어야 합니다.

윈도우 사용자를 위한 소고

If you are not an advanced user and you are running QGIS on Windows, you might not be interested in reading the rest of this chapter. Make sure you install QGIS in your system using the standalone installer. That will automatically install SAGA, GRASS and OTB in your system and configure them so they can be run from QGIS. All the algorithms from these providers will be ready to be run without needing any further configuration. If installing through OSGeo4W application, make sure you select for installation SAGA, GRASS and OTB as well.

If you want to know more about how these providers work, or if you want to use some algorithms not included in the simplified toolbox (such as R scripts), keep on reading.

파일 포맷에 대한 소고

외부 소프트웨어 사용 시, QGIS가 파일을 열 수 있다는 것이 다른 소프트웨어도 해당 파일을 열고 처리할 수 있다는 의미는 아닙니다. 대부분의 경우 다른 소프트웨어도 QGIS가 연 파일을 읽을 수 있지만, 어떤 경우 읽을 수 없을 수도 있습니다. 데이터베이스 또는 흔하지 않은 파일 포맷을 사용하는 경우, 그것이 래스터 레이어든 벡터 레이어든, 문제가 발생할 수도 있습니다. 이런 경우 QGIS와 외부 소프트웨어 둘 다 지원하고 있는 것이 확실한, 잘 알려진 파일 포맷으로 바꿔서 해본 다음, (이력 및 로그 대화창에서) 콘솔 산출물을 확인해서 뭐가 잘못된 건지 자세히 알아보십시오.

GRASS 래스터 레이어를 사용하면, 예를 들어 GRASS 래스터 레이어를 입력받는 외부 알고리즘을 호출했는데 문제가 발생해서 작업을 완료할 수 없는 경우가 있을 수도 있습니다. 이런 이유 때문에 알고리즘에 GRASS 래스터 레이어를 사용할 수 없는 것입니다.

You should, however, find no problems at all with vector layers, since QGIS automatically converts from the original file format to one accepted by the external application before passing the layer to it. This adds extra processing time, which might be significant if the layer has a large size, so do not be surprised if it takes more time to process a layer from a DB connection than it does to process one of a similar size stored in a shapefile.

외부 응용 프로그램을 사용하지 않는 제공자는, QGIS를 통해서 레이어를 열어 분석하기 때문에 QGIS가 열 수 있는 모든 레이어를 처리할 수 있습니다.

산출물 포맷에 관해서는, 래스터 및 벡터 레이어 모두 QGIS가 산출물 포맷으로 지원하는 모든 포맷을 사용할 수 있습니다. 일부 제공자가 특정 포맷을 지원하지 않는 경우에도, 모든 제공자가 QGIS가 나중에 자동 변환할 수 있는 공통 포맷으로 내보낼 수 있기 때문입니다. 입력 레이어에 이런 변환 작업이 필요한 경우 공간 처리 작업 시간이 늘어날 수도 있습니다.

벡터 레이어 선택에 대한 소고

외부 응용 프로그램이 QGIS 안에 존재하는 벡터 레이어 선택 집합을 인지하게 만들 수도 있습니다. 하지만 원본 벡터 레이어들이 외부 응용 프로그램이 지원하지 않는 포맷인 경우, 이렇게 하려면 모든 입력 벡터 레이어를 재작성해야만 합니다. 어떤 선택 집합도 없을 때만, 또는 공간 처리 일반 환경 설정에서 unchecked Use only selected features 옵션이 비활성화된 경우에만 외부 응용 프로그램으로 레이어를 직접 넘겨줄 수 있습니다.

그 외의 경우, 선택한 객체만 내보내야 하는데 이렇게 되면 실행 시간이 늘어나게 됩니다.

SAGA

사용자 시스템에 SAGA를 설치했고 공간 처리 프레임워크가 SAGA 실행 파일을 찾을 수 있도록 제대로 환경 설정했다면, QGIS에서 SAGA 알고리즘을 실행할 수 있습니다. SAGA 알고리즘을 실행하려면 그 중에서도 SAGA 명령 줄 실행 파일이 필요합니다.

사용자가 윈도우를 실행 중이라면 단독형 인스톨러와 OSGeo4W 인스톨러 모두 QGIS와 함께 SAGA를 포함하고 있으며 경로를 자동적으로 환경 설정하기 때문에 추가 작업을 할 필요가 없습니다.

사용자의 QGIS 인스톨러가 SAGA를 포함하고 있지 않아 사용자가 SAGA를 직접 설치한 경우, SAGA 실행 파일을 가리키는 경로를 환경 설정해야만 합니다. 환경 설정 대화창을 열어서 SAGA 부분을 보면, SAGA Folder 라는 설정 옵션이 있습니다. SAGA가 설치된 폴더를 가리키는 경로를 입력하십시오. 환경 설정 대화창을 종료하면 이제 QGIS에서 SAGA 알고리즘을 실행할 수 있습니다.

사용자가 리눅스를 실행 중이라면 공간 처리 패키지에 SAGA 바이너리가 포함돼 있지 않기 때문에 사용자가 소프트웨어를 직접 다운로드해서 설치해야 합니다. 자세한 내용은 SAGA 웹사이트 를 확인해주십시오.

사용자가 직접 설치한 경우 SAGA 실행 파일을 가리키는 경로를 환경 설정할 필요가 없으며 환경 설정 대화창에서 SAGA Folder 라는 설정 옵션을 찾을 수 없을 겁니다. 그 대신, 사용자는 SAGA가 제대로 설치됐는지 그리고 설치 폴더가 PATH 환경 변수에 추가됐는지 확인해야 합니다. 그냥 콘솔을 연 다음 saga_cmd 라고 입력해서 시스템이 SAGA 바이너리가 있는 곳을 찾을 수 있는지 확인하면 됩니다.

SAGA 그리드 시스템 제약에 관해

입력 래스터 데이터 여러 개를 요구하는 SAGA 알고리즘 대부분은 입력 래스터가 동일한 그리드 시스템을 보유하고 있을 것을 요구합니다. 즉, 입력 래스터들이 동일한 지리 영역을 커버하고 동일한 셀 크기를 가지고 있어야만 하기 때문에 그에 대응하는 그리드들도 일치해야만 한다는 뜻입니다. QGIS에서 SAGA 알고리즘을 호출하는 경우 사용자는 셀 크기나 범위에 상관없이 어떤 레이어든 사용할 수 있습니다. SAGA 알고리즘이 여러 래스터 레이어를 입력받아야 한다면 (해당 알고리즘이 서로 다른 그리드 시스템을 가진 레이어들을 처리할 수 없는 경우) QGIS가 래스터들을 공통 그리드 시스템으로 리샘플링해서 SAGA에 넘겨줍니다.

이때 공통 그리드 시스템은 사용자가 정의합니다. 설정 대화창에서 SAGA 그룹에 있는 파라미터 몇 가지를 사용해서 정의할 수 있습니다. 다음 두 가지 방법 가운데 하나로 대상 그리드 시스템을 설정합니다:

  • 직접 설정합니다. 다음 파라미터의 값을 설정해서 범위를 정의합니다:

    • Resampling min X
    • Resampling max X
    • Resampling min Y
    • Resampling max Y
    • Resampling cellsize

    설정한 범위와 입력 레이어의 범위가 일치하지 않더라도 QGIS가 입력 레이어들을 설정한 범위로 리샘플링할 것이라는 사실을 유념하십시오.

  • 입력 레이어로부터 자동 설정합니다. 이 옵션을 선택하려면, checkbox Use min covering grid system for resampling 옵션을 체크하면 됩니다. 다른 모든 설정을 무시하고 모든 입력 레이어를 커버하는 최소 범위를 사용할 것입니다. 대상 레이어의 셀 크기는 입력 레이어들의 모든 셀 크기 가운데 가장 큰 크기를 사용합니다.

여러 래스터 레이어를 사용하지 않는 알고리즘의 경우, 또는 유일한 입력 그리드 시스템을 요구하지 않는 알고리즘의 경우 SAGA 호출 전에 리샘플링을 하지 않으므로 이런 파라미터들도 사용하지 않습니다.

다중 밴드 레이어에 대한 제약

QGIS와 달리, SAGA는 다중 밴드 레이어를 지원하지 않습니다. (RGB 또는 다중 스펙트럼 이미지 같은) 다중 밴드 레이어를 사용하고 싶다면 먼저 해당 레이어를 단일 밴드 이미지로 분할해야 합니다. RGB 이미지에서 이미지 3개를 생성하는 SAGA/Grid - Tools/Split RGB image 알고리즘을 사용하거나 또는 단일 밴드 이미지를 추출하는 SAGA/Grid - Tools/Extract band 알고리즘을 사용하면 됩니다.

셀 크기에 대한 제약

SAGA는 래스터 레이어의 X 및 Y 방향의 셀 크기가 동일하다고 가정하고 있습니다. 수평 및 수직 셀 크기가 다른 레이어를 작업하는 경우, 기대하지 않은 결과물이 나올 수도 있습니다. 이런 경우, SAGA가 처리하기에 적합하지 않은 입력 레이어일 수도 있다는 경고 메시지가 공간 처리 로그에 추가될 것입니다.

로그 작업

QGIS가 SAGA를 호출할 때 SAGA 명령 줄 인터페이스를 사용해서 필요한 모든 작업을 수행하기 위한 명령어 집합을 넘겨줍니다. SAGA는 그 진행 상태를 콘솔에 정보를 작성해서 표시하는데, 이 정보는 이미 완료된 공간 처리 작업의 백분율 및 부가적인 내용을 포함합니다. 알고리즘 실행 도중 이 산출 정보를 필터링해서 진행 상태 막대를 업데이트합니다.

QGIS가 전송한 명령어는 물론 SAGA가 출력한 부가 정보도 기타 공간 처리 로그 메시지와 함께 로그에 작성될 수 있습니다. QGIS가 SAGA 알고리즘을 실행하는 과정에서 어떤 일이 일어나는지를 세밀하게 추적할 수 있는 유용한 정보입니다. 이런 로그 작업 기제를 활성화하려면, checkbox Log console outputcheckbox Log execution commands 두 옵션을 체크하십시오.

명령 줄 인터페이스를 통해 외부 응용 프로그램을 호출해서 사용하는 다른 제공자들 대부분도 비슷한 옵션을 가지고 있습니다. 공간 처리 설정 목록의 해당 제공자 부분에서 이런 옵션을 찾을 수 있을 겁니다.

R 스크립트 생성

QGIS의 R 통합은 사용자가 실행할 수 있는 사전 정의된 알고리즘 집합이 (몇몇 예시 알고리즘을 제외하면) 없다는 점에서 SAGA 통합과 다릅니다. 그 대신, R 환경에서 작업하는 방식 및 공간 처리 스크립트에 관한 절에서 설명한 방식과 매우 비슷하게, 사용자가 직접 스크립트를 작성하고 R 명령어를 호출해야 합니다. 여기에서는 QGIS에서 이런 R 명령어를 호출하기 위한 문법과 R 명령어에서 QGIS 객체(레이어, 테이블)를 사용하는 방법을 설명하겠습니다.

SAGA의 경우와 마찬가지로, 사용자는 제일 먼저 QGIS에 R 바이너리가 있는 위치를 알려줘야 합니다. 공간 처리 환경 설정 대화창에 있는 R folder 옵션에서 설정해주면 됩니다. 해당 파라미터를 설정하고 나면, 사용자 고유의 R 스크립트를 생성하고 실행할 수 있습니다.

주석

윈도우 사용자의 경우, R 실행 파일은 보통 C:\Program Files\R\R-3.2 폴더에 있습니다. 바이너리 파일이 아니라 폴더만 추가하세요!

이번에도 역시 리눅스에서는 상황이 다릅니다. 사용자는 R 폴더 경로가 PATH 환경 변수에 포함되어 있는지 확인만 하면 됩니다. 콘솔에서 R 이라고만 입력해서 R을 구동할 수 있다면 준비가 다 된 것입니다.

R 함수를 (또는 사용자가 작성해서 QGIS에서 사용하고자 하는 좀 더 복잡한 R 스크립트를) 호출하는 새 알고리즘을 추가하려면, 공간 처리 프레임워크에 해당 작업을 수행하는 방법 및 작업을 수행하기 위한 R 명령어를 알려주는 스크립트 파일을 생성해야 합니다.

R 스크립트 파일의 확장자는 .rsx 이며, R 문법 및 R 스크립트 작성에 대한 기초 지식만 있다면 R 스크립트를 꽤 간단하게 생성할 수 있습니다. R 스크립트 파일은 R 스크립트 폴더에 저장해야 합니다. 일반적인 공간 처리 스크립트를 위한 폴더를 설정하는 것과 마찬가지로, 공간 처리 설정 대화창에 있는 R 그룹에서 해당 폴더를 설정할 수 있습니다.

입력 폴리곤 레이어에 있는 폴리곤의 경계 내부에 랜덤한 그리드를 생성하는 R 메소드 spsample 을 호출하는 아주 간단한 스크립트 파일을 살펴보겠습니다. 이 메소드는 maptools 패키지에 속해 있습니다. 사용자가 QGIS에 통합하고 싶을 거의 모든 알고리즘이 공간 데이터를 사용하거나 생성하기 때문에, 사용자는 maptools 그리고 특히 sp 같은 공간 패키지에 대해 잘 알고 있어야만 합니다.

##polyg=vector
##numpoints=number 10
##output=output vector
##sp=group
pts=spsample(polyg,numpoints,type="random")
output=SpatialPointsDataFrame(pts, as.data.frame(pts))

2중 파이썬 주석 기호(##)로 시작하는 첫 몇 행이 QGIS에 파일이 설명하고 있는 알고리즘의 입력물 및 해당 알고리즘이 생성하는 산출물을 알려줍니다. 앞에서 설명한 공간 처리 스크립트와 정확히 동일한 문법을 사용하므로 다시 설명하지는 않겠습니다.

사용자 고유의 R 스크립트를 어떻게 작성하는지에 대한 자세한 정보를 알고 싶다면 QGIS 교육 교재의 R 소개R 문법 을 살펴보시기 바랍니다.

입력물 파라미터를 선언하는 경우, QGIS는 해당 정보를 해당 파라미터의 값을 사용자에게 요청하기 위한 사용자 인터페이스를 생성하고, 나중에 R 명령어에 입력할 수 있는 R 변수를 생성한다는 두 가지 목적을 위해 사용합니다.

앞의 예시에서, polyg 라는 vector 입력물 유형을 선언하고 있습니다. 이 알고리즘을 실행하면, QGIS가 R에 사용자가 선택한 레이어를 열어서 역시 polyg 라는 명칭을 가진 변수에 저장할 것입니다. 즉, 파라미터명이 R에서 해당 파라미터의 값에 접근하기 위해 사용할 수 있는 변수명이기도 합니다. (따라서 예비 R 명칭을 파라미터명으로 사용해서는 안 됩니다.)

벡터 및 래스터 레이어 같은 공간 요소는 readOGR()brick() 명령어를 사용해서 (사용자 스크립트 파일에 이런 명령어를 추가하지 않아도 됩니다 – QGIS가 처리할 테니까요.) 읽어들여 Spatial*DataFrame 객체로 저장합니다. 테이블 필드 유형은 선택한 필드의 명칭을 담고 있는 문자열로 저장합니다.

테이블은 read.csv() 명령어를 사용해서 엽니다. 사용자가 입력한 테이블이 CSV 포맷이 아닐 경우, R로 가져오기 전에 CSV 포맷으로 변환할 것입니다.

또한, ##usereadgdal 태그를 사용하는 경우 brick() 대신 readGDAL() 명령어를 통해 래스터 파일을 읽어들일 수 있습니다.

사용자가 고급 사용자이며 QGIS가 레이어를 표현하는 객체를 생성하기를 원하지 않는다면, 객체 대신 파일명을 담은 문자열을 선호한다고 알려주는 ##passfilenames 태그를 사용하면 됩니다. 이 태그를 사용할 경우, 파일이 담고 있는 데이터에 대해 어느 작업도 하기 전에 사용자가 해당 파일을 열어야 합니다.

이런 정보를 바탕으로, 이제 예시 스크립트의 (파이썬 주석 기호로 시작하지 않는) 첫 행을 이해할 수 있습니다.

pts=spsample(polyg,numpoints,type="random")

polyg 변수가 이미 SpatialPolygonsDataFrame 객체를 담고 있기 때문에 이 변수를 사용해서 spsample 메소드를 호출할 수 있습니다. 생성된 동일 그리드에 포인트를 몇 개 추가할지 나타내는 numpoints 변수도 마찬가지입니다.

이미 산출물 유형을 output 이라는 벡터 레이어로 선언했기 때문에, output 이라는 명칭을 가진 변수를 생성해서 해당 변수에 Spatial*DataFrame 객체를 (이 경우 SpatialPointsDataFrame) 저장해야 합니다. 중간 단계 변수는 사용자 마음대로 명명해도 됩니다. 단 최종 산출물을 저장하는 변수가 선언하는 데 사용했던 명칭과 동일한 명칭을 가지고 있는지, 그리고 해당 변수가 적합한 값을 담고 있는지 확인하십시오.

이 경우, spsample 메소드의 산출물을 SpatialPointsDataFrame 객체로 명백하게 변환해야 합니다. 산출물 자체가 QGIS에 그대로 반환하기에 적합하지 않은 ppp 클래스의 객체이기 때문입니다.

사용자 알고리즘이 래스터 레이어를 생성하는 경우, 사용자가 ##dontuserasterpackage 태그를 사용했는지 여부에 따라 래스터를 저장하는 방식이 달라질 것입니다. 해당 태그를 사용했다면, writeGDAL() 메소드를 사용해서 레이어를 저장합니다. 사용하지 않았다면, raster 패키지의 writeRaster() 메소드를 사용할 것입니다.

##passfilenames 태그를 사용한 경우, 입력물에 대해 raster 패키지를 사용하지 않았더라도 raster 패키지의 writeRaster() 메소드를 통해 산출물을 생성할 것입니다.

사용자 알고리즘이 어떤 레이어도 생성하지 않지만, 그 대신 콘솔에 텍스트 산출물을 생성하는 경우 알고리즘 실행이 완료된 후 콘솔을 열고 싶다는 표현을 해야 합니다. 그렇게 하려면 사용자가 출력하고자 하는 산출물을 생성하는 명령어 행 앞에 > (‘초과’) 기호를 삽입하기만 하면 됩니다. 다른 명령어 행의 산출물은 표시되지 않을 것입니다. 예를 들면, 다음 스크립트 알고리즘 파일은 벡터 레이어의 속성에서 선택한 필드(열)에 대해 정규성 검정(normality test)을 수행합니다:

##layer=vector
##field=field layer
##nortest=group
library(nortest)
>lillie.test(layer[[field]])

마지막 행의 산출물을 출력하지만, 그 위 행의 산출물은 출력되지 않습니다. (그리고 각 행의 산출물 가운데 어느 쪽도 QGIS에 자동적으로 추가되지 않습니다.)

사용자 알고리즘이 (plot() 메소드를 사용해서) 어느 종류의 그래픽이라도 생성하는 경우, 다음 태그를 추가하십시오:

##showplots

이 태그를 사용하면, QGIS가 모든 R 그래픽 산출물을 임시 파일로 돌려서, R 실행이 종료된 다음 불러올 것입니다.

콘솔 및 그래픽 산출물 둘 다 공간 처리 산출물 관리자에 표시될 것입니다.

더 자세한 정보를 원한다면, 공간 처리 패키지가 제공하는 스크립트 파일을 확인해보십시오. 대부분 단순한 편이라 사용자 고유의 스크립트를 어떻게 생성하는지 이해하는 데 큰 도움을 줄 것입니다.

주석

기본적으로 rgdalraster 라이브러리를 불러오기 때문에, 사용자가 상응하는 library() 명령어를 추가하지 않아도 됩니다. (사용자의 R 배포판에 저 2개의 패키지가 설치되어 있는지만 확인하면 됩니다.) 하지만, 필요할 수도 있는 기타 추가 라이브러리는 예를 들어 library(ggplot2) 와 같이 직접 입력해서 명시적으로 불러와야 합니다. 해당 패키지가 사용자 시스템 상에 설치돼 있지 않다면, 공간 처리 패키지가 다운로드해서 설치할 것입니다. 이렇게 하면 R 단독형 소프트웨어도 해당 패키지를 사용할 수 있습니다. 패키지를 다운로드해야 할 경우, 스크립트를 처음 실행할 때 시간이 오래 걸릴 수도 있다는 사실을 명심하십시오.

GRASS

Configuring GRASS is not much different from configuring SAGA. First, the path to the GRASS folder has to be defined, but only if you are running Windows. Additionally, a shell interpreter (usually msys.exe, which can be found in most GRASS for Windows distributions) has to be defined and its path set up as well.

By default, the processing framework tries to configure its GRASS connector to use the GRASS distribution that ships along with QGIS. This should work without problems in most systems, but if you experience problems, you might have to configure the GRASS connector manually. Also, if you want to use a different GRASS installation, you can change that setting and point to the folder where the other version is installed. GRASS 6.4 is needed for algorithms to work correctly.

리눅스 환경인 경우, GRASS가 정확하게 설치됐는지 그리고 콘솔에서 문제없이 실행할 수 있는지만 확인해주면 됩니다.

GRASS 알고리즘은 계산 시 영역(region)을 사용합니다. SAGA 환경 설정에서와 비슷한 값들을 사용해서 이 영역을 직접 정의할 수도 있고, 또는 알고리즘 실행 시 사용되는 모든 입력 레이어를 커버하는 최소 범위를 받아 자동으로 정의하도록 할 수도 있습니다. 만약 두 번째 습성을 선호한다면, GRASS 환경 설정 파라미터 가운데 checkbox Use min covering region 옵션을 체크하면 됩니다.

GDAL

No additional configuration is needed to run GDAL algorithms. Since they are already incorporated into QGIS, the algorithms can infer their configuration from it.

Orfeo Toolbox

Orfeo Toolbox (OTB) algorithms can be run from QGIS if you have OTB installed in your system and you have configured QGIS properly, so it can find all necessary files (command-line tools and libraries).

As in the case of SAGA, OTB binaries are included in the stand-alone installer for Windows, but they are not included if you are running Linux, so you have to download and install the software yourself. Please check the OTB website for more information.

Once OTB is installed, start QGIS, open the processing configuration dialog and configure the OTB algorithm provider. In the Orfeo Toolbox (image analysis) block, you will find all settings related to OTB. First, ensure that algorithms are enabled.

Then, configure the path to the folder where OTB command-line tools and libraries are installed:

  • nix Usually OTB applications folder points to /usr/lib/otb/applications and OTB command line tools folder is /usr/bin.
  • win If you use any of the installers that include OTB, such as OSGeo4W, there is no need for further configuration. Processing will detect the path automatically and will not show the corresponding configuration entries. Otherwise, fill the OTB applications folder and OTB command line tools folder parameters with the to the corresponding values for your installation.

TauDEM

TauDEM (Terrain Analysis Using Digital Elevation Models) is a tools for the extraction and analysis of hydrological information from Digital Elevation Models (DEM). TauDEM can be used from QGIS if you have it installed in your system and configured QGIS properly, so it can find all necessary files.

There are two versions of TauDEM tools: singlefile (TauDEM 5.0.6 or 5.1.2) and multifile (TauDEM 5.2.0). The difference between these versions in the supported inputs/outputs. Single files version accepts only single raster file and write single file as output. Multifile version accepts a directory with rasters and writes directory with rasters as output. Such directory should contain rasters that will be treated as a single DEM grid.

TauDEM Processing provider supports both single- and multifile versions of TauDEM and even allows to use them simultaneously.

주석

While TauDEM Processing provider supports TauDEM 5.0.6, 5.1.2 and 5.2.0 we recommend to use 5.1.2 and/or 5.2.0 as this versions have some new tools available, like Gage Watershed and TWI.

Installing TauDEM under Windows

Please visit the TauDEM homepage and download desired version of the precompiled binaries for your platform (32-bit or 64-bit), usually this is “Command Line Executables”. Also you need to download Microsoft HPC Pack 2012 MS-MPI. First install Microsoft HPC Pack 2012 MS-MPI by runing mpi_x64.Msi for 64-bit platforms and mpi_x86.Msi for 32-bit platforms.

주석

If you want to use TauDEM 5.0.6

Installing TauDEM under Linux

Unfortunately there are no packages for most Linux distributions, so you should compile TauDEM by yourself. As TauDEM uses MPI it is necessary to install first any MPI implementation e.g MPICH or OpenMPI. Use your favorite package manager to install MPICH or OpenMPI.

Download TauDEM 5.2.0 source code package from GitHub repository and extract archive contents. Open terminal and cd into src directory inside extracted folder. Create build directory and cd into it

mkdir build
cd build

Configure your build (change install prefix if necessary) and compile

CXX=mpicxx cmake -DCMAKE_INSTALL_PREFIX=/usr/local ..
make

When compilation finished install TauDEM tools by running

sudo make install

주석

Executable files will be installed into bin subdirectory inside prefix you specified at the configure stage. For example if you specified prefix /opt/taudem5.2 than binaries will be installed into /opt/taudem5.2/bin.

To use singlefile version — download source package here and perform above mentioned steps to compile and install it.

Old TauDEM 5.0.6 also available. But before compiling this version it is necessary to edit some source files.

Open the linearpart.h file, and after line

#include "mpi.h"

add a new line with

#include <stdint.h>

so you’ll get

#include "mpi.h"
#include <stdint.h>

Save the changes and close the file. Now open tiffIO.h, find line #include "stdint.h" and replace quotes ("") with <>, so you’ll get

#include <stdint.h>

Save the changes and close the file.

Now configure, compile and install TauDEM 5.0.6 using same commands as described above.

Configuring TauDEM provider

Once TauDEM is installed, start QGIS, open the Processing options dialog from Processing ‣ Options... and configure the TauDEM algorithm provider. In the Providers group find TauDEM (hydrologic analysis) block, and expand it. Here you will see all settings related to TauDEM.

First, ensure that algorithms are enabled, and activate provider if necessary.

Next step is to configure MPI. The MPICH/OpenMPI bin directory setting used to define location of the mpiexec program. In most Linux distributions you can safely leave this empty, as mpiexec available in your PATH.

The Number of MPI parallel processes to use is a second setting related to MPI. It defines number of processes that will be used to execute TauDEM commands. If you don’t know which value to use, it is better to leave this value unchanged.

Now we need to configure the path to the folder(s) where TauDEM command-line tools are installed. As we already mention TauDEM provider supports both single- and multifile TauDEM, so there are two settings for TauDEM folders:

  • TauDEM command line tools folder used to set location of the singlefile tools
  • TauDEM multifile command line tools folder used to set location of the multifile tools

If you have both TauDEM versions installed in different directories it is possible to specify both options.

The last step is to define which TauDEM version to use:

  • with Enable multifile TauDEM tools option checked you will use multifile TauDEM tools from directory, specified in the TauDEM multifile command line tools folder. Multifile tools have same name as singlefile with “(multifile)” suffix added
  • with Enable single TauDEM tools option checked you will use multifile TauDEM tools from directory, specified in the TauDEM command line tools folder.

It is possible to enable both tools simultaneously. In this case you will have two instances of each tool in toolbox and can use them in your analysis.

주석

Be careful with developing Processing models using TauDEM!

As single- and multifile versions have different inputs, model created with singlefile algorithms will not work if only multifile algorithms are available. If you plan to share your model please specify which TauDEM version should be used or, better, provide two versions of your model: for single- and multifile TauDEM.