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

feat(plateau): rename cityfurniture module to city_furniture #6

Merged
merged 1 commit into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions nusamai-citygml/src/namespace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ pub fn wellknown_prefix_from_nsres<'a>(ns: &ResolveResult<'a>) -> &'a [u8] {
} else if let Some(https_www) = http.strip_prefix(b"s://www.") {
if let Some(iur) = https_www.strip_prefix(b"geospatial.jp/iur/ur") {
match iur {
// PLATEAU 4.x
b"o/3.1" => b"uro:",
b"f/3.1" => b"urf:",
// PLATEAU 3.x
b"o/3.0" => b"uro:",
b"f/3.0" => b"urf:",
Expand Down Expand Up @@ -113,8 +116,10 @@ mod tests {
xmlns:gen2ns="http://www.opengis.net/citygml/generics/2.0"
xmlns:dem2ns="http://www.opengis.net/citygml/relief/2.0"
xmlns:luse2ns="http://www.opengis.net/citygml/landuse/2.0"
xmlns:uro3ns="https://www.geospatial.jp/iur/uro/3.0"
xmlns:urf3ns="https://www.geospatial.jp/iur/urf/3.0"
xmlns:uro31ns="https://www.geospatial.jp/iur/uro/3.1"
xmlns:urf31ns="https://www.geospatial.jp/iur/urf/3.1"
xmlns:uro30ns="https://www.geospatial.jp/iur/uro/3.0"
xmlns:urf30ns="https://www.geospatial.jp/iur/urf/3.0"
xmlns:uro2ns="https://www.geospatial.jp/iur/uro/2.0"
xmlns:urf2ns="https://www.geospatial.jp/iur/urf/3.0"
xmlns:uro15ns="https://www.chisou.go.jp/tiiki/toshisaisei/itoshisaisei/iur/uro/1.5"
Expand All @@ -141,8 +146,10 @@ mod tests {
<gen2ns:gen />
<dem2ns:dem />
<luse2ns:luse />
<uro3ns:uro />
<urf3ns:urf />
<uro31ns:uro />
<urf31ns:urf />
<uro30ns:uro />
<urf30ns:urf />
<uro2ns:uro />
<urf2ns:urf />
<uro15ns:uro />
Expand Down
4 changes: 2 additions & 2 deletions nusamai-plateau/src/appearance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use url::Url;

use crate::models::appearance::{self, ParameterizedTexture, SurfaceDataProperty, X3DMaterial};

#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)]
#[derive(Debug, Default, serde::Serialize, serde::Deserialize)]
pub struct Theme {
pub ring_id_to_texture: HashMap<LocalId, (u32, LineString2<'static>)>, // TODO: texture index is redundant
pub surface_id_to_material: HashMap<LocalId, u32>,
Expand Down Expand Up @@ -52,7 +52,7 @@ impl Hash for Material {
self.ambient_intensity.to_bits().hash(state);
}
}
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
#[derive(Debug, Default, serde::Serialize, serde::Deserialize)]
pub struct AppearanceStore {
pub textures: Vec<Texture>,
pub materials: Vec<Material>,
Expand Down
28 changes: 18 additions & 10 deletions nusamai-plateau/src/models/bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ pub struct Bridge {
pub address: Vec<Address>,

#[citygml(path = b"uro:bridBaseAttribute/uro:ConstructionBaseAttribute")]
pub brid_base_attribute: Option<uro::ConstructionBaseAttribute>,
pub brid_base_attribute: Vec<uro::ConstructionBaseAttribute>,

#[citygml(path = b"uro:bridDataQualityAttribute/uro:ConstructionDataQualityAttribute")]
pub brid_data_quality_attribute: Option<uro::ConstructionDataQualityAttribute>,
#[citygml(path = b"uro:bridDataQualityAttribute/uro:DataQualityAttribute")]
pub brid_data_quality_attribute: Option<uro::DataQualityAttribute>,

#[citygml(path = b"uro:bridDisasterRiskAttribute")]
pub brid_disaster_risk_attribute: Vec<uro::DisasterRiskAttributeProperty>, // -> uro:DisasterRiskAttribute
Expand All @@ -65,13 +66,16 @@ pub struct Bridge {
pub brid_facility_type_attribute: Vec<uro::FacilityTypeAttribute>,

#[citygml(path = b"uro:bridFunctionalAttribute/uro:BridgeFunctionalAttribute")]
pub brid_functional_attribute: Option<uro::BridgeFunctionalAttribute>,
pub brid_functional_attribute: Vec<uro::BridgeFunctionalAttribute>,

#[citygml(path = b"uro:bridKeyValuePairAttribute/uro:KeyValuePairAttribute")]
pub brid_key_value_pair_attribute: Vec<uro::KeyValuePairAttribute>,

#[citygml(path = b"uro:bridRiskAssessmentAttribute/uro:ConstructionRiskAssessmentAttribute")]
pub brid_risk_assessment_attribute: Option<uro::ConstructionRiskAssessmentAttribute>,
pub brid_risk_assessment_attribute: Vec<uro::ConstructionRiskAssessmentAttribute>,

#[citygml(path = b"uro:bridStructureAttribute/uro:BridgeStructureAttribute")]
pub brid_structure_attribute: Option<uro::BridgeStructureAttribute>,
pub brid_structure_attribute: Vec<uro::BridgeStructureAttribute>,
}

#[citygml_feature(name = "brid:BridgePart")]
Expand Down Expand Up @@ -116,10 +120,11 @@ pub struct BridgePart {
pub address: Vec<Address>,

#[citygml(path = b"uro:bridBaseAttribute/uro:ConstructionBaseAttribute")]
pub brid_base_attribute: Option<uro::ConstructionBaseAttribute>,
pub brid_base_attribute: Vec<uro::ConstructionBaseAttribute>,

#[citygml(path = b"uro:bridDataQualityAttribute/uro:ConstructionDataQualityAttribute")]
pub brid_data_quality_attribute: Option<uro::ConstructionDataQualityAttribute>,
#[citygml(path = b"uro:bridDataQualityAttribute/uro:DataQualityAttribute")]
pub brid_data_quality_attribute: Option<uro::DataQualityAttribute>,

#[citygml(path = b"uro:bridDisasterRiskAttribute")]
pub brid_disaster_risk_attribute: Vec<uro::DisasterRiskAttributeProperty>, // -> uro:DisasterRiskAttribute
Expand All @@ -137,13 +142,16 @@ pub struct BridgePart {
pub brid_facility_type_attribute: Vec<uro::FacilityTypeAttribute>,

#[citygml(path = b"uro:bridFunctionalAttribute/uro:BridgeFunctionalAttribute")]
pub brid_functional_attribute: Option<uro::BridgeFunctionalAttribute>,
pub brid_functional_attribute: Vec<uro::BridgeFunctionalAttribute>,

#[citygml(path = b"uro:bridKeyValuePairAttribute/uro:KeyValuePairAttribute")]
pub brid_key_value_pair_attribute: Vec<uro::KeyValuePairAttribute>,

#[citygml(path = b"uro:bridRiskAssessmentAttribute/uro:ConstructionRiskAssessmentAttribute")]
pub brid_risk_assessment_attribute: Option<uro::ConstructionRiskAssessmentAttribute>,
pub brid_risk_assessment_attribute: Vec<uro::ConstructionRiskAssessmentAttribute>,

#[citygml(path = b"uro:bridStructureAttribute/uro:BridgeStructureAttribute")]
pub brid_structure_attribute: Option<uro::BridgeStructureAttribute>,
pub brid_structure_attribute: Vec<uro::BridgeStructureAttribute>,
}

#[citygml_feature(name = "brid:BridgeConstructionElement")]
Expand Down
79 changes: 34 additions & 45 deletions nusamai-plateau/src/models/building.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use nusamai_citygml::{
citygml_feature, citygml_property, CityGmlElement, Code, GYear, Length, Measure,
MeasureOrNullList,
citygml_feature, citygml_property, CityGmlElement, Code, GYear, Length, MeasureOrNullList,
};

use super::{core::Address, iur::uro};
Expand All @@ -17,16 +16,16 @@ pub struct Building {
pub usage: Vec<Code>,

#[citygml(path = b"bldg:yearOfConstruction")]
pub year_of_construction: Option<u64>,
pub year_of_construction: Option<GYear>,

#[citygml(path = b"bldg:yearOfDemolition")]
pub year_of_demolition: Option<u64>,
pub year_of_demolition: Option<GYear>,

#[citygml(path = b"bldg:roofType")]
pub roof_type: Option<Code>,

#[citygml(path = b"bldg:measuredHeight")]
pub measured_height: Option<Measure>,
pub measured_height: Option<Length>,

#[citygml(path = b"bldg:storeysAboveGround")]
pub storeys_above_ground: Option<u64>,
Expand Down Expand Up @@ -58,6 +57,14 @@ pub struct Building {
#[citygml(path = b"bldg:address/core:Address")]
pub address: Vec<Address>,

#[citygml(path = b"uro:buildingDataQualityAttribute/uro:BuildingDataQualityAttribute")]
#[citygml(path = b"uro:bldgDataQualityAttribute/uro:DataQualityAttribute")]
pub bldg_data_quality_attribute: Option<uro::DataQualityAttribute>,

#[citygml(path = b"uro:buildingDisasterRiskAttribute")]
#[citygml(path = b"uro:bldgDisasterRiskAttribute")]
pub bldg_disaster_risk_attribute: Vec<uro::DisasterRiskAttributeProperty>, // -> uro:DisasterRiskAttribute

#[citygml(path = b"uro:bldgDmAttribute")]
pub bldg_dm_attribute: Vec<uro::DmAttributeProperty>, // -> uro:DmAttribute

Expand All @@ -70,30 +77,28 @@ pub struct Building {
#[citygml(path = b"uro:bldgFacilityTypeAttribute/uro:FacilityTypeAttribute")]
pub bldg_facility_type_attribute: Vec<uro::FacilityTypeAttribute>,

#[citygml(path = b"uro:keyValuePairAttribute/uro:KeyValuePairAttribute")]
#[citygml(path = b"uro:bldgKeyValuePairAttribute/uro:KeyValuePairAttribute")]
pub bldg_key_value_pair_attribute: Vec<uro::KeyValuePairAttribute>,

#[citygml(path = b"uro:bldgRealEstateIDAttribute/uro:RealEstateIDAttribute")]
pub bldg_real_estate_id_attribute: Option<uro::RealEstateIDAttribute>,

#[citygml(path = b"uro:buildingDataQualityAttribute/uro:BuildingDataQualityAttribute")]
pub building_data_quality_attribute: Option<uro::BuildingDataQualityAttribute>,
#[citygml(path = b"uro:bldgUsecaseAttribute/uro:BuildingUsecaseAttribute")]
pub bldg_usecase_attribute: Vec<uro::BuildingUsecaseAttribute>,

#[citygml(path = b"uro:buildingDetailAttribute/uro:BuildingDetailAttribute")]
pub building_detail_attribute: Vec<uro::BuildingDetailAttribute>,

#[citygml(path = b"uro:buildingDisasterRiskAttribute")]
pub building_disaster_risk_attribute: Vec<uro::BuildingDisasterRiskAttributeProperty>, // -> uro:BuildingDisasterRiskAttribute

#[citygml(path = b"uro:buildingIDAttribute/uro:BuildingIDAttribute")]
pub building_id_attribute: Option<uro::BuildingIDAttribute>,
pub building_id_attribute: Vec<uro::BuildingIDAttribute>,

#[citygml(path = b"uro:ifcBuildingAttribute")]
pub ifc_building_attribute: Vec<uro::IfcAttributeProperty>, // -> uro:IfcAttribute

#[citygml(path = b"uro:indoorBuildingAttribute")]
pub indoor_building_attribute: Vec<uro::IndoorAttributeProperty>, // -> uro:IndoorAttribute

#[citygml(path = b"uro:keyValuePairAttribute/uro:KeyValuePairAttribute")]
pub key_value_pair_attribute: Vec<uro::KeyValuePairAttribute>,

#[citygml(path = b"uro:largeCustomerFacilityAttribute/uro:LargeCustomerFacilityAttribute")]
pub large_customer_facility_attribute: Vec<uro::LargeCustomerFacilityAttribute>,
}
Expand Down Expand Up @@ -151,6 +156,14 @@ pub struct BuildingPart {
#[citygml(path = b"bldg:address/core:Address")]
pub address: Vec<Address>,

#[citygml(path = b"uro:buildingDataQualityAttribute/uro:BuildingDataQualityAttribute")]
#[citygml(path = b"uro:bldgDataQualityAttribute/uro:DataQualityAttribute")]
pub bldg_data_quality_attribute: Option<uro::DataQualityAttribute>,

#[citygml(path = b"uro:buildingDisasterRiskAttribute")]
#[citygml(path = b"uro:bldgDisasterRiskAttribute")]
pub bldg_disaster_risk_attribute: Vec<uro::DisasterRiskAttributeProperty>, // -> uro:DisasterRiskAttribute

#[citygml(path = b"uro:bldgDmAttribute")]
pub bldg_dm_attribute: Vec<uro::DmAttributeProperty>, // -> uro:DmAttribute

Expand All @@ -163,30 +176,28 @@ pub struct BuildingPart {
#[citygml(path = b"uro:bldgFacilityTypeAttribute/uro:FacilityTypeAttribute")]
pub bldg_facility_type_attribute: Vec<uro::FacilityTypeAttribute>,

#[citygml(path = b"uro:keyValuePairAttribute/uro:KeyValuePairAttribute")]
#[citygml(path = b"uro:bldgKeyValuePairAttribute/uro:KeyValuePairAttribute")]
pub bldg_key_value_pair_attribute: Vec<uro::KeyValuePairAttribute>,

#[citygml(path = b"uro:bldgRealEstateIDAttribute/uro:RealEstateIDAttribute")]
pub bldg_real_estate_id_attribute: Option<uro::RealEstateIDAttribute>,

#[citygml(path = b"uro:buildingDataQualityAttribute/uro:BuildingDataQualityAttribute")]
pub building_data_quality_attribute: Option<uro::BuildingDataQualityAttribute>,
#[citygml(path = b"uro:bldgUsecaseAttribute/uro:BuildingUsecaseAttribute")]
pub bldg_usecase_attribute: Vec<uro::BuildingUsecaseAttribute>,

#[citygml(path = b"uro:buildingDetailAttribute/uro:BuildingDetailAttribute")]
pub building_detail_attribute: Vec<uro::BuildingDetailAttribute>,

#[citygml(path = b"uro:buildingDisasterRiskAttribute")]
pub building_disaster_risk_attribute: Vec<uro::BuildingDisasterRiskAttributeProperty>, // -> uro:BuildingDisasterRiskAttribute

#[citygml(path = b"uro:buildingIDAttribute/uro:BuildingIDAttribute")]
pub building_id_attribute: Option<uro::BuildingIDAttribute>,
pub building_id_attribute: Vec<uro::BuildingIDAttribute>,

#[citygml(path = b"uro:ifcBuildingAttribute")]
pub ifc_building_attribute: Vec<uro::IfcAttributeProperty>, // -> uro:IfcAttribute

#[citygml(path = b"uro:indoorBuildingAttribute")]
pub indoor_building_attribute: Vec<uro::IndoorAttributeProperty>, // -> uro:IndoorAttribute

#[citygml(path = b"uro:keyValuePairAttribute/uro:KeyValuePairAttribute")]
pub key_value_pair_attribute: Vec<uro::KeyValuePairAttribute>,

#[citygml(path = b"uro:largeCustomerFacilityAttribute/uro:LargeCustomerFacilityAttribute")]
pub large_customer_facility_attribute: Vec<uro::LargeCustomerFacilityAttribute>,
}
Expand Down Expand Up @@ -364,9 +375,6 @@ pub struct Room {

#[citygml(path = b"uro:indoorRoomAttribute")]
pub indoor_room_attribute: Vec<uro::IndoorAttributeProperty>, // -> uro:IndoorAttribute

#[citygml(path = b"uro:roomDataQualityAttribute/uro:RoomDataQualityAttribute")]
pub room_data_quality_attribute: Option<uro::RoomDataQualityAttribute>,
}

#[citygml_feature(name = "bldg:BuildingInstallation")]
Expand All @@ -387,25 +395,6 @@ pub struct BuildingInstallation {
pub ifc_building_installation_attribute: Vec<uro::IfcAttributeProperty>, // -> uro:IfcAttribute
}

// Intentionally not used to facilitate transition to CityGML 3.0.
// #[citygml_feature(name = "bldg:BuildingInstallation")]
// pub struct BuildingInstallation {
// #[citygml(path = b"bldg:class")]
// pub class: Option<Code>,
//
// #[citygml(path = b"bldg:function")]
// pub function: Vec<Code>,
//
// #[citygml(path = b"bldg:usage")]
// pub usage: Vec<Code>,
//
// #[citygml(path = b"bldg:boundedBy")]
// pub bounded_by: Vec<BoundarySurfaceProperty>, // -> bldg:_BoundarySurface
//
// #[citygml(path = b"uro:ifcBuildingInstallationAttribute")]
// pub ifc_building_installation_attribute: Vec<uro::IfcAttributeProperty>, // -> uro:IfcAttribute
// }

#[citygml_feature(name = "bldg:BuildingFurniture")]
pub struct BuildingFurniture {
#[citygml(path = b"bldg:class")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ pub struct CityFurniture {
#[citygml(path = b"frn:usage")]
pub usage: Vec<Code>,

#[citygml(path = b"uro:cityFurnitureDetailAttribute/uro:CityFurnitureDetailAttribute")]
pub city_furniture_detail_attribute: Vec<uro::CityFurnitureDetailAttribute>,

#[citygml(
path = b"uro:cityFurnitureDataQualityAttribute/uro:CityFurnitureDataQualityAttribute"
)]
pub city_furniture_data_quality_attribute: Option<uro::CityFurnitureDataQualityAttribute>,

#[citygml(path = b"uro:cityFurnitureDetailAttribute/uro:CityFurnitureDetailAttribute")]
pub city_furniture_detail_attribute: Vec<uro::CityFurnitureDetailAttribute>,
#[citygml(path = b"uro:frnDataQualityAttribute/uro:DataQualityAttribute")]
pub frn_data_quality_attribute: Option<uro::DataQualityAttribute>,

#[citygml(path = b"uro:frnDmAttribute")]
pub frn_dm_attribute: Vec<uro::DmAttributeProperty>, // -> uro:DmAttribute
Expand All @@ -32,4 +33,7 @@ pub struct CityFurniture {

#[citygml(path = b"uro:frnFacilityTypeAttribute/uro:FacilityTypeAttribute")]
pub frn_facility_type_attribute: Vec<uro::FacilityTypeAttribute>,

#[citygml(path = b"uro:frnKeyValuePairAttribute/uro:KeyValuePairAttribute")]
pub frn_key_value_pair_attribute: Vec<uro::KeyValuePairAttribute>,
}
Loading