#![allow(clippy::all, dead_code, unused)]
use cimdecoder::CimDataset;
use crate::Violation;
use crate::helpers::*;
pub fn validate_p61968_13_geographicallocation_ap_con_complex_shacl(dataset: &CimDataset) -> Vec<Violation> {
let mut v = Vec::new();
v.extend(check_p61968_13_geographicallocation_ap_con_complex_shacl_coordinate_system_coordinate_system_crs_etc(dataset));
v
}
pub fn check_p61968_13_geographicallocation_ap_con_complex_shacl_coordinate_system_coordinate_system_crs_etc(dataset: &CimDataset) -> Vec<Violation> {
let mut violations = Vec::new();
for mrid in dataset.by_type.get("CoordinateSystem").into_iter().flatten() {
let entry = &dataset.entries[mrid];
let obj = match entry.element.as_any()
.downcast_ref::<cimstructs::CoordinateSystem>() {
Some(o) => o, None => continue,
};
if obj.crs_urn.is_empty() { continue; }
if obj.crs_urn != "urn:ogc:def:crs:EPSG::4326" {
violations.push(Violation {
object_id: mrid.clone(),
rule_id: "gl13:CoordinateSystem.crsUrn-epsg".to_string(),
class: "CoordinateSystem".to_string(),
property: "CoordinateSystem.crsUrn".to_string(),
message: "The value is different from the default value: urn:ogc:def:crs:EPSG::4326.".to_string(),
severity: "sh:Info".to_string(),
name: "C:13:GL:CoordinateSystem.crsUrn:epsg".to_string(),
description: "CoordinateSystem.crsUrn: If not specified elsewhere, the CoordinateSystem.crsUrn uses WGS84 (latitude, longitude), i.e. urn:ogc:def:crs:EPSG::4326.".to_string(),
});
}
}
violations
}