Skip to content

Commit

Permalink
施設管理の応用スキーマと公共測量標準図式の応用スキーマのスタブを実装 (#82)
Browse files Browse the repository at this point in the history
#70 を補助するPRとして、#81 の問題の一部を解決する)

施設管理まわりと公共測量標準図式まわりについて、おおよその形を示してあります。

すべてを実装しているわけではなく、特に、大量の `FacilityAttribute` まわりについては一切実装していないです。

CityFurniture でこれらのデータが付属するものは今のところなさそうなので、テストもありません。
  • Loading branch information
ciscorn committed Dec 27, 2023
1 parent 79e4ee8 commit 81f0126
Show file tree
Hide file tree
Showing 10 changed files with 381 additions and 78 deletions.
1 change: 1 addition & 0 deletions nusamai-plateau/citygml/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ fn generate_citygml_struct_model(
add_arm(2, b"lod2MultiSurface", "MultiSurface");
add_arm(3, b"lod3MultiSurface", "MultiSurface");
add_arm(4, b"lod4MultiSurface", "MultiSurface");
add_arm(0, b"lod0Geometry", "Geometry"); // for uro:lod0Geometry
add_arm(1, b"lod1Geometry", "Geometry");
add_arm(2, b"lod2Geometry", "Geometry");
add_arm(3, b"lod3Geometry", "Geometry");
Expand Down
65 changes: 0 additions & 65 deletions nusamai-plateau/src/models/iur/uro/common.rs

This file was deleted.

153 changes: 153 additions & 0 deletions nusamai-plateau/src/models/iur/uro/dm.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
use citygml::{CityGMLElement, Code, GeometryRef, Measure};

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Default, Debug, CityGMLElement)]
pub enum DmAttributeProperty {
#[default]
Unknown,
#[citygml(path = b"uro:DmAnnotation")]
DmAnnotation(DmAnnotation),
#[citygml(path = b"uro:DmGeometricAttribute")]
DmGeometricAttribute(DmGeometricAttribute),
}

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Default, Debug, CityGMLElement)]
pub struct DmAnnotation {
#[citygml(path = b"uro:dmCode")]
pub dm_code: Option<Code>,

#[citygml(path = b"uro:meshCode")]
pub mesh_code: Vec<Code>,

#[citygml(path = b"uro:dmElement/uro:DmElement")]
pub dm_element: Option<DmElement>,

#[citygml(path = b"uro:geometryType")]
pub geometry_type: Option<Code>,

#[citygml(path = b"uro:shapeType")]
pub shape_type: Option<Code>,

#[citygml(path = b"uro:label")]
pub label: Option<Code>,

#[citygml(path = b"uro:isVertical")]
pub is_vertical: Option<bool>,

#[citygml(path = b"uro:size")]
pub size: Option<i64>,

#[citygml(path = b"uro:orientation")]
pub orientation: Option<i64>,

#[citygml(path = b"uro:linewidth")]
pub linewidth: Option<i64>,

#[citygml(path = b"uro:spacing")]
pub spacing: Option<i64>,
// TODO:
// #[citygml(path = b"uro:lod0anchorPoint")]
// pub lod0anchorPoint: GeometryPropertyType
}

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Default, Debug, CityGMLElement)]
pub struct DmGeometricAttribute {
#[citygml(geom = b"uro")]
pub geometry: GeometryRef,

#[citygml(path = b"uro:dmCode")]
pub dm_code: Option<Code>,

#[citygml(path = b"uro:meshCode")]
pub mesh_code: Vec<Code>,

#[citygml(path = b"uro:dmElement/uro:DmElement")]
pub dm_element: Option<DmElement>,

#[citygml(path = b"uro:geometryType")]
pub geometry_type: Option<Code>,

#[citygml(path = b"uro:mapLevel")]
pub map_level: Option<Code>,

#[citygml(path = b"uro:shapeType")]
pub shape_type: Option<Code>,

#[citygml(path = b"uro:visibility")]
pub visibility: Option<bool>,

#[citygml(path = b"uro:is3d")]
pub is3d: Option<bool>,

#[citygml(path = b"uro:isInstallation")]
pub is_installation: Option<bool>,

#[citygml(path = b"uro:isEdited")]
pub is_edited: Option<bool>,

#[citygml(path = b"uro:isSupplementarySymbol")]
pub is_supplementary_symbol: Option<bool>,

#[citygml(path = b"uro:angle")]
pub angle: Option<f64>,

#[citygml(path = b"uro:elevation")]
pub elevation: Option<Measure>,
// TODO:
// #[citygml(path = b"uro:lod0Geometry")]
// pub lod0anchorPoint: GeometryPropertyType
}

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Default, Debug, CityGMLElement)]
pub struct DmElement {
#[citygml(path = b"uro:locationType")]
pub location_type: Option<Code>,

#[citygml(path = b"uro:infoType")]
pub info_type: Option<Code>,

#[citygml(path = b"uro:elementKey")]
pub element_key: Option<String>,

#[citygml(path = b"uro:hierarchyLevel")]
pub hierarchy_level: Option<String>,

#[citygml(path = b"uro:dataType")]
pub data_type: Option<Code>,

#[citygml(path = b"uro:annotationType")]
pub annotation_type: Option<Code>,

#[citygml(path = b"uro:precisionType")]
pub precision_type: Option<Code>,

#[citygml(path = b"uro:dislocationType")]
pub dislocation_type: Option<Code>,

#[citygml(path = b"uro:breakType")]
pub break_type: Option<Code>,

#[citygml(path = b"uro:attributeValue")]
pub attribute_value: Option<String>,

#[citygml(path = b"uro:attributeType")]
pub attribute_type: Option<Code>,

#[citygml(path = b"uro:attributeValueType")]
pub attribute_value_type: Option<String>,

#[citygml(path = b"uro:creationDate")]
pub creation_date: Option<String>, // TODO: xs:gYearMonth

#[citygml(path = b"uro:updateDate")]
pub update_date: Option<String>, // TODO: xs:gYearMonth

#[citygml(path = b"uro:terminationDate")]
pub termination_date: Option<String>, // TODO: xs:gYearMonth

#[citygml(path = b"uro:freeSpace")]
pub free_space: Option<String>,
}
68 changes: 68 additions & 0 deletions nusamai-plateau/src/models/iur/uro/facility.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
use citygml::CityGMLElement;

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Default, Debug, CityGMLElement)]
pub enum FacilityAttributeProperty {
#[default]
Unknown,
// TODO:
// #[citygml(path = b"uro:CargoHandlingFacility")]
// CargoHandlingFacility(CargoHandlingFacility),
// TODO:
// #[citygml(path = b"uro:CyberportMarinaAndPBS")]
// CyberportMarinaAndPBS(CyberportMarinaAndPBS),
// TODO:
// #[citygml(path = b"uro:FishingPortAttribute")]
// FishingPortAttribute(FishingPortAttribute),
// TODO:
// #[citygml(path = b"uro:FishingPortCapacity")]
// FishingPortAttribute(FishingPortAttribute),
// TODO:
// #[citygml(path = b"uro:FishingPortFacility")]
// FishingPortFacility(FishingPortFacility),
// TODO:
// #[citygml(path = b"uro:HarborFacility")]
// HarborFacility(HarborFacility),
// TODO:
// #[citygml(path = b"uro:MaintenanceHistoryAttribute")]
// MaintenanceHistoryAttribute(MaintenanceHistoryAttribute),
// TODO:
// #[citygml(path = b"uro:MooringFacility")]
// MooringFacility(MooringFacility),
// TODO:
// #[citygml(path = b"uro:NavigationAssistanceFacility")]
// NavigationAssistanceFacility(NavigationAssistanceFacility),
// TODO:
// #[citygml(path = b"uro:PortAttribute")]
// PortAttribute(PortAttribute),
// TODO:
// #[citygml(path = b"uro:PortEnvironmentalImprovementFacility")]
// PortEnvironmentalImprovementFacility(PortEnvironmentalImprovementFacility),
// TODO:
// #[citygml(path = b"uro:PortManagementFacility")]
// PortManagementFacility(PortManagementFacility),
// TODO:
// #[citygml(path = b"uro:PortPassengerFacility")]
// PortPassengerFacility(PortPassengerFacility),
// TODO:
// #[citygml(path = b"uro:PortPollutionControlFacility")]
// PortPollutionControlFacility(PortPollutionControlFacility),
// TODO:
// #[citygml(path = b"uro:PortProtectiveFacility")]
// PortProtectiveFacility(PortProtectiveFacility),
// TODO:
// #[citygml(path = b"uro:PortStorageFacility")]
// PortStorageFacility(PortStorageFacility),
// TODO:
// #[citygml(path = b"uro:PortTransportationFacility")]
// PortTransportationFacility(PortTransportationFacility),
// TODO:
// #[citygml(path = b"uro:PortWasteTreatmentFacility")]
// PortWasteTreatmentFacility(PortWasteTreatmentFacility),
// TODO:
// #[citygml(path = b"uro:PortWelfareFacility")]
// PortWelfareFacility(PortWelfareFacility),
// TODO:
// #[citygml(path = b"uro:ShipServiceFacility")]
// ShipServiceFacility(ShipServiceFacility),
}
Loading

0 comments on commit 81f0126

Please sign in to comment.