metanorma / mn-samples-plateau

Project PLATEAU by MLIT: Japanese Ministry of Land, Infrastructure, Transport and Tourism (国土交通省)
https://www.mlit.go.jp/plateau/
0 stars 0 forks source link

Document 01: Generate XML code lists using GML files and GML gem #128

Closed ronaldtse closed 1 month ago

ronaldtse commented 1 month ago

The i-UR data is downloaded from here:

Screenshot 2024-07-30 at 2 45 47 PM

It is the 3.1 "Codelists" archive that gives us these XML files:

Screenshot 2024-07-30 at 2 47 19 PM

e.g. This table is generated from: https://www.geospatial.jp/iur/codelists/3.1/Building_class.xml

Screenshot 2024-07-30 at 1 22 24 PM

We need to convert these all into a new command that can list out GML code lists.

We have a GML gem here:

We need to:

  1. Create an integration in LutaML using Liquid::Drop with the ogc-gml gem
  2. Update the document so that it can pass items from the GML code list into a Liquid environment that can be templated.
ronaldtse commented 1 month ago

I found these problematic tables:

Bilingual table with English content not from GML/XML (PLATEAU confirmed to remove English)

The GML XML has no English at all.

Screenshot 2024-07-30 at 2 26 50 PM
<gml:name>Room_class</gml:name>
<gml:dictionaryEntry>
<gml:Definition gml:id="Room_class_1">
<gml:description>管理事務、商業、保安の空間</gml:description>
<gml:name>SL_20</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="Room_class_2">
<gml:description>文化教育の空間</gml:description>
<gml:name>SL_25</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
====== Room_class.xml

[cols="3a,11a,11a"]
|===
| ファイル名 2+| Room_class.xml

h| ファイルURL 2+| https://www.geospatial.jp/iur/codelists/3.1/Room_class.xml
h| コード 2+h| 説明
| SL_20 | Administrative, commercial and protective service spaces | 管理事務、商業、保安の空間
| SL_25 | Cultural, educational, scientific and information spaces | 文化教育の空間
| SL_30 | Industrial spaces | 産業の空間
| SL_32 | Water and land management spaces | 水土管理(農林水産)の空間
| SL_35 | Medical, health, welfare and sanitary spaces | 医療、健康、福祉、衛生の空間
| SL_40 | Recreational spaces | レクリエーションの空間
| SL_42 | Sport and activity spaces | スポーツ活動の空間
| SL_45 | Residential spaces | 居住空間
| SL_50 | Waste disposal spaces and locations | 廃棄物処理の空間・場所
| SL_55 | Piped supply spaces | 配管による資源供給の空間
| SL_60 | Heating, cooling and refrigeration spaces | 暖房、冷房、冷凍(冷蔵)の空間
| SL_70 | Electrical power generation and lighting spaces | 電力・配電用の空間
| SL_75 | Communications, security, safety and protection spaces | 通信、セキュリティ、安全、保護の空間
| SL_80 | Transport spaces | 輸送・交通の空間
| SL_82 | Vehicle spaces | 車両スペース
| SL_90 | General spaces | その他一般の空間

|===

[.source]
<<uniclass>>

One code list file split into multiple tables according to LOD

  1. Splits tables according to LOD but this criteria is absent from the GML XML.
  2. Has categorizations (⼤分類 ⼩分類) absent from the GML XML.
  3. Has definitions (定義) absent from the GML XML.

e.g.

<gml:dictionaryEntry>
<gml:Definition gml:id="TrafficArea_function_1">
<gml:description>車道部</gml:description>
<gml:name>1000</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="TrafficArea_function_2">
<gml:description>車線</gml:description>
<gml:name>1010</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="TrafficArea_function_3">
<gml:description>車道交差部</gml:description>
<gml:name>1020</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
Screenshot 2024-07-30 at 2 23 35 PM
====== TrafficArea_function.xml

コードリストTrafficArea_function.xmlは、適用するLODにより使用可能なコードが異なるため、LOD別に示す。

* LOD2及びLOD3.0で使用する場合
+
--
[cols="3a,3a,3a,3a,13a"]
|===
| ファイル名 4+| TrafficArea_function.xml

h| ファイルURL 4+| https://www.geospatial.jp/iur/codelists/3.1/TrafficArea_function.xml
2+^h| 大分類 2+^h| 小分類 .2+^h| 定義
^h| コード ^h| 説明 ^h| コード ^h| 説明
.2+| 1000 .2+| 車道部 2+| | 主として自動車が利用する道路の部分。
| 1020 | 車道交差部 | 十字路、丁字路、その他二つ以上の車道が交わる部分。
| 2000 | 歩道部 2+| | 自転車や歩行者のために供される道路の部分。歩道上の植栽を含む。

|===

[.source]
<<nilim_kiban_dps>>
--

* LOD3.1で使用する場合
+
--
[cols="3a,3a,3a,3a,13a"]
|===
| ファイル名 4+| TrafficArea_function.xml

h| ファイルURL 4+| https://www.geospatial.jp/iur/codelists/3.1/TrafficArea_function.xml
2+^h| 大分類 2+^h| 小分類 .2+^h| 定義
^h| コード ^h| 説明 ^h| コード ^h| 説明
.3+| 1000 .3+| 車道部 2+| | 主として自動車が利用する道路の部分のうち、自動車の通行の用に供される部分。
| 1010 | 車線 | 一縦列の自動車を安全かつ円滑に通行させるために設けられる帯状の車道の部分。
| 1020 | 車道交差部 | 十字路、丁字路、その他二つ以上の車道が交わる部分。
| 2000 | 歩道部 2+| | 自転車や歩行者のために供される道路の部分。歩道上の植栽を含む。

|===

[.source]
<<nilim_kiban_dps>>
--

* LOD3.2及びLOD3.3で使用する場合
+
--
[cols="3a,3a,3a,3a,13a"]
|===
| ファイル名 4+| TrafficArea_function.xml

h| ファイルURL 4+| https://www.geospatial.jp/iur/codelists/3.1/TrafficArea_function.xml
2+^h| 大分類 2+^h| 小分類 .2+^h| 定義
^h| コード ^h| 説明 ^h| コード ^h| 説明
.3+| 1000 .3+| 車道部 2+| | 主として自動車が利用する道路の部分のうち、自動車の通行の用に供される部分。
| 1010 | 車線 | 一縦列の自動車を安全かつ円滑に通行させるために設けられる帯状の車道の部分。
| 1020 | 車道交差部 | 十字路、丁字路、その他二つ以上の車道が交わる部分。
| 2000 | 歩道部 2+| | 自転車や歩行者のために供される道路の部分。植栽を含まない。

|===

[.source]
<<nilim_kiban_dps>>
--

* LOD3.4で使用する場合
+
--
[cols="3a,3a,3a,3a,13a"]
|===
| ファイル名 4+| TrafficArea_function.xml

h| ファイルURL 4+| https://www.geospatial.jp/iur/codelists/3.1/TrafficArea_function.xml
2+^h| 大分類 2+^h| 小分類 .2+^h| 定義
^h| コード ^h| 説明 ^h| コード ^h| 説明
.8+| 1000
.8+| 車道部
2+|
| 主として自動車が利用する道路の部分のうち、自動車の通行の用に供される部分。 +
車線やすりつけ区間等区分されている以外の場所を全て車道部として取得する。

| 1010 | 車線 | 一縦列の自動車を安全かつ円滑に通行させるために設けられる帯状の車道の部分。
| 1020 | 車道交差部 | 十字路、丁字路、その他二つ以上の車道が交わる部分。
| 1030 | すりつけ区間 | 車線の数が増加もしくは減少する、又は道路が接続する場合に設けられる車道の部分。
| 1040 | 踏切道 | 鉄道と交差する道路の部分。
| 1050 | 軌道敷 | 路面電車が走行する道路の部分。
| 1070 | 待避所 | 一車線の道路において、車両のすれ違いのために車道の幅員を拡げる部分。
| 1130 | 副道 | 道路の構造により沿道との出入りが妨げられる場合に、沿道への出入りを確保するために本線車道に並行して設置される道路。
.4+| 2000 .4+| 歩道部 2+| | 自転車や歩行者のために供される道路の部分。
| 2010 | 自転車歩行者道 | 自転車及び歩行者の通行の用に供される道路の部分。
| 2020 | 歩道 | 歩行者の通行の用に供される道路の部分。
| 2030 | 自転車道 | 自転車の通行の用に供される道路の部分。
| 6000 | 自転車駐車場 2+| | 自転車駐車場のうち、走路部分。
| 7000 | 自動車駐車場 2+| | 自動車駐車場のうち、走路部分。

|===

[.source]
<<nilim_kiban_dps>>
--

Two code list files in one, with a table that splits columns and categories

Screenshot 2024-07-30 at 2 22 24 PM
====== TrafficArea_surfaceMaterial.xml、AuxiliaryTrafficArea_surfaceMaterial.xml

[cols="6a,19a,6a,19a"]
|===
| ファイル名 3+| TrafficArea_surfaceMaterial.xml、AuxiliaryTrafficArea_surfaceMaterial.xml

h| ファイルURL
3+| https://www.geospatial.jp/iur/codelists/3.1/TrafficArea_surfaceMaterial.xml +
https://www.geospatial.jp/iur/codelists/3.1/AuxiliaryTrafficArea_surfaceMaterial.xml

2+^h| 大分類 2+^h| 小分類
^h| コード ^h| 説明 ^h| コード ^h| 説明
.4+| 1000 .4+| アスファルト舗装 2+|  
| 1010 | 排水性アスファルト舗装
| 1020 | 透水性アスファルト舗装
| 1030 | 保水性アスファルト舗装
| 2000 3+| コンクリート舗装
| 3000 3+| 樹脂系混合舗装
| 4000 3+| ブロック系舗装
| 5000 3+| 土系舗装
| 6000 3+| 木質系舗装
| 9000 3+| その他

|===

[.source]
<<mlit_road_upkeep>>

Somewhat broken GML XML

Screenshot 2024-07-30 at 2 30 04 PM

Notice that lines like 数値図化区分="基準点測量を用いる方法"_"地図情報レベル="1~50" can't be proper description, it is expected to be treated like XML attributes.

<gml:Definition gml:id="DmElement_precisionType_1">
<gml:description>数値図化区分="基準点測量を用いる方法"_"地図情報レベル="1~50"</gml:description>
<gml:name>11</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="DmElement_precisionType_2">
<gml:description>数値図化区分="基準点測量を用いる方法"_"地図情報レベル="~100"</gml:description>
<gml:name>12</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
====== DmElement_precisionType.xml

[cols="3a,11a,11a"]
|===
| ファイル名 | DmElement_precisionType.xml |

h| ファイルURL | https://www.geospatial.jp/iur/codelists/3.1/DmElement_precisionType.xml |
h| コード h| 説明(上位桁:数値化区分) h| 説明(下位桁:地図情報レベル)
| 1 | 基準点測量成果を用いる方法 | 1~50
| 2 | TS等を用いた数値実測 | ~100
| 3 | 数値図化法・他の数値地形図データの利用 | ~250
| 4 | 既成図数値化(無伸縮図面を使用)* | ~500
| 5 | 既成図数値化(伸縮図面を使用)* | ~1000
| 6 | 航空レーザ測量成果を用いる方法 | ~2500
| 7 | | ~5000
| 8 | | ~10000
| 9 | その他 | その他

|===

[.source]
<<gsi_ops,annex=7,付録7 公共測量標準図式>>

Grouped values

Screenshot 2024-07-30 at 2 31 21 PM

The data is not grouped.

<gml:dictionaryEntry>
<gml:Definition gml:id="DmElement_breakType_1">
<gml:description>間断しない</gml:description>
<gml:name>0</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="DmElement_breakType_2">
<gml:description>間断する(1)</gml:description>
<gml:name>1</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="DmElement_breakType_3">
<gml:description>間断する(2)</gml:description>
<gml:name>2</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="DmElement_breakType_4">
<gml:description>間断する(3)</gml:description>
<gml:name>3</gml:name>
</gml:Definition>
</gml:dictionaryEntry>

But the table is this:

====== DmElement_breakType.xml

[cols="3a,22a"]
|===
| ファイル名 | DmElement_breakType.xml

h| ファイルURL | https://www.geospatial.jp/iur/codelists/3.1/DmElement_breakType.xml
h| コード h| 説明
| 0 | 間断しない
| 1~9 | 間断する(数値は優先順位)

|===

Disallowed values

Values 7, 8, 9 are listed as "not to be used" but this information is not from the GML XML.

Screenshot 2024-07-30 at 2 34 13 PM
<gml:dictionaryEntry>
<gml:Definition gml:id="DataQualityAttribute_lod1HeightType_7">
<gml:description>建築確認申請書類等に記載された「建築物の高さ」</gml:description>
<gml:name>7</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
<gml:dictionaryEntry>
<gml:Definition gml:id="DataQualityAttribute_lod1HeightType_8">
<gml:description>都市計画基礎調査(建物利用現況)の「高さ(m)」</gml:description>
<gml:name>8</gml:name>
</gml:Definition>
</gml:dictionaryEntry>
====== DataQualityAttribute_lod1HeightType.xml

[cols="3a,22a"]
|===
| ファイル名 | DataQualityAttribute_lod1HeightType.xml

h| ファイルURL | https://www.geospatial.jp/iur/codelists/3.1/DataQualityAttribute_lod1HeightType.xml
h| コード h| 説明
| 1 | 点群から取得_最高高さ
| 2 | 点群から取得_中央値
| 3 | 点群から取得_平均値
| 4 | 点群から取得_最頻値
| 5 | 点群から取得_最低値
| 6 | 航空写真図化_最高高さ
| (使用不可)7 | 建築確認申請書類等に記載された「建築物の高さ」
| (使用不可)8 | 都市計画基礎調査(建物利用現況)の「高さ(m)」
| (使用不可)9 | 階高3m×都市計画基礎調査(建物利用現況)の「階数・地上(階)」による推定値
| 10 | 図面から取得した高さ
| 0 | 取得不可のため一律値(3m)

|===

Worse, these codes are useable/unuseable depending on the class:

Screenshot 2024-07-30 at 2 34 47 PM Screenshot 2024-07-30 at 2 35 15 PM Screenshot 2024-07-30 at 2 35 31 PM

These are the duplicated code lists tables:

Screenshot 2024-07-30 at 2 35 58 PM Screenshot 2024-07-30 at 2 39 36 PM
ReesePlews commented 1 month ago

@ronaldtse the additional translation is always helpful in specific situations but in this case, the english translations/descriptions are not needed. if the files are not GML dictionary files, please let me know. i think the spec should support gml dictionary files only at this time, unless you have another position on that (benefit to other users, etc).