Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

地下街モデルのuro:BuildingDataQualityAttributeの対応 #694

Merged
merged 6 commits into from
Jan 27, 2025

Conversation

satoshi7190
Copy link
Contributor

@satoshi7190 satoshi7190 commented Jan 23, 2025

Close #0

What I did(変更内容)

  • 竹芝の地下街モデルの対応
    • uro:BuildingDataQualityAttributeの定義の追加
    • uro:bldgDataQualityAttributeの定義の追加
  • shp変換時の属性名の短縮定義を追加

対象のファイル

53393690_ubld_6697_40_op.gml
53393690_ubld_6697_41_op.gml
53393690_ubld_6697_42_op.gml

Notes(連絡事項)

None / なし

@satoshi7190 satoshi7190 self-assigned this Jan 23, 2025
Copy link

coderabbitai bot commented Jan 23, 2025

Walkthrough

この変更は、CityGMLデータモデルにおける建物データ品質属性の表現を拡張するものです。BuildingDataQualityAttributeという新しい構造体が導入され、DataQualityAttribute構造体にbuilding_data_quality_attributeフィールドが追加されました。また、UndergroundBuilding構造体にも同様のフィールドが追加され、TopLevelCityObject列挙型のUndergroundBuildingバリアントの管理方法が変更されました。

Changes

ファイル 変更概要
nusamai-plateau/src/models/iur/uro/common.rs - 新しいBuildingDataQualityAttribute構造体を追加
- DataQualityAttribute構造体にbuilding_data_quality_attributeフィールドを追加
nusamai-plateau/src/models/iur/uro/underground_building.rs - UndergroundBuilding構造体にbuilding_data_quality_attributeフィールドを追加
nusamai-plateau/src/models/mod.rs - TopLevelCityObject列挙型のUndergroundBuildingバリアントのシグネチャを更新

Possibly related PRs

  • PLATEAU V4に対応 #691: このPRの変更は、common.rs内のDataQualityAttribute構造体に新しいフィールドを追加することに関与しており、主PRのbuilding_data_quality_attributeフィールドの追加と密接に関連しています。

Suggested reviewers

  • nokonoko1203

Poem

🏗️ データの品質、新たな一歩 🏗️
地下の建物、属性輝く
コードは語る、詳細を込めて
CityGMLの世界、進化の証
うさぎ、デジタル地図を踊る 🐰


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
nusamai-plateau/src/models/iur/uro/common.rs (2)

66-81: ドキュメンテーションの追加を推奨

新しく追加されたBuildingDataQualityAttribute構造体とそのフィールドの目的や使用方法について、ドキュメントコメントの追加を推奨します。特に:

  • 構造体の目的
  • 各フィールドの期待される値
  • DataQualityAttributeとの関係性
+/// 建物データの品質属性を表す構造体
+/// CityGML URO拡張の BuildingDataQualityAttribute 要素に対応
 #[citygml_data(name = "uro:BuildingDataQualityAttribute")]
 pub struct BuildingDataQualityAttribute {
+    /// データの縮尺を示すコード
     #[citygml(path = b"uro:srcScale")]
     pub src_scale: Vec<Code>,

61-64: PLATEAUバージョン互換性の明記を推奨

他のフィールドと同様に、PLATEAUバージョンとの互換性に関するコメントの追加を推奨します。

+    // PLATEAU 3.x compatibility
     #[citygml(path = b"uro:BuildingDataQualityAttribute")]
     pub building_data_quality_attribute: Option<BuildingDataQualityAttribute>,
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c8bc57a and e0d883d.

⛔ Files ignored due to path filters (1)
  • nusamai/src/transformer/transform/shp_field_dict.json is excluded by !**/*.json
📒 Files selected for processing (2)
  • nusamai-plateau/src/models/iur/uro/common.rs (1 hunks)
  • nusamai-plateau/src/models/iur/uro/underground_building.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (1)
nusamai-plateau/src/models/iur/uro/common.rs (1)

77-78: ⚠️ Potential issue

lod1_height_typeの型の不一致について

DataQualityAttribute構造体ではlod1_height_typeOption<Code>として定義されているのに対し、BuildingDataQualityAttribute構造体ではVec<Code>として定義されています。この不一致は意図的なものでしょうか?

-    pub lod1_height_type: Vec<Code>,
+    pub lod1_height_type: Option<Code>,
✅ Verification successful

lod1_height_typeの型の修正について

レビューコメントは正しいです。BuildingDataQualityAttribute構造体のlod1_height_typeフィールドはVec<Code>ではなくOption<Code>として定義するべきです。これは以下の理由によります:

  • PLATEAUの仕様では、このフィールドは単一の値として使用されることが想定されています
  • 実装例のXMLデータでも、常に単一の値として使用されています
🏁 Scripts executed

The following scripts were executed for the analysis:

Error: No shell scripts found


Script:

#!/bin/bash
# Search for struct definitions
echo "=== Struct Definitions ==="
ast-grep --pattern 'struct DataQualityAttribute {
  $$$
}'

ast-grep --pattern 'struct BuildingDataQualityAttribute {
  $$$
}'

echo -e "\n=== Usage Patterns ==="
# Search for usage patterns
rg "DataQualityAttribute|BuildingDataQualityAttribute" -A 5 -B 5

echo -e "\n=== Documentation ==="
# Look for documentation
rg -l "height.*type" . | xargs rg "///|//!" || true

Length of output: 128077

@satoshi7190 satoshi7190 marked this pull request as ready for review January 24, 2025 00:51
@satoshi7190 satoshi7190 mentioned this pull request Jan 24, 2025
@nokonoko1203
Copy link
Collaborator

@satoshi7190 コンフリクト解消とテストの修正お願いします!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
nusamai-plateau/src/models/iur/uro/common.rs (1)

86-101: ドキュメンテーションコメントを追加してください

新しい構造体とそのフィールドの目的や使用方法を説明するドキュメンテーションコメントが不足しています。将来のメンテナンス性を向上させるため、以下の情報を含むコメントの追加を推奨します:

  • 構造体の目的
  • 各フィールドの役割
  • 想定される値や制約

例えば:

/// 建物データの品質属性を表現する構造体
/// PLATEAU 4.xの仕様に準拠
#[citygml_data(name = "uro:BuildingDataQualityAttribute")]
pub struct BuildingDataQualityAttribute {
    /// データの縮尺を示すコード
    #[citygml(path = b"uro:srcScale")]
    pub src_scale: Vec<Code>,
    // ... 他のフィールドも同様に
}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8d8385b and 462113a.

⛔ Files ignored due to path filters (1)
  • nusamai/src/transformer/transform/shp_field_dict.json is excluded by !**/*.json
📒 Files selected for processing (1)
  • nusamai-plateau/src/models/iur/uro/common.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: build
  • GitHub Check: test

nusamai-plateau/src/models/iur/uro/common.rs Outdated Show resolved Hide resolved
nusamai-plateau/src/models/iur/uro/common.rs Show resolved Hide resolved
Copy link

codecov bot commented Jan 26, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
nusamai-plateau/src/models/iur/uro/common.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
GUI ∅ <ø> (∅)
Backend 74.64% <ø> (ø)
Libraries 85.88% <0.00%> (-0.02%) ⬇️

📢 Thoughts on this report? Let us know!

@satoshi7190 satoshi7190 marked this pull request as draft January 26, 2025 03:58
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
nusamai-plateau/src/models/iur/uro/common.rs (1)

86-101: 構造体の実装は適切ですが、ドキュメントの追加を推奨します

構造体の実装は適切で、フィールドの型も正しく定義されています。ただし、以下の改善を推奨します:

  • 構造体の目的と使用方法を説明するドキュメントコメントの追加
  • 各フィールドの役割を説明するドキュメントコメントの追加
/// 建物データの品質属性を表現する構造体
/// PLATEAU の建物データに関する品質情報を格納します
#[citygml_data(name = "uro:BuildingDataQualityAttribute")]
pub struct BuildingDataQualityAttribute {
    /// データの縮尺を示すコード
    #[citygml(path = b"uro:srcScale")]
    pub src_scale: Vec<Code>,
    // ... 他のフィールドも同様に
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 462113a and eabc3f0.

📒 Files selected for processing (1)
  • nusamai-plateau/src/models/iur/uro/common.rs (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: test
  • GitHub Check: build
🔇 Additional comments (1)
nusamai-plateau/src/models/iur/uro/common.rs (1)

81-84: パス属性の形式を修正してください

パス属性の形式が他のフィールドと一貫性がありません。他のフィールドでは2段階のパスを使用していますが、このフィールドでは単一のパスになっています。

-    #[citygml(path = b"uro:BuildingDataQualityAttribute")]
+    #[citygml(path = b"uro:buildingDataQualityAttribute/uro:BuildingDataQualityAttribute")]

@satoshi7190 satoshi7190 marked this pull request as ready for review January 26, 2025 04:45
@satoshi7190
Copy link
Contributor Author

@nokonoko1203
コンフリクト解消しました
uro:BuildingDataQualityAttributeの正確な型が確認できないため、uro:DataQualityAttributeを参考にして型定義してます。現状、この状態で動作は確認済みです。

@nokonoko1203
Copy link
Collaborator

@satoshi7190 ありがとうございます!!
lgtm!

@nokonoko1203 nokonoko1203 merged commit 387960c into main Jan 27, 2025
8 of 9 checks passed
@nokonoko1203 nokonoko1203 deleted the fix/ulod-schema branch January 27, 2025 02:04
nokonoko1203 pushed a commit that referenced this pull request Jan 27, 2025
<!-- Close or Related Issues -->
Close #108

### What I did(変更内容)
<!-- Please describe the motivation behind this PR and the changes it
introduces. -->
<!-- どのような変更をしますか? 目的は? -->

- 竹芝、新宿、中央区、世田谷区のデータで動作確認済み
- 竹芝のxal:Addressを含むulodの変換エラーは #694 で対応



### Notes(連絡事項)
<!-- If manual testing is required, please describe the procedure. -->
<!-- 手動での動作確認が必要なら手順を簡単に伝えてください。そのほか連絡事項など。 -->

None / なし
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants