.

OGC データクライアントとしての QGIS

The Open Geospatial Consortium (OGC) is an international organization with membership of more than 300 commercial, governmental, nonprofit and research organizations worldwide. Its members develop and implement standards for geospatial content and services, GIS data processing and exchange.

地理的な地物の基礎モデルの記述や多くの標準がOGCにより開発されGISを含む位置と地理情報テクノロジーの相互運用性ニーズの増大に対応しています. 詳しい情報は http://www.opengeospatial.org/ で参照できます.

Important OGC specifications supported by QGIS are:

OGC サービスは異なるGIS間の空間データ交換やデータ保存の要求の増大に対応して使われています. QGIS は上記の標準に対してクライアントとして動作できます, SFS もサポートします (PostgreSQL / PostGIS データプロバイダでサポートされます, PostGIS レイヤ 参照).

WMS/WMTS クライアント

WMS サポート概要

QGIS は現在WMS クライアントとして WMS 1.1, 1.1.1 と 1.3 サーバーの配信を利用できます. 特にDEMISのようなパブリックアクセスサーバについてはテストされています.

WMS サーバーはクライアント (例., QGIS) のリクエストで動作します,そのリクエストにはラスタマップの領域,レイヤのセット,描画スタイル,透過度が指定されます. WMS サーバーはローカルデータソースを参照してラスタ化地図を作りクライアントにラスタ形式で返します. QGIS では典型的な形式はJPEGまたはPNGです.

WMS is generically a REST (Representational State Transfer) service rather than a full-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 server on the market and they all have their own interpretation of the WMS standard.

WMSレイヤは簡単に追加できます.あなたがWMSサーバにアクセスするURLを知っていれば追加できます.サーバに対してあなたがアクセスできる接続ができてサーバがデータ転送方式としてHTTPを理解できれば大丈夫です.

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 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, 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.

In order to display the data at a variety of scales close to what the user might want, the WMTS tile sets are produced at several different scale levels and are made available for the GIS client to request them.

この図はタイルセットの概念を示しています:

Figure WMTS 1:

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

WMTS タイルセットコンセプト

QGIS は2種類のタイプのWMTS インターフェースをサポートしています,1つは Key-Value-Pairs (KVP) でもう1つは RESTful です. この2つのインターフェースは異なっていて QGIS では別々に指定する必要があります.

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

"?SERVICE=WMTS&REQUEST=GetCapabilities"

このタイプのアドレスの例は次のとおりです

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

For testing the topo2 layer in this WMTS works nicely. Adding this string indicates that a WMTS web service is to be used instead of a WMS service.

  1. The RESTful WMTS service takes a different form, 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 of this type of address for the case of an Austrian basemap is http://maps.wien.gv.at/basemap/1.0.0/WMTSCapabilities.xml.

ノート

You can still find some old services called WMS-C. These services are quite similar to WMTS (i.e., same purpose but working a little bit differently). You can manage them the same as you do 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.

WMTSを読んだときに, WMS-C についても考えるでしょう.

Selecting WMS/WMTS Servers

初めて WMS 機能を QGIS で利用する時,サーバの定義はありません .

ツールバーの mActionAddWmsLayer Add WMS layer ボタンをクリックするか Layer ‣ Add WMS Layer... を選択して下さい.

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 Layers tab, select the [New] button. Then enter the parameters to connect to your desired WMS server, as listed in table_OGC_1:

名前

接続の名前. この名前はサーバーコネクションドロップダウンボックスで使われます,ですから他のWMSサービスと区別できる名前にして下さい.

URL URL of the server providing the data. This must be a resolvable host name – the same format as you would use to open a telnet connection or ping a host.

ユーザ名

Username to access a secured WMS server. This parameter is optional.

パスワード

Password for a basic authenticated WMS server. This parameter is optional.

GetMap URI の無視

checkbox Ignore GetMap URI reported in capabilities. Use given URI from URL field above.

GetFeatureInfo URI の無視

checkbox Ignore GetFeatureInfo URI reported in capabilities. Use given URI from URL field above.

表 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 Settings ‣ Options and click on the Network & Proxy tab. There, you can add your proxy settings and enable them by setting checkbox Use proxy for web access. Make sure that you select the correct proxy type from the Proxy type selectstring drop-down menu.

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

ちなみに

WMS サーバー URL

Be sure, when entering the WMS server URL, that you have the base URL only. 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 lower left of the WMS dialog.

あなたのスクリーンは figure_OGR_1 のような表示になっていると思います, これはDM Solutions Group WMS サーバーのレスポンスを表示しています.

Figure OGR 1:

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

利用可能なレイヤを表示しているWMS サーバー追加ダイアログ nix

画像エンコーディング

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

ちなみに

画像エンコーディング

典型的な WMS サーバーはイメージのエンコーディングにJPEGかPNGを提案してくるでしょう. JPEG は損失のある圧縮形式ですis a lossy compression format, 一方 PNG は生のラスタデータを忠実に再現します.

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 five times the data transfer requirement compared with PNG.

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

オプション

The Options area of the dialog provides a text field where you can add a Layer name for the WMS layer. This name will appear in the legend after loading the layer.

Below the layer name, you can define Tile size if you want to set tile sizes (e.g., 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 Layer Order tab 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 の順序

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 Layer Order tab.

透過性

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

ちなみに

WMS Layer の透過度

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

空間参照系

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 dialog 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 Tilesets tab 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 by selecting Settings ‣ Panels (KDE and Windows) or View ‣ Panels (Gnome and MacOSX), then choosing Tile scale. This gives you the available scales from the tile server with a nice slider docked in.

地物特定ツールの利用

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 may be stored in the project for the layer.

GMLフォーマットサポート

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

表示プロパティ

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 gleaned by reading the WMS standards (see OPEN-GEOSPATIAL-CONSORTIUM in 文献とWeb参照), but here are a few handy definitions:

  • サーバプロパティ

    • WMS バージョン — サーバによってサポートされたWMSのバージョン.

    • Iイメージ形式 — 地図を描画するときにサーバが対応可能なMIME-タイプのリスト. QGIS はQt ライブラリのビルドで組み込まれた形式はサポートします image/png と``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.
  • ** レイヤプロパティ**

    • 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.

Show WMS legend graphic in table of contents and composer

The QGIS WMS data provider is able to display a legend graphic in the table of contents’ layer list and in the map composer. The WMS legend will be shown only if the WMS server has GetLegendGraphic capability and the layer has getCapability url specified, so you additionally have to select a styling for the layer.

If a legendGraphic is available, it is shown below the layer. It is little and you have to click on it to open it in real dimension (due to QgsLegendInterface architectural limitation). Clicking on the layer’s legend will open a frame with the legend at full resolution.

In the print composer, the legend will be integrated at it’s original (dowloaded) dimension. Resolution of the legend graphic can be set in the item properties under Legend -> WMS LegendGraphic to match your printing requirements

The legend will display contextual information based on your current scale. The WMS legend will be shown only if the WMS server has GetLegendGraphic capability and the layer has getCapability url specified, so you have to select a styling.

WMSクライアントの制限

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

WMSレイヤ設定の編集

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

認証が必要なWMS サーバ

Currently, publicly 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.

ちなみに

セキュアな OGC-レイヤへのアクセス

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

ちなみに

QGIS WMS Mapserver

Since Version 1.7.0, QGIS has its own implementation of a WMS 1.3.0 Mapserver. Read more about this in chapter OGC データサーバとしての QGIS.

WCS クライアント

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 (i.e., each server implements it in a 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 to 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 the server.

WFS および WFS-T クライアント

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 that there are no default servers defined, so we have to add our own.

WFS レイヤのロード

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 Add WFS Layer from a Server dialog appears.
  2. Click on [New].
  3. 名前として ‘DM Solutions’ と入力して下さい.

  4. Enter the URL (see above).
  5. Click [OK].
  6. Choose ‘DM Solutions’ from the Server Connections selectstring drop-down list.
  7. [Connect] をクリックして下さい.

  8. Wait for the list of layers to be populated.
  9. Select the Parks layer in the list.
  10. レイヤを地図に加えるために [Apply] をクリックして下さい.

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

Figure OGR 3:

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

WFS レイヤの追加 nix

You’ll notice the download progress is visualized in the lower left 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 time, 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 mailing lists.

ちなみに

WFS サービスの検索

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.