QGISでは様々は形式のベクタファイルを読み込むことができますが、その中でも最もなじみが薄いファイルの一つだと思われる「S-57 Base File」について、少しお話します。
今回の主役はこれ
これはなに?
これは、「航海用電子海図」(ENC: Electric Navigable Chart)という呼ばれるものです。「S-57」というのは、ENCのデータフォーマットを定めている仕様の名称です(→S-57の仕様書はこちら)。
ENCは、大型の客船や貨物船に搭載されている「ECDIS(電子海図表示システム)」と呼ばれる専用の機器の上で海図を表示するのに使われます。
QGISで見るには、「ベクタレイヤの追加」で、フォーマットから「S-57 Base file」を選択し、上記でダウンロード・展開した.000ファイルを選択します。
そうすると、 「追加するベクタレイヤの選択」というダイアログで、どのレイヤをQGISに読ませるかをきかれます(ENCにおける地物の種類ごとにレイヤが作られることになります)。まずは何も考えずに「全てを選択」しておけばよいでしょう。
また、ArcGIS for Desktopでも、Esri S-57 Viewerというエクステンションをインストールすることによって、ENCを表示することができます。
GDALでENCデータを扱う
GDALでもENCのデータを扱うことができます。
ogrinfoでデータの中身を見ると、こんな感じでレイヤー(地物)の一覧を見ることができます。
c:\ENC_ROOT\US4HA51M>ogrinfo US4HA51M.000
ERROR 4: S57 Driver doesn't support update.
Had to open data source read-only.
INFO: Open of `US4HA51M.000'
using driver `S57' successful.
1: DSID (None)
2: ADMARE (Polygon)
3: AIRARE
4: ACHARE
5: BCNLAT (Point)
6: BCNSPP (Point)
7: BRIDGE
8: BUISGL
9: BUAARE
(以下省略)
また、ogr2ogrを使って、ENCデータを別のフォーマットに変換することも可能です。
c:\ENC_ROOT\US4HA51M>ogr2ogr.exe -f "ESRI shapefile" LNDARE.shp US4HA51M.000 LNDARE
ERROR 6: Can't create fields of type StringList on shapefile layers.
ERROR 6: Can't create fields of type IntegerList on shapefile layers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set QGISPATH=C:\Program Files\QGIS Wien set PYTHONPATH=%QGISPATH%\apps\Python27\Lib;%QGISPATH%\apps\Python27\DLLs;%QGISPATH%\apps\Python27\site-packages;%QGISPATH%\apps\qgis\python set PATH=C:\Windows\System32;%QGISPATH%\bin;%QGISPATH%\apps\Python27\Scripts