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

QGIS as OGC Data Client

Open Geospatial Consortium (OGC)는 전 세계 300여개 이상의 기업, 정부기관, 비영리 및 연구 기관들이 참여하고 있는 국제 기구입니다. OGC의 구성원은 지리공간 컨텐츠와 서비스, GIS 데이터 처리 및 교환을 위한 표준을 개발하고 구현하고 있습니다.

현재까지 지리적인 객체에 대한 기본적인 데이터 모델을 포함하여, GIS를 비롯한 위치 및 지리공간 기술에 대한 상호운영성을 만족시키기 위한 많은 사양이 개발되었습니다. 더 자세한 정보는 http://www.opengeospatial.org/ 사이트를 방문하시기 바랍니다.

Important OGC specifications supported by QGIS are:

OGC services are increasingly being used to exchange geospatial data between different GIS implementations and data stores. QGIS can deal with the above specifications as a client, being SFS (through support of the PostgreSQL / PostGIS data provider, see Section PostGIS Layers).

WMS/WMTS 클라이언트

WMS 지원 개요

QGIS currently can act as a WMS client that understands WMS 1.1, 1.1.1 and 1.3 servers. It has particularly been tested against publicly accessible servers such as DEMIS.

WMS servers act upon requests by the client (e.g. QGIS) for a raster map with a given extent, set of layers, symbolization style, and transparency. The WMS server then consults its local data sources, rasterizes the map, and sends it back to the client in a raster format. For QGIS this would typically be JPEG or PNG.

WMS is generically a REST (Representational State Transfer) service rather than a fully-blown Web Service. As such, you can actually take the URLs generated by QGIS and use them in a web browser to retrieve the same images that QGIS uses internally. This can be useful for troubleshooting, as there are several brands of WMS servers in the market and they all have their own interpretation of the WMS standard.

서버에 접근할 수 있는 URL을 알고 있고, 그 서버에 대해 접근이 가능하며, 서버가 데이터 전송 메커니즘으로 HTTP를 지원하면, WMS 레이어는 매우 간단하게 추가할 수 있습니다.

WMTS 지원 개요

QGIS can also act as a WMTS client. WMTS is an OGC standard for distributing tile sets of geospatial data. This is a faster and a more efficient way of distributing data than WMS because with WMTS the tile sets are pre-generated and the client only requests the transmission of the tiles and not their production. A WMS request typically involves both the generation and transmission of the data. A well known example of a non-OGC standard for viewing tiled geospatial data is Google Maps.

사용자가 원하는 수준과 가깝게 다양한 축척의 데이터를 표시하기 위해, WMTS 타일 셋은 여러 축척의 레벨로 생성되고 GIS 클라이언트가 타일 셋을 요청하여 활용됩니다.

이 다이어그램은 타일 셋의 개념을 보여줍니다:

Figure WMTS 1:

../../../_images/concept_wmts.png

WMTS 타일 셋의 개념

The two types of WMTS interfaces that QGIS supports are via Key-Value-Pairs (KVP) and RESTful. These two interfaces are different and you need to specify them to QGIS differently.

1) In order to access a WMTS KVP service, a QGIS user opens the WMS/WMTS interface and adds the following string to the URL of the WMTS tile service:

"?SERVICE=WMTS&REQUEST=GetCapabilities"

An example of this type of address is

http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?\
  service=WMTS&request=GetCapabilities

이 WMTS에서 topo2 레이어 테스트는 잘 작동합니다. 이 문자열을 추가하는 것은 WMTS 웹 서비스가 WMS 서비스 대신 사용될 수 있음을 나타냅니다

2) The RESTful WMTS service takes a different form, it is a straightforward URL, the format recommended by the OGC is:

{WMTSBaseURL}/1.0.0/WMTSCapabilities.xml

This format helps you to recognize that it is a RESTful address. A RESTful WMTS is accessed in QGIS by simply adding its address in the WMS setup in the URL field of the form. An example for an Austrian basemap of this type of address is http://maps.wien.gv.at/basemap/1.0.0/WMTSCapabilities.xml

주석

You can find some old service call WMS-C. Thoses services are quiet similar to WMTS service same purpose but working a little bit differently). You can manage them as the same way you do it for WMTS services. Just add ?tiled=true at the end of the url. See http://wiki.osgeo.org/wiki/Tile_Map_Service_Specification for more information about this specification.

When you read WMTS you can often think WMS-C also.

Selecting WMS/WMTS Servers

WMS 클라이언트를 처음 사용하는 경우, 기본으로 정의된 서버는 없습니다.

도구모음 내에서 mActionAddWmsLayer WMS 레이어 추가하기 버튼을 클릭하거나, 또는 레이어‣ WMS 레이어 추가하기... 메뉴를 실행하면 서버를 추가할 수 있습니다.

The dialog Add Layer(s) from a Server for adding layers from the WMS server appears. You can add some servers to play with by clicking the [Add default servers] button. This will add two WMS demo servers for you to use, the WMS servers of the DM Solutions Group and Lizardtech. To define a new WMS server in the tab Layers, select the [New] button. Then enter the parameters to connect to your desired WMS server, as listed in table_OGC_1:

이름

이 연결의 이름. Server Connections 드롭다운 박스에 나타나는 이름으로 다른 WMS 서버와 구분할 수 있습니다.

URL

데이터를 제공하는 서버의 URL. 연결이 가능한 호스트 명이어야 하며 텔넷 연결이나 Ping 사용할 때와 같은 형식이어야 합니다.

사용자이름

보안 처리된 WMS 서버에서 사용할 사용자명. 이 파라미터는 옵션입니다.

비밀번호

WMS 서버 기본 인증에 사용될 암호. 이 파라미터는 옵션입니다.

GetMap URI 무시

checkbox GetCapabilites에서 보고된 GetMap URI 를 무시하기, 위 URL 필드에서 주어진 URI를 사용합니다.

GetFeatureInfo URI 무시

checkbox GetCapabilites에서 보고된 GetFeatureInfo URI를 무시하기 , 위 URL 필드에서 주어진 URI를 사용합니다.

표 OGC 1: WMS 연결 파라미터

If you need to set up a proxy-server to be able to receive WMS-services from the internet, you can add your proxy-server in the options. Choose menu Settings ‣ Options and click on the tab Network & Proxy. There you can add your proxy-settings and enable them by setting the checkbox Use proxy for web access. Make sure that you select the correct proxy type from the Proxy type selectstring dropdown menu.

Once the new WMS Server connection has been created, it will be preserved for future QGIS sessions.

참고

On WMS Server URLs

Be sure, when entering in the WMS server URL, that you have the base URL. For example, you shouldn’t have fragments such as request=GetCapabilities or version=1.0.0 in your URL.

WMS/WMTS 레이어 불러오기

Once you have successfully filled in your parameters you can use the [Connect] button to retrieve the capabilities of the selected server. This includes the Image encoding, Layers, Layer Styles and Projections. Since this is a network operation, the speed of the response depends on the quality of your network connection to the WMS server. While downloading data from the WMS server, the download progress is visualized in the left bottom of the WMS dialog.

Your screen should now look a bit like figure_OGR_1, which shows the response provided by the DM Solutions Group WMS server.

Figure OGR 1:

../../../_images/connection_wms.png

Dialog for adding a WMS server, showing its available layers nix

이미지 인코딩

The Image encoding section now lists the formats that are supported by both the client and server. Choose one depending on your image accuracy requirements.

참고

이미지 인코딩

You will typically find that a WMS server offers you the choice of JPEG or PNG image encoding. JPEG is a lossy compression format, whereas PNG faithfully reproduces the raw raster data.

Use JPEG if you expect the WMS data to be photographic in nature and/or you don’t mind some loss in picture quality. This trade-off typically reduces by 5 times the data transfer requirement compared to PNG.

Use PNG if you want precise representations of the original data, and you don’t mind the increased data transfer requirements.

옵션

The Options field provides a text field where you can add a Layer name for the WMS-layer. This name will be presented in the legend after loading the layer.

Below the layer name you can define Tile size, if you want to set tile sizes (eg. 256x256) to split up the WMS request into multiple requests.

The Feature limit for GetFeatureInfo defines what features from the server to query.

If you select a WMS from the list a field with the default projection, provided by the mapserver, appears. If the [Change...] button is active, you can click on it and change the default projection of the WMS to another CRS, provided by the WMS server.

레이어 순서

The tab Layer Order lists the selected layers available from the current connected WMS server. You may notice that some layers are expandable, this means that the layer can be displayed in a choice of image styles.

You can select several layers at once, but only one image style per layer. When several layers are selected, they will be combined at the WMS Server and transmitted to QGIS in one go.

참고

WMS Layer Ordering

WMS layers rendered by a server are overlaid in the order listed in the Layers section, from top to bottom of the list. If you want to change the overlay order, you can use the tab Layer Order.

Transparency

In this version of QGIS, the Global transparency setting from the Layer Properties is hard-coded to be always on, where available.

참고

WMS Layer Transparency

The availability of WMS image transparency depends on the image encoding used: PNG and GIF support transparency, whilst JPEG leaves it unsupported.

Coordinate Reference System

A Coordinate Reference System (CRS) is the OGC terminology for a QGIS Projection.

Each WMS Layer can be presented in multiple CRSs, depending on the capability of the WMS server.

To choose a CRS, select [Change...] and a dialog similar to Figure Projection 3 in 투영법 다루기 will appear. The main difference with the WMS version of the screen is that only those CRSs supported by the WMS Server will be shown.

타일셋

When using WMTS (Cached WMS) Services like

http://opencache.statkart.no/gatekeeper/gk/gk.open_wmts?\
  service=WMTS&request=GetCapabilities

you are able to browse through the tab Tilesets given by the server. Additional information like tile size, formats and supported CRS are listed in this table. In combination with this feature you can use the tile scale slider from the Settings ‣ Panels (KDE and Windows) or View ‣ Panels (Gnome and MacOSX) then choose Tile scale, which gives you the available scales from the tileserver with nice slider docked in.

Using the Identify Tool

Once you have added a WMS server, and if any layer from a WMS server is queryable, you can then use the mActionIdentify Identify tool to select a pixel on the map canvas. A query is made to the WMS server for each selection made. The results of the query are returned in plain text. The formatting of this text is dependent on the particular WMS server used.

포맷 선택

If multiple output formats are supported by the server, a combo box with supported formats is automatically added to the identify results dialog and the selected format will is stored in project for the layer.

GML 포맷 지원

The mActionIdentify Identify tool supports WMS server response (GetFeatureInfo) in GML (it is called Feature in QGIS GUI in this context) format. If “Feature” format is supported by the server and selected, results of the Identify tool are vector features like from regular vector layer. When a single feature is selected in the tree, it is highlighted in the map and it can be copied to clipboard and pasted to another vector layer. See example setup of UMN Mapserver below to support GetFeatureInfo GML format.

# in layer METADATA add which fields should be included and define geometry (example):

"gml_include_items"   "all"
"ows_geometries"      "mygeom"
"ows_mygeom_type"     "polygon"

# Then there are two possibilities/formats available, see a) and b):

# a) basic (output is generated by Mapserver and does not contain XSD)
# in WEB METADATA define formats (example):
"wms_getfeatureinfo_formatlist" "application/vnd.ogc.gml,text/html"

# b) using OGR (output is generated by OGR, it is send as multipart and contains XSD)
# in MAP define OUTPUTFORMAT (example):
OUTPUTFORMAT
    NAME "OGRGML"
    MIMETYPE "ogr/gml"
    DRIVER "OGR/GML"
    FORMATOPTION "FORM=multipart"
END

# in WEB METADATA define formats (example):
"wms_getfeatureinfo_formatlist" "OGRGML,text/html"

Viewing Properties

Once you have added a WMS server, you can view its properties by right-clicking on it in the legend, and selecting Properties.

메타데이터 탭

The tab Metadata displays a wealth of information about the WMS server, generally collected from the Capabilities statement returned from that server. Many definitions can be cleaned by reading the WMS standards (see OPEN-GEOSPATIAL-CONSORTIUM Literature and Web References), but here are a few handy definitions:

  • 서버 속성

    • WMS 버전 — 서버에서 지원하는 WMS 버전.

    • Image Formats — The list of MIME-types the server can respond with when drawing the map. QGIS supports whatever formats the underlying Qt libraries were built with, which is typically at least image/png and image/jpeg.
    • Identity Formats — The list of MIME-types the server can respond with when you use the Identify tool. Currently QGIS supports the text-plain type.
  • Layer Properties
    • Selected — Whether or not this layer was selected when its server was added to this project.
    • Visible — Whether or not this layer is selected as visible in the legend. (Not yet used in this version of QGIS.)
    • Can Identify — Whether or not this layer will return any results when the Identify tool is used on it.
    • Can be Transparent — Whether or not this layer can be rendered with transparency. This version of QGIS will always use transparency if this is Yes and the image encoding supports transparency
    • Can Zoom In — Whether or not this layer can be zoomed in by the server. This version of QGIS assumes all WMS layers have this set to Yes. Deficient layers may be rendered strangely.
    • Cascade Count — WMS servers can act as a proxy to other WMS servers to get the raster data for a layer. This entry shows how many times the request for this layer is forwarded to peer WMS servers for a result.
    • Fixed Width, Fixed Height — Whether or not this layer has fixed source pixel dimensions. This version of QGIS assumes all WMS layers have this set to nothing. Deficient layers may be rendered strangely.
    • WGS 84 Bounding Box — The bounding box of the layer, in WGS 84 coordinates. Some WMS servers do not set this correctly (e.g. UTM coordinates are used instead). If this is the case, then the initial view of this layer may be rendered with a very ‘zoomed-out’ appearance by QGIS. The WMS webmaster should be informed of this error, which they may know as the WMS XML elements LatLonBoundingBox, EX_GeographicBoundingBox or the CRS:84 BoundingBox.
    • Available in CRS — The projections that this layer can be rendered in by the WMS server. These are listed in the WMS-native format.
    • Available in style — The image styles that this layer can be rendered in by the WMS server.

WMS Client Limitations

Not all possible WMS Client functionality had been included in this version of QGIS. Some of the more notable exceptions follow.

Editing WMS Layer Settings

Once you’ve completed the mActionAddWmsLayer Add WMS layer procedure, there is no ability to change the settings. A workaround is to delete the layer completely and start again.

WMS Servers Requiring Authentication

Currently public accessible and secured WMS-services are supported. The secured WMS-servers can be accessed by public authentication. You can add the (optional) credentials when you add a WMS-server. See section Selecting WMS/WMTS Servers for details.

참고

Accessing secured OGC-layers

If you need to access secured layers with other secured methods than basic authentication, you could use InteProxy as a transparent proxy, which does support several authentication methods. More information can be found at the InteProxy manual found on the website http://inteproxy.wald.intevation.org.

참고

|qg| WMS Mapserver

From Version 1.7.0 QGIS has its own implementation of a WMS 1.3.0 Mapserver. Read more about this at chapter QGIS as OGC Data Server.

WCS Client

wcs A Web Coverage Service (WCS) provides access to raster data in forms that are useful for client-side rendering, as input into scientific models, and for other clients. The WCS may be compared to the WFS and the WMS. As WMS and WFS service instances, a WCS allows clients to choose portions of a server’s information holdings based on spatial constraints and other query criteria.

QGIS has a native WCS provider and supports both version 1.0 and 1.1 (which are significantly different), but currently it prefers 1.0, because 1.1 has many issues, each server implements it in different way with various particularities.

The native WCS provider handles all network requests and uses all standard QGIS network settings (especially proxy). It is also possible select cache mode (always cache, prefer cache, prefer network, always network) and the provider also supports selection of time position if temporal domain is offered by server.

WFS and WFS-T Client

In QGIS, a WFS layer behaves pretty much like any other vector layer. You can identify and select features and view the attribute table. Since QGIS 1.6 editing (WFS-T) is also supported.

In general adding a WFS layer is very similar to the procedure used with WMS. The difference is there are no default servers defined, so we have to add our own.

Loading a WFS Layer

As an example we use the DM Solutions WFS server and display a layer. The URL is: http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap

  1. Click on the wfs Add WFS Layer tool on the Layers toolbar, the dialog Add WFS Layer from a Server appears
  2. Click on [New]
  3. Enter ‘DM Solutions’ as name
  4. Enter the URL (see above)
  5. Click [OK]
  6. Choose ‘DM Solutions’ from the dropdown list Server Connections selectstring
  7. Click [Connect]
  8. Wait for the list of layers to be populated
  9. Select the Parks layer in the list
  10. Click [Apply] to add the layer to the map

Note that proxy settings you have set in your preferences are also recognized.

Figure OGR 3:

../../../_images/connection_wfs.png

Adding a WFS layer nix

You’ll notice the download progress is visualized in the left bottom of the QGIS main window. Once the layer is loaded, you can identify and select a province or two and view the attribute table.

Only WFS 1.0.0 is supported. At this point there have not been many tests against WFS versions implemented in other WFS-servers. If you encounter problems with any other WFS-server, please do not hesitate to contact the development team. Please refer to Section 도움과 지원 for further information about the mailinglists.

참고

Finding WFS Servers

You can find additional WFS servers by using Google or your favorite search engine. There are a number of lists with public URLs, some of them maintained and some not.