ifc_lite_landxml/
plan.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5//! COGO and plan-source semantics kept separate from terrain ingestion.
6//!
7//! This is intentionally a native semantic seam.  #5084 owns the durable
8//! terrain document and a later adapter may combine both documents without
9//! treating a plan record as IFC or renderer geometry.
10
11mod model;
12mod numeric;
13pub(crate) mod parser;
14
15pub use model::{
16    LandXmlCgPoint, LandXmlGeometryKind, LandXmlMonument, LandXmlParcel, LandXmlParcelProbe,
17    LandXmlParcelState, LandXmlPlanDocument, LandXmlPlanFeature, LandXmlPlanGeometry,
18    LandXmlPlanPoint, LandXmlPlanPointLocation, LandXmlPlanSourceBatch,
19};
20pub use numeric::references::LandXmlPlanResolver;
21pub use parser::{parse_landxml_plan, parse_landxml_plan_with_cancel, LandXmlPlanLimits};
22
23/// The durable LandXML source document joins terrain and plan semantics from
24/// the same original byte stream. It deliberately does not create IFC or a
25/// renderer-specific representation; the canonical loader owns that step.
26#[derive(Clone, Debug, serde::Deserialize, PartialEq, serde::Serialize)]
27pub struct LandXmlDocument {
28    #[serde(flatten)]
29    pub terrain: crate::LandXmlTinDocument,
30    pub plan: LandXmlPlanDocument,
31}
32
33/// Parse all supported LandXML semantic families from one source buffer.
34pub fn parse_landxml_document(
35    input: &[u8],
36) -> std::result::Result<LandXmlDocument, crate::LandXmlError> {
37    Ok(LandXmlDocument {
38        terrain: crate::parser::parse_landxml_document(input)?,
39        plan: parse_landxml_plan(input)?,
40    })
41}