2. 시작하기¶
2.1. 데비안 기반 시스템에 설치하기¶
데비안 기반 (우분투 및 파생판 포함) 시스템 상에서 작동에 필요한 최소한의 환경 설정으로 설치하는 방법을 짧고 간단하게 설명할 것입니다. 하지만, 다른 많은 리눅스 배포판과 운영 체제도 QGIS 서버 패키지를 제공하고 있습니다.
최신 QGIS 서버를 설치하기 위해 데비안 기반 시스템에 공식 QGIS 저장소(repository)를 추가하기 위한 요구 사항 및 각 단계는 QGIS 설치관리자 페이지 를 참고하십시오.
참고
우분투에서는 운영자(admin) 권한이 필요한 명령어 앞에 sudo
를 추가하면 일반 사용자도 설치할 수 있습니다. 데비안에서는 sudo
를 추가할 필요없는 운영자(root
)로 작업하면 됩니다.
장기 지원 버전(Long Term Repo) 설치를 강력히 추천합니다.
선택한 저장소의 환경 설정을 완료하면, 다음 명령어로 간단히 설치할 수 있습니다:
apt install qgis-server --no-install-recommends --no-install-suggests
# if you want to install server Python plugins, also:
apt install python-qgis
To test the installation, run:
/usr/lib/cgi-bin/qgis_mapserv.fcgi
If you get the following output, the server is correctly installed
QFSFileEngine::open: No file name specified
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.
Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.
Content-Length: 206
Content-Type: text/xml; charset=utf-8
<ServiceExceptionReport version="1.3.0" xmlns="https://www.opengis.net/ogc">
<ServiceException code="Service configuration error">Service unknown or unsupported</ServiceException>
</ServiceExceptionReport>
예시 프로젝트를 추가해봅시다. 사용자 데이터를 사용해도 되고, 또는 예제 데이터 를 사용해도 됩니다.
mkdir /home/qgis/projects/
cd /home/qgis/projects/
wget https://github.com/qgis/QGIS-Training-Data/archive/v2.0.zip
unzip v2.0.zip
mv QGIS-Training-Data-2.0/exercise_data/qgis-server-tutorial-data/world.qgs .
mv QGIS-Training-Data-2.0/exercise_data/qgis-server-tutorial-data/naturalearth.sqlite .
Of course, you can use your favorite GIS software to open this file and take a look at the configuration and available layers.
To properly deploy QGIS server you need a HTTP server. Recommended choices are Apache or NGINX.
2.1.1. Apache HTTP Server¶
참고
다음 예시에서, localhost
를 사용자 서버의 명칭 또는 IP 주소로 대체해주십시오.
아파치와 mod_fcgid 를 설치하십시오.
apt install apache2 libapache2-mod-fcgid
You can run QGIS Server on your default website, or configure a virtualhost specifically for this, as follows.
In the /etc/apache2/sites-available
directory let’s create a file
called qgis.demo.conf
, with this content:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName qgis.demo
DocumentRoot /var/www/html
# Apache logs (different than QGIS Server log)
ErrorLog ${APACHE_LOG_DIR}/qgis.demo.error.log
CustomLog ${APACHE_LOG_DIR}/qgis.demo.access.log combined
# Longer timeout for WPS... default = 40
FcgidIOTimeout 120
FcgidInitialEnv LC_ALL "en_US.UTF-8"
FcgidInitialEnv PYTHONIOENCODING UTF-8
FcgidInitialEnv LANG "en_US.UTF-8"
# QGIS log (different from apache logs)
FcgidInitialEnv QGIS_SERVER_LOG_FILE /var/log/qgis/qgisserver.log
FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 0
FcgidInitialEnv QGIS_DEBUG 1
# default QGIS project
SetEnv QGIS_PROJECT_FILE /home/qgis/projects/world.qgs
# QGIS_AUTH_DB_DIR_PATH must lead to a directory writeable by the Server's FCGI process user
FcgidInitialEnv QGIS_AUTH_DB_DIR_PATH "/home/qgis/qgisserverdb/"
FcgidInitialEnv QGIS_AUTH_PASSWORD_FILE "/home/qgis/qgisserverdb/qgis-auth.db"
# Set pg access via pg_service file
SetEnv PGSERVICEFILE /home/qgis/.pg_service.conf
FcgidInitialEnv PGPASSFILE "/home/qgis/.pgpass"
# Tell QGIS Server instances to use a specific display number
FcgidInitialEnv DISPLAY ":99"
# if qgis-server is installed from packages in debian based distros this is usually /usr/lib/cgi-bin/
# run "locate qgis_mapserv.fcgi" if you don't know where qgis_mapserv.fcgi is
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
Order allow,deny
Allow from all
Require all granted
</Directory>
<IfModule mod_fcgid.c>
FcgidMaxRequestLen 26214400
FcgidConnectTimeout 60
</IfModule>
</VirtualHost>
Further readings:
You can do the above in a linux Desktop system by pasting and saving the above configuration after doing:
nano /etc/apache2/sites-available/qgis.demo.conf
참고
Some of the configuration options are explained in the Server environment variables section.
Let’s now create the directories that will store the QGIS Server logs and the authentication database:
mkdir -p /var/log/qgis/
chown www-data:www-data /var/log/qgis
mkdir -p /home/qgis/qgisserverdb
chown www-data:www-data /home/qgis/qgisserverdb
참고
www-data
is the Apache user on Debian based systems and we need Apache to have access to
those locations or files.
The chown www-data...
commands change the owner of the respective directories and files
to www-data
.
We can now enable the virtual host,
enable the fcgid
mod if it’s not already enabled:
a2enmod fcgid
a2ensite qgis.demo
이제 아파치를 재시작해서 새 환경 설정을 적용하십시오:
systemctl restart apache2
Now that Apache knows that he should answer requests to http://qgis.demo
we also need to setup the client system so that it knows who qgis.demo
is. We do that by adding 127.0.0.1 qgis.demo
in the
hosts file. We can do it
with sh -c "echo '127.0.0.1 qgis.demo' >> /etc/hosts"
.
Replace 127.0.0.1
with the IP of your server.
참고
Remember that both the myhost.conf
and /etc/hosts
files should
be configured for your setup to work.
You can also test the access to your QGIS Server from other clients on the
network (e.g. Windows or macOS machines) by going to their /etc/hosts
file and point the myhost
name to whatever IP the server machine has on the
network (not 127.0.0.1
as it is the local IP, only accessible from the
local machine). On *nix
machines the
hosts
file is located in /etc
, while on Windows it’s under
the C:\Windows\System32\drivers\etc
directory. Under Windows you
need to start your text editor with administrator privileges before opening
the hosts file.
이제 QGIS 서버가 http://localhost/qgisserver 주소에서 실행되고 있습니다. 이를 점검하려면 웹브라우저에 다음과 같은 간단한 예시를 입력하십시오:
http://localhost/qgisserver/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
2.1.2. NGINX HTTP Server¶
참고
다음 예시에서, localhost
를 사용자 서버의 명칭 또는 IP 주소로 대체해주십시오.
QGIS 서버를 NGINX 로 실행할 수도 있습니다. 아파치와는 달리, 엔진X(NGINX)는 FastCGI 프로세스를 자동으로 스폰(spawn)하지 않습니다. 다른 무언가로 FastCGI 프로세스를 시작시켜야 합니다.
엔진X를 설치하십시오:
apt install nginx
As a first option, you can use spawn-fcgi or fcgiwrap to start and manage the QGIS Server processes. Official Debian packages exist for both. When you have no X server running and you need, for example, printing, you can use xvfb.
또다른 옵션은 systemd 에 의존하는 것입니다. 〈systemd〉 란 오늘날 대부분의 리눅스 배포판이 사용하는 GNU/Linux 용 init 시스템입니다. 이 방법의 장점 가운데 하나는 다른 요소 또는 프로세스가 필요없다는 점입니다. 〈systemd〉 은 단순하면서도 신뢰성이 높고 생산 배치(production deployment)에 효율적이라고 여겨지고 있습니다.
2.1.2.1. NGINX Configuration¶
The include fastcgi_params; used in the previous configuration is important,
as it adds the parameters from /etc/nginx/fastcgi_params
:
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
Moreover, you can use some 환경 변수 to configure QGIS Server.
In the NGINX configuration file, /etc/nginx/nginx.conf
, you have to use
fastcgi_param
instruction to define these variables as shown below:
location /qgisserver {
gzip off;
include fastcgi_params;
fastcgi_param QGIS_DEBUG 1;
fastcgi_param QGIS_SERVER_LOG_FILE /var/log/qgis/qgisserver.log;
fastcgi_param QGIS_SERVER_LOG_LEVEL 0;
fastcgi_pass unix:/var/run/qgisserver.socket;
}
2.1.2.2. FastCGI wrappers¶
경고
fcgiwrap is easier to set up than spawn-fcgi, because it’s already wrapped in a Systemd service. But it also leads to a solution that is much slower than using spawn-fcgi. With fcgiwrap, a new QGIS Server process is created on each request, meaning that the QGIS Server initialization process, which includes reading and parsing the QGIS project file, is done on each request. With spawn-fcgi, the QGIS Server process remains alive between requests, resulting in much better performance. For that reason, spawn-fcgi is recommended for production use.
2.1.2.2.1. spawn-fcgi¶
spawn-fcgi 를 사용하고 싶다면, 첫 단계로 해당 패키지를 설치해야 합니다:
apt install spawn-fcgi
그 다음 사용자의 엔진X 서버 환경 설정에 다음 블록을 추가하십시오:
location /qgisserver {
gzip off;
include fastcgi_params;
fastcgi_pass unix:/var/run/qgisserver.socket;
}
그리고 엔진X를 재시작해서 새 환경 설정을 적용하십시오:
systemctl restart nginx
마지막으로, 〈spawn-fcgi〉 용 기본 서비스 파일이 없다는 점을 고려해서 사용자 터미널에서 QGIS 서버를 직접 시작해야 합니다:
spawn-fcgi -s /var/run/qgisserver.socket \
-U www-data -G www-data -n \
/usr/lib/cgi-bin/qgis_mapserv.fcgi
이제 QGIS 서버가 http://localhost/qgisserver 주소에서 실행되고 있습니다.
참고
〈spawn-fcgi〉 를 사용하는 경우, 서버 실행 전에 환경 변수를 직접 정의할 수도 있습니다. 예: export QGIS_SERVER_LOG_FILE=/var/log/qgis/qgisserver.log
Of course, you can add an init script to start QGIS Server at boot time or whenever you want.
For example with systemd, edit the file
/etc/systemd/system/qgis-server.service
with this content:
[Unit]
Description=QGIS server
After=network.target
[Service]
;; set env var as needed
;Environment="LANG=en_EN.UTF-8"
;Environment="QGIS_SERVER_PARALLEL_RENDERING=1"
;Environment="QGIS_SERVER_MAX_THREADS=12"
;Environment="QGIS_SERVER_LOG_LEVEL=0"
;Environment="DEBUG=1"
;Environment="QGIS_SERVER_LOG_FILE=/var/log/qgis-server.log"
;; or use a file:
;EnvironmentFile=/etc/qgis-server/env
ExecStart=spawn-fcgi -s /var/run/qgisserver.socket -U www-data -G www-data -n /usr/lib/cgi-bin/qgis_mapserv.fcgi
[Install]
WantedBy=multi-user.target
Then enable and start the service:
systemctl enable --now qgis-server
경고
With the above commands spawn-fcgi spawns only one QGIS Server process.
2.1.2.2.2. fcgiwrap¶
fcgiwrap 설정은 spawn-fcgi 보다 훨씬 쉽지만 훨씬 느리기도 합니다. 먼저 해당 패키지를 설치해야 합니다:
apt install fcgiwrap
그 다음 사용자의 엔진X 서버 환경 설정에 다음 블록을 추가하십시오:
1 2 3 4 5 6 | location /qgisserver {
gzip off;
include fastcgi_params;
fastcgi_pass unix:/var/run/fcgiwrap.socket;
fastcgi_param SCRIPT_FILENAME /usr/lib/cgi-bin/qgis_mapserv.fcgi;
}
|
마지막으로, 엔진X를 재시작해서 새 환경 설정을 적용하십시오:
systemctl restart nginx
systemctl restart fcgiwrap
이제 QGIS 서버가 http://localhost/qgisserver 주소에서 실행되고 있습니다.
2.1.2.3. systemd¶
QGIS Server needs a running X Server to be fully usable, in particular for printing. In the case you already have a running X Server, you can use systemd services.
This method, to deploy QGIS Server, relies on two Systemd units:
QGIS 서버 소켓 단위 는 엔진X가 QGIS 서버를 실행하고 서버와 통신하는 데 사용하는 파일 시스템 소켓을 정의하고 생성합니다. 소켓 단위 환경 설정에 Accept=false
를 추가해야 하는데, accept()
시스템 호출을 호출하면 서비스 단위가 생성한 프로세스로 위임한다는 의미입니다. 이 설정은 /etc/systemd/system/qgis-server@.socket
파일에 실제 템플릿으로 저장돼 있습니다:
[Unit]
Description=QGIS Server Listen Socket (instance %i)
[Socket]
Accept=false
ListenStream=/var/run/qgis-server-%i.sock
SocketUser=www-data
SocketGroup=www-data
SocketMode=0600
[Install]
WantedBy=sockets.target
이제 소켓을 활성화하고 실행합니다:
for i in 1 2 3 4; do systemctl enable --now [email protected]$i.socket; done
QGIS 서버 서비스 단위 는 QGIS 서버 프로세스를 정의하고 실행합니다. 중요한 점은 서비스 프로세스의 표준 입력이 소켓 단위가 정의한 소켓과 연결돼 있다는 점입니다. /etc/systemd/system/qgis-server@.service
파일에 있는 서비스 단위 환경 설정에 이 사실을 StandardInput=socket
을 사용해서 설정해주어야 합니다:
[Unit]
Description=QGIS Server Service (instance %i)
[Service]
User=www-data
Group=www-data
StandardOutput=null
StandardError=journal
StandardInput=socket
ExecStart=/usr/lib/cgi-bin/qgis_mapserv.fcgi
EnvironmentFile=/etc/qgis-server/env
[Install]
WantedBy=multi-user.target
참고
The QGIS Server environment variables
are defined in a separate file, /etc/qgis-server/env
.
It could look like this:
QGIS_PROJECT_FILE=/etc/qgis/myproject.qgs
QGIS_SERVER_LOG_STDERR=1
QGIS_SERVER_LOG_LEVEL=3
이제 소켓 서비스를 실행합니다:
for i in 1 2 3 4; do systemctl enable --now [email protected]$i.service; done
Finally, for the NGINX HTTP server, lets introduce the configuration for this setup:
upstream qgis-server_backend {
server unix:/var/run/qgis-server-1.sock;
server unix:/var/run/qgis-server-2.sock;
server unix:/var/run/qgis-server-3.sock;
server unix:/var/run/qgis-server-4.sock;
}
server {
…
location /qgis-server {
gzip off;
include fastcgi_params;
fastcgi_pass qgis-server_backend;
}
}
이제 엔진X를 재시작해서 새 환경 설정을 적용하십시오:
systemctl restart nginx
예제 를 공유해준 오슬란디아(Oslandia)에 감사드립니다.
2.1.3. Xvfb¶
QGIS 서버를 완전히 활용하려면, 그 중에서도 인쇄 작업을 하려면 X 서버를 실행해야 합니다. 보통 서버에 X 서버 설치를 권장하지 않기 때문에, 가상 X 환경을 보유하기 위해 Xvfb
를 사용해야 할 수도 있습니다.
If you’re running the Server in graphic/X11 environment then there is no need to install xvfb. More info at https://www.itopen.it/qgis-server-setup-notes/.
패키지를 설치하려면:
apt install xvfb
Create the service file, /etc/systemd/system/xvfb.service
, with this content:
[Unit]
Description=X Virtual Frame Buffer Service
After=network.target
[Service]
ExecStart=/usr/bin/Xvfb :99 -screen 0 1024x768x24 -ac +extension GLX +render -noreset
[Install]
WantedBy=multi-user.target
xvfb.service
를 활성화하고 실행한 다음 상태를 점검합니다:
systemctl enable --now xvfb.service
systemctl status xvfb.service
그 다음 사용자의 HTTP 서버에 따라 DISPLAY 파라미터를 사용해야 하거나 또는 xvfb-run 을 직접 실행해야 합니다.
2.1.3.1. With Apache¶
Then you can configure the DISPLAY parameter.
With Apache you just add to your FastCGI configuration (see above):
FcgidInitialEnv DISPLAY ":99"
이제 아파치를 재시작해서 새 환경 설정을 적용하십시오:
systemctl restart apache2
2.1.3.2. With NGINX¶
Then you can directly use xvfb-run or configure the DISPLAY parameter.
With spawn-fcgi using
xvfb-run
:xvfb-run /usr/bin/spawn-fcgi -f /usr/lib/cgi-bin/qgis_mapserv.fcgi \ -s /tmp/qgisserver.socket \ -G www-data -U www-data -n
With the DISPLAY environment variable in the HTTP server configuration.
fastcgi_param DISPLAY ":99";
2.2. 윈도우에 설치하기¶
윈도우 시스템에도 QGIS 서버를 설치할 수 있습니다. OSGeo4W 네트워크 설치관리자 64bit 버전(https://qgis.org/en/site/forusers/download.html)에 QGIS 서버 패키지가 있긴 하지만, 아파치 (또는 다른 웹서버) 패키지는 없기 때문에, 다른 방법으로 웹서버를 설치해야만 합니다.
다음과 같은 간단한 과정을 거치면 됩니다:
윈도우용 XAMPP 설치 관리자 를 다운로드해서 아파치를 설치하십시오.

OSGeo4W 설치 관리자를 다운로드하고, 《고급 설치(Advanced Install)》 옵션을 따라 QGIS 데스크톱과 QGIS 서버 패키지를 모두 설치하십시오.

텍스트 편집기에서
httpd.conf
(기본 설치 경로를 사용했다면C:\xampp\apache\httpd.conf
에 있습니다) 파일을 열어 다음과 같이 수정하십시오:
다음 내용을:
ScriptAlias /cgi-bin/ "C:/xampp/cgi-bin/"
다음으로:
ScriptAlias /cgi-bin/ "c:/OSGeo4W64/apps/qgis/bin/"
다음 내용을:
<Directory "C:/xampp/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
다음으로:
<Directory "c:/OSGeo4W64/apps/qgis/bin">
SetHandler cgi-script
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
Require all granted
</Directory>
다음 내용을:
AddHandler cgi-script .cgi .pl .asp
다음으로:
AddHandler cgi-script .cgi .pl .asp .exe
그리고 httpd.conf
파일 마지막에 다음 내용을 추가하십시오:
SetEnv GDAL_DATA "C:\OSGeo4W64\share\gdal"
SetEnv QGIS_AUTH_DB_DIR_PATH "C:\OSGeo4W64\apps\qgis\resources"
SetEnv PYTHONHOME "C:\OSGeo4W64\apps\Python37"
SetEnv PATH "C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis\bin;C:\OSGeo4W64\apps\Qt5\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem"
SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis"
SetEnv QT_PLUGIN_PATH "C:\OSGeo4W64\apps\qgis\qtplugins;C:\OSGeo4W64\apps\Qt5\plugins"
XAMPP 컨트롤 패널에서 아파치 웹 서버를 재시작한 다음 웹 브라우저 창을 열어 QGIS 서버에 GetCapabilities
요청을 점검하십시오.
http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
2.3. 프로젝트를 서비스하기¶
이제 QGIS 서버를 설치하고 실행했으니, 사용만 하면 됩니다.
당연히, 작업할 QGIS 프로젝트가 필요합니다. 물론 연락처 정보를 정의하고 좌표계에 몇몇 제약 조건을 확실히 하거나 일부 레이어를 제외하는 등 사용자 프로젝트 전체를 사용자 지정할 수 있습니다. 이 작업에 대해 사용자가 알아야 할 모든 것은 다음 사용자 프로젝트 환경 설정하기 에서 설명하고 있습니다.
그러나 지금 단계에서는 앞에서 설명한 대로 사전에 다운로드한, 환경 설정을 완료한 /home/qgis/projects/world.qgs
파일을 통해 간단한 프로젝트를 이용하겠습니다.
이 프로젝트 파일을 열고 레이어를 살펴보면, 현재 사용 가능한 레이어가 4개 있습니다:
〈airports〉
〈places〉
〈countries〉
〈countries_shapeburst〉
서버에 요청하는 방법에 대해 지금 전부 이해할 필요는 없습니다. 그러나 QGIS 서버에서 이 레이어들 가운데 몇 개를 받아올 수도 있습니다. 사용자의 웹 브라우저에 다음과 같이 입력하면 〈countries〉 레이어를 받아올 수 있습니다.
http://localhost/qgisserver?
MAP=/home/qgis/projects/world.qgs&
LAYERS=countries&
SERVICE=WMS&
REQUEST=GetMap&
CRS=EPSG:4326&
WIDTH=400&
HEIGHT=200
웹 브라우저에 다음 이미지가 표시된다면, QGIS 서버가 바르게 실행되고 있다는 의미입니다:

그림 2.1 기본 GetMap 요청에 대한 서버의 응답¶
Note that you may define QGIS_PROJECT_FILE environment variable to use a project by default instead of giving a MAP parameter (see 환경 변수).
예를 들어 〈spawn-fcgi〉 의 경우:
export QGIS_PROJECT_FILE=/home/qgis/projects/world.qgs
spawn-fcgi -f /usr/lib/bin/cgi-bin/qgis_mapserv.fcgi \
-s /var/run/qgisserver.socket \
-U www-data -G www-data -n
2.4. 사용자 프로젝트 환경 설정하기¶
WMS, WFS 또는 WCS를 서비스하는 새 QGIS 서버를 생성하려면, 몇몇 데이터를 보유한 QGIS 프로젝트 파일을 생성하거나 사용자의 현재 프로젝트 가운데 하나를 사용해야 합니다. QGIS 에서 – 아직 정의하지 않은 경우 – 레이어의 색상 및 스타일과 프로젝트 좌표계를 정의하십시오.

그림 2.2 WMS/WFS/WCS를 서비스하는 QGIS 서버 프로젝트 정의하기¶
그 다음, QGIS Server menu of the 대화창의 OWS Service 탭에 있는 Service Capabilities 부분 밑에 있는 여러 란에 OWS 관련 정보를 입력하십시오. 이 정보는 WMS, WFS 또는 WCS 의 GetCapabilities 응답에 나타날 것입니다. Service capabilities 옵션을 활성화하지 않은 경우, QGIS 서버는
cgi-bin
폴더에 있는 wms_metadata.xml
파일 안에 있는 정보를 사용할 것입니다.
2.4.1. WMS 성능¶
WMS capabilities 부분에서, Advertised extent 밑에 있는 여러 란에 최소 및 최대 X/Y 값을 입력해서 WMS 의 GetCapabilities 응답에 선언된 범위를 정의할 수 있습니다. Use Current Canvas Extent 버튼을 클릭하면 이 값들을 QGIS 맵 캔버스에 현재 표시된 범위로 설정합니다. CRS restrictions 옵션을 활성화하면, QGIS 서버가 맵을 렌더링하는 데 어떤 좌표계를 사용할지를 제약할 수 있습니다. 제안된 좌표계를 제약하는 편이 좋습니다. WMS 의 GetCapabilities 응답의 용량을 줄여주기 때문입니다. 해당 옵션 아래 있는
아이콘을 클릭해서 좌표계 선택기에서 좌표계를 선택할 수 있고, 또는 Used 버튼을 클릭해서 목록에 QGIS 프로젝트에서 사용된 적이 있는 좌표계들을 추가할 수도 있습니다.
If you have print layouts defined in your project, they will be listed in the
GetProjectSettings
response, and they can be used by the GetPrint request to
create prints, using one of the print layouts as a template.
This is a QGIS-specific extension to the WMS 1.3.0 specification.
If you want to exclude any print layout from being published by the WMS,
check Exclude layouts and click the
button below.
Then, select a print layout from the Select print layout dialog
in order to add it to the excluded layouts list.
WMS가 게시하는 레이어 가운데 어떤 레이어 또는 레이어 그룹을 제외하고 싶다면, Exclude Layers 옵션을 활성화한 다음 그 아래 있는
아이콘을 클릭하십시오. 그러면 Select restricted layers and groups 대화창이 열리는데, 이 대화창에서 게시하고 싶지 않은 레이어 및 레이어 그룹을 선택할 수 있습니다. 여러 항목을 한꺼번에 선택하고 싶다면 Shift 또는 Ctrl 키를 함께 사용하십시오. 필요하지 않은 레이어를 게시되는 레이어에서 제외시키는 편이 좋습니다. WMS GetCapabilities 응답의 용량을 줄여 클라이언트 쪽의 불러오기 시간을 단축시킬 수 있기 때문입니다.
If you check Use layer ids as name, layer ids will be
used to reference layers in the
GetCapabilities
response or GetMap LAYERS
parameter. If not, layer name or short name if defined (see QGIS 서버 속성)
is used.
You can receive requested GetFeatureInfo as plain text, XML and GML. The default is XML.
원하는 경우 Add geometry to feature response 옵션을 활성화할 수 있습니다. 이 옵션은 GetFeatureInfo 응답에 각 피처의 경계 상자를 포함시킬 것입니다. WITH_GEOMETRY 파라미터도 참조하세요.
원호(circular arc) 도형을 표시하지 못 하는 웹 클라이언트가 많이 있기 때문에, GetFeatureInfo 응답으로 클라이언트에 도형을 전송하기 전에 도형을 선분화시키는 옵션이 있습니다. 이 옵션으로 이런 클라이언트라도 피처의 도형을 (예를 들어 피처를 강조하기 위해) 표시하게 할 수 있습니다. 이 옵션을 활성화하려면 Segmentize feature info geometry 를 체크해야 합니다.
GetFeatureInfo geometry precision 옵션을 사용해서 GetFeatureInfo 도형의 정밀도도 설정할 수 있습니다. 완전한 정밀도가 필요하지 않은 경우, 이 옵션으로 대역폭을 절약할 수 있습니다.
QGIS 서버가 WMS GetCapabilities 응답 안에 특정한 요청 URL을 선언하기를 바란다면, Advertised URL 란에 그에 해당하는 URL을 입력하십시오.
또한 Maximums for GetMap request 밑에 있는 란에 각각 최대 너비 및 높이를 입력해서 GetMap 요청이 반환하는 맵의 최대 크기를 제한할 수도 있습니다.
You can change the Quality for JPEG images factor. The quality factor must be in the range 0 to 100. Specify 0 for maximum compression, 100 for no compression.
You can change the limit for atlas features to be printed in one request by setting the Maximum features for Atlas print requests field.
When QGIS Server is used in tiled mode (see TILED parameter), you can set the Tile buffer in pixels. The recommended value is the size of the largest symbol or line width in your QGIS project.
사용자 레이어 가운데 하나가 맵 도움말 표시 를 이용하고 있는 경우 (예: 표현식을 사용해서 텍스트를 표시하는 경우) GetFeatureInfo 출력물 안에 이 정보가 들어 있을 것입니다. 레이어가 값 맵(개념 매핑)을 이용하고 있다면, 이 정보도 GetFeatureInfo 출력물 안에 들어 있을 것입니다.
2.4.2. WFS 능력¶
WFS capabilities 부분에서 사용자가 WFS로 게시하려는 레이어를 선택할 수 있고, 해당 레이어를 업데이트, 삽입 및 삭제할 수 있는지 설정할 수 있습니다. WFS capabilities 부분의 Advertised URL 란에 URL을 입력한다면, QGIS 서버가 WFS GetCapabilities 응답에 이 특정 URL을 선언할 것입니다.
2.4.3. WCS 능력¶
WCS capabilities 부분에서 사용자가 WCS로 게시하려는 레이어를 선택할 수 있습니다. WCS capabilities 부분의 Advertised URL 란에 URL을 입력한다면, QGIS 서버가 WCS GetCapabilities 응답에 이 특정 URL을 선언할 것입니다.
2.4.4. 사용자 OWS를 미세 조정하기¶
벡터 레이어의 경우, Fields 메뉴에서 각 속성을 게시할 것인지 여부를 정의할 수 있습니다. 기본적으로, 사용자의 WMS 및 WFS는 모든 속성을 게시합니다. 특정 속성을 게시하고 싶지 않은 경우, WMS 또는 WFS 열에서 해당하는 체크박스를 체크 해제하십시오.
대화창의프로젝트 파일에 텍스트 주석 또는 SVG 주석을 추가해서 사용자의 WMS가 생성한 맵 위에 워터마크를 중첩시킬 수 있습니다. 주석 생성에 대한 지침은 주석 도구 를 참조하세요. WMS 출력물 위에 주석을 워터마크로 표시하려면, Annotation text 대화창의 Fixed map position 옵션을 비활성화해야 합니다. 주석 도구 가운데 하나를 선택한 상태에서 주석을 더블클릭하면 이 옵션에 접근할 수 있습니다. SVG 주석의 경우, 대화창의 General 메뉴에서 프로젝트가 절대 경로를 저장하도록 설정하거나 또는 SVG 이미지의 경로를 직접 수정해서 유효한 상대 경로를 나타내도록 해야 합니다.
2.5. Integration with third parties¶
QGIS Server provides standard OGC web services like WMS, WFS, etc. thus it can be used by a wide variety of end user tools.
2.5.1. Integration with QGIS Desktop¶
QGIS Desktop is the map designer where QGIS Server is the map server. The maps or QGIS projects will be served by the QGIS Server to provide OGC standards. These QGIS projects can either be files or entries in a database (by using
in QGIS Desktop).Furthermore, dedicated update workflow must be established to refresh a project used by a QGIS Server (ie. copy project files into server location and restart QGIS Server). For now, automated processes (as server reloading over message queue service) are not implemented yet.
2.5.2. Integration with MapProxy¶
MapProxy is a tile cache server and as it can read and serve any WMS/WMTS map server, it can be directly connected to QGIS server web services and improve end user experience.
2.5.3. Integration with QWC2¶
QWC2 is a responsive web application dedicated to QGIS Server. It helps you to build a highly customized map viewer with layer selection, feature info, etc.. Also many plugins are available like authentication or print service, the full list is available is this repository.