Skip to main content

mojxml_parser/
types.rs

1use geo_types::Polygon;
2#[cfg(feature = "geoparquet")]
3use geoparquet_batch_writer::GeoParquetRowStruct;
4use serde::Serialize;
5
6pub struct ParsedXML {
7    pub file_name: String,
8    pub features: Vec<Feature>,
9    pub common_props: CommonProperties,
10}
11
12#[derive(Debug, Clone)]
13pub struct Feature {
14    pub geometry: Polygon,
15    pub props: FeatureProperties,
16}
17
18#[derive(Debug, Clone, Default, Serialize)]
19pub struct FeatureProperties {
20    pub 筆id: String,
21    pub 精度区分: Option<String>,
22    pub 大字コード: String,
23    pub 丁目コード: String,
24    pub 小字コード: String,
25    pub 予備コード: String,
26    pub 大字名: Option<String>,
27    pub 丁目名: Option<String>,
28    pub 小字名: Option<String>,
29    pub 予備名: Option<String>,
30    pub 地番: String,
31    pub 座標値種別: Option<String>,
32    pub 筆界未定構成筆: Vec<筆界未定構成筆>,
33    pub 代表点緯度: f64,
34    pub 代表点経度: f64,
35}
36
37#[derive(Debug, Clone, Default, Serialize)]
38#[cfg_attr(feature = "geoparquet", derive(GeoParquetRowStruct))]
39pub struct 筆界未定構成筆 {
40    pub 大字コード: String,
41    pub 丁目コード: String,
42    pub 小字コード: String,
43    pub 予備コード: String,
44    pub 大字名: Option<String>,
45    pub 丁目名: Option<String>,
46    pub 小字名: Option<String>,
47    pub 予備名: Option<String>,
48    pub 地番: String,
49}
50
51#[derive(Serialize)]
52pub struct CommonProperties {
53    pub 地図名: String,
54    pub 市区町村コード: String,
55    pub 市区町村名: String,
56    pub 座標系: String,
57    pub 測地系判別: Option<String>,
58}