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

nusamai-gpkg: クレートの作成、空のGeoPackageファイル作成 #89

Merged
merged 9 commits into from
Dec 25, 2023

Conversation

sorami
Copy link
Member

@sorami sorami commented Dec 20, 2023

#8

まず、ベースの部分を作ってみました。

このPR後に、ジオメトリデータをバイナリ化したりしたものなど、各情報をSQLiteテーブルへ入れていく。

変更

  • nusamai-gpkg クレートの新規作成
  • SQLxによる、空のGeoPackageファイル作成
  • example: CLIからのテスト実行

@sorami sorami self-assigned this Dec 20, 2023
Copy link

codecov bot commented Dec 20, 2023

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Files Patch % Lines
nusamai-gpkg/src/handler.rs 86.11% 10 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
GUI ∅ <ø> (∅)
Backend 56.81% <ø> (+0.21%) ⬆️
Libraries 85.30% <86.11%> (+2.86%) ⬆️

📢 Thoughts on this report? Let us know!

@ciscorn ciscorn added the Output Fomat Output format drivers label Dec 24, 2023
@sorami sorami requested a review from a team December 25, 2023 07:31
@sorami sorami marked this pull request as ready for review December 25, 2023 07:31
@ciscorn ciscorn self-requested a review December 25, 2023 08:42
Copy link
Member

@ciscorn ciscorn left a comment

Choose a reason for hiding this comment

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

LGTM!

Compile-time verification が使えるなら積極的に使うとよいかもなと思いましたが、Gpkgの固定テーブル以外は動的なので、あまり使い所はないかも。
https://github.com/launchbadge/sqlx?tab=readme-ov-file#compile-time-verification

ciscorn pushed a commit that referenced this pull request Dec 27, 2023
#8

まず、ベースの部分を作ってみました。

このPR後に、ジオメトリデータをバイナリ化したりしたものなど、各情報をSQLiteテーブルへ入れていく。

## 変更

- [x] `nusamai-gpkg` クレートの新規作成
- [x] SQLxによる、空のGeoPackageファイル作成
- [x] example: CLIからのテスト実行
sorami added a commit that referenced this pull request Dec 27, 2023
#89 を踏まえて、トップレベル都市オブジェクトをGeoPackageへ追加する部分を実装。

参考(Notion): [GeoPackage
メモ](https://www.notion.so/GeoPackage-56b53cc7ee5f4270a7df151d84bfb290)
(テーブルやバイナリの構造など)

## 大まかな流れ

- `GpkgHandler::init` (`src/handler.rs`)
  - `sql/init.sql` で、GeoPackage用のテーブルを作成
  - `sql/mpoly3d.sql` で、3Dマルチポリゴン用のテーブルを用意
- `GpkgHandler::add_object`
  - トップレベル都市オブジェクトを受け取り、DBへ追加
  - ジオメトリのバイナリを作る部分は `src/geometry.rs` にある

exampleの実行例:

```
$  cargo run --example gml2gpkg ~/plateau/13100_tokyo23-ku_2022_citygml_1_2_op/udx/bldg/53392546_bldg_6697_2_op.gml
```

## このPRで対応しない想定のイシュー

- #119
- #120
- #121
- #122
- #124 
- #125
ciscorn added a commit that referenced this pull request Jan 5, 2024
close #121

#89 , #129 での、Gpkg変換の初期実装をもとに、全体の流れに組み込む(sinkを作る)。

とりあえず書いてみたコード例のようなものなので、コメントいただきたいです。

## 悩み

SQLx(async)の取り扱い。とりあえず、Sinkの中でブロックしてやってみているが、こう言う方法でいいのか?

---------

Co-authored-by: Taku Fukada <naninunenor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Output Fomat Output format drivers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants