#[allow(unused_imports)]
use super::{common as com, common_extension as comx, location_extension as locx, situation as sit, road_traffic_data as roa, vms, parking as prk, energy_infrastructure as egi, afir_energy_infrastructure as aegi, facilities as fac, afir_facilities as afac, traffic_regulation as tro, controlled_zone as cz, traffic_management_plan as tmp, rerouting_management_enhanced as rer, urban_extensions as ubx, fault_and_status as fst};
#[allow(unused_imports)]
use crate::out::{Out, Pattern};
#[allow(unused_imports)]
use crate::xml::{Enumeration, Xml};
#[allow(unused_imports)]
use crate::{Date, DateTime, Decimal, Error, Extension, MultilingualString, Time};
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AlertCDirectionEnum {
Negative,
Positive,
Extended(String),
}
impl AlertCDirectionEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Negative => "negative",
Self::Positive => "positive",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AlertCDirectionEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"negative" => Some(Self::Negative),
"positive" => Some(Self::Positive),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AlertCDirectionEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type AlertCLocationCode = com::NonNegativeInteger;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AltitudeAccuracyEnum {
EqualToOrLessThan1Centimetre,
EqualToOrLessThan2Centimetres,
EqualToOrLessThan5Centimetres,
EqualToOrLessThan10Centimetres,
EqualToOrLessThan20Centimetres,
EqualToOrLessThan50Centimetres,
EqualToOrLessThan1Metre,
EqualToOrLessThan2Metres,
EqualToOrLessThan5Metres,
EqualToOrLessThan10Metres,
EqualToOrLessThan20Metres,
EqualToOrLessThan50Metres,
EqualToOrLessThan100Metres,
EqualToOrLessThan200Metres,
Extended(String),
}
impl AltitudeAccuracyEnum {
pub fn as_str(&self) -> &str {
match self {
Self::EqualToOrLessThan1Centimetre => "equalToOrLessThan1Centimetre",
Self::EqualToOrLessThan2Centimetres => "equalToOrLessThan2Centimetres",
Self::EqualToOrLessThan5Centimetres => "equalToOrLessThan5Centimetres",
Self::EqualToOrLessThan10Centimetres => "equalToOrLessThan10Centimetres",
Self::EqualToOrLessThan20Centimetres => "equalToOrLessThan20Centimetres",
Self::EqualToOrLessThan50Centimetres => "equalToOrLessThan50Centimetres",
Self::EqualToOrLessThan1Metre => "equalToOrLessThan1Metre",
Self::EqualToOrLessThan2Metres => "equalToOrLessThan2Metres",
Self::EqualToOrLessThan5Metres => "equalToOrLessThan5Metres",
Self::EqualToOrLessThan10Metres => "equalToOrLessThan10Metres",
Self::EqualToOrLessThan20Metres => "equalToOrLessThan20Metres",
Self::EqualToOrLessThan50Metres => "equalToOrLessThan50Metres",
Self::EqualToOrLessThan100Metres => "equalToOrLessThan100Metres",
Self::EqualToOrLessThan200Metres => "equalToOrLessThan200Metres",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AltitudeAccuracyEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"equalToOrLessThan1Centimetre" => Some(Self::EqualToOrLessThan1Centimetre),
"equalToOrLessThan2Centimetres" => Some(Self::EqualToOrLessThan2Centimetres),
"equalToOrLessThan5Centimetres" => Some(Self::EqualToOrLessThan5Centimetres),
"equalToOrLessThan10Centimetres" => Some(Self::EqualToOrLessThan10Centimetres),
"equalToOrLessThan20Centimetres" => Some(Self::EqualToOrLessThan20Centimetres),
"equalToOrLessThan50Centimetres" => Some(Self::EqualToOrLessThan50Centimetres),
"equalToOrLessThan1Metre" => Some(Self::EqualToOrLessThan1Metre),
"equalToOrLessThan2Metres" => Some(Self::EqualToOrLessThan2Metres),
"equalToOrLessThan5Metres" => Some(Self::EqualToOrLessThan5Metres),
"equalToOrLessThan10Metres" => Some(Self::EqualToOrLessThan10Metres),
"equalToOrLessThan20Metres" => Some(Self::EqualToOrLessThan20Metres),
"equalToOrLessThan50Metres" => Some(Self::EqualToOrLessThan50Metres),
"equalToOrLessThan100Metres" => Some(Self::EqualToOrLessThan100Metres),
"equalToOrLessThan200Metres" => Some(Self::EqualToOrLessThan200Metres),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AltitudeAccuracyEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AreaPlacesEnum {
AtBorders,
AtHighAltitudes,
InBuiltUpAreas,
InForestedAreas,
InGalleries,
InLowLyingAreas,
InRuralAreas,
InShadedAreas,
InTheInnerCityAreas,
InTunnels,
OnBridges,
OnDownhillSections,
OnElevatedSections,
OnEnteringOrLeavingTunnels,
OnFlyovers,
OnPasses,
OnUndergroundSections,
OnUnderpasses,
Extended(String),
}
impl AreaPlacesEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AtBorders => "atBorders",
Self::AtHighAltitudes => "atHighAltitudes",
Self::InBuiltUpAreas => "inBuiltUpAreas",
Self::InForestedAreas => "inForestedAreas",
Self::InGalleries => "inGalleries",
Self::InLowLyingAreas => "inLowLyingAreas",
Self::InRuralAreas => "inRuralAreas",
Self::InShadedAreas => "inShadedAreas",
Self::InTheInnerCityAreas => "inTheInnerCityAreas",
Self::InTunnels => "inTunnels",
Self::OnBridges => "onBridges",
Self::OnDownhillSections => "onDownhillSections",
Self::OnElevatedSections => "onElevatedSections",
Self::OnEnteringOrLeavingTunnels => "onEnteringOrLeavingTunnels",
Self::OnFlyovers => "onFlyovers",
Self::OnPasses => "onPasses",
Self::OnUndergroundSections => "onUndergroundSections",
Self::OnUnderpasses => "onUnderpasses",
Self::Extended(v) => v,
}
}
}
impl Enumeration for AreaPlacesEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"atBorders" => Some(Self::AtBorders),
"atHighAltitudes" => Some(Self::AtHighAltitudes),
"inBuiltUpAreas" => Some(Self::InBuiltUpAreas),
"inForestedAreas" => Some(Self::InForestedAreas),
"inGalleries" => Some(Self::InGalleries),
"inLowLyingAreas" => Some(Self::InLowLyingAreas),
"inRuralAreas" => Some(Self::InRuralAreas),
"inShadedAreas" => Some(Self::InShadedAreas),
"inTheInnerCityAreas" => Some(Self::InTheInnerCityAreas),
"inTunnels" => Some(Self::InTunnels),
"onBridges" => Some(Self::OnBridges),
"onDownhillSections" => Some(Self::OnDownhillSections),
"onElevatedSections" => Some(Self::OnElevatedSections),
"onEnteringOrLeavingTunnels" => Some(Self::OnEnteringOrLeavingTunnels),
"onFlyovers" => Some(Self::OnFlyovers),
"onPasses" => Some(Self::OnPasses),
"onUndergroundSections" => Some(Self::OnUndergroundSections),
"onUnderpasses" => Some(Self::OnUnderpasses),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl AreaPlacesEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum CarriagewayEnum {
ConnectingCarriageway,
CycleTrack,
EntrySlipRoad,
ExitSlipRoad,
Flyover,
Footpath,
LeftHandFeederRoad,
LeftHandParallelCarriageway,
MainCarriageway,
OppositeCarriageway,
ParallelCarriageway,
RightHandFeederRoad,
RightHandParallelCarriageway,
Roundabout,
ServiceRoad,
SlipRoads,
Underpass,
UnspecifiedCarriageway,
Extended(String),
}
impl CarriagewayEnum {
pub fn as_str(&self) -> &str {
match self {
Self::ConnectingCarriageway => "connectingCarriageway",
Self::CycleTrack => "cycleTrack",
Self::EntrySlipRoad => "entrySlipRoad",
Self::ExitSlipRoad => "exitSlipRoad",
Self::Flyover => "flyover",
Self::Footpath => "footpath",
Self::LeftHandFeederRoad => "leftHandFeederRoad",
Self::LeftHandParallelCarriageway => "leftHandParallelCarriageway",
Self::MainCarriageway => "mainCarriageway",
Self::OppositeCarriageway => "oppositeCarriageway",
Self::ParallelCarriageway => "parallelCarriageway",
Self::RightHandFeederRoad => "rightHandFeederRoad",
Self::RightHandParallelCarriageway => "rightHandParallelCarriageway",
Self::Roundabout => "roundabout",
Self::ServiceRoad => "serviceRoad",
Self::SlipRoads => "slipRoads",
Self::Underpass => "underpass",
Self::UnspecifiedCarriageway => "unspecifiedCarriageway",
Self::Extended(v) => v,
}
}
}
impl Enumeration for CarriagewayEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"connectingCarriageway" => Some(Self::ConnectingCarriageway),
"cycleTrack" => Some(Self::CycleTrack),
"entrySlipRoad" => Some(Self::EntrySlipRoad),
"exitSlipRoad" => Some(Self::ExitSlipRoad),
"flyover" => Some(Self::Flyover),
"footpath" => Some(Self::Footpath),
"leftHandFeederRoad" => Some(Self::LeftHandFeederRoad),
"leftHandParallelCarriageway" => Some(Self::LeftHandParallelCarriageway),
"mainCarriageway" => Some(Self::MainCarriageway),
"oppositeCarriageway" => Some(Self::OppositeCarriageway),
"parallelCarriageway" => Some(Self::ParallelCarriageway),
"rightHandFeederRoad" => Some(Self::RightHandFeederRoad),
"rightHandParallelCarriageway" => Some(Self::RightHandParallelCarriageway),
"roundabout" => Some(Self::Roundabout),
"serviceRoad" => Some(Self::ServiceRoad),
"slipRoads" => Some(Self::SlipRoads),
"underpass" => Some(Self::Underpass),
"unspecifiedCarriageway" => Some(Self::UnspecifiedCarriageway),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl CarriagewayEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DirectionEnum {
Aligned,
AllDirections,
Anticlockwise,
BothWays,
Clockwise,
InnerRing,
OuterRing,
EastBound,
NorthBound,
NorthEastBound,
NorthWestBound,
SouthBound,
SouthEastBound,
SouthWestBound,
WestBound,
InboundTowardsTown,
OutboundFromTown,
Opposite,
Unknown,
Other,
Extended(String),
}
impl DirectionEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Aligned => "aligned",
Self::AllDirections => "allDirections",
Self::Anticlockwise => "anticlockwise",
Self::BothWays => "bothWays",
Self::Clockwise => "clockwise",
Self::InnerRing => "innerRing",
Self::OuterRing => "outerRing",
Self::EastBound => "eastBound",
Self::NorthBound => "northBound",
Self::NorthEastBound => "northEastBound",
Self::NorthWestBound => "northWestBound",
Self::SouthBound => "southBound",
Self::SouthEastBound => "southEastBound",
Self::SouthWestBound => "southWestBound",
Self::WestBound => "westBound",
Self::InboundTowardsTown => "inboundTowardsTown",
Self::OutboundFromTown => "outboundFromTown",
Self::Opposite => "opposite",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DirectionEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"aligned" => Some(Self::Aligned),
"allDirections" => Some(Self::AllDirections),
"anticlockwise" => Some(Self::Anticlockwise),
"bothWays" => Some(Self::BothWays),
"clockwise" => Some(Self::Clockwise),
"innerRing" => Some(Self::InnerRing),
"outerRing" => Some(Self::OuterRing),
"eastBound" => Some(Self::EastBound),
"northBound" => Some(Self::NorthBound),
"northEastBound" => Some(Self::NorthEastBound),
"northWestBound" => Some(Self::NorthWestBound),
"southBound" => Some(Self::SouthBound),
"southEastBound" => Some(Self::SouthEastBound),
"southWestBound" => Some(Self::SouthWestBound),
"westBound" => Some(Self::WestBound),
"inboundTowardsTown" => Some(Self::InboundTowardsTown),
"outboundFromTown" => Some(Self::OutboundFromTown),
"opposite" => Some(Self::Opposite),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DirectionEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum DirectionPurposeEnum {
Inbound,
Outbound,
Extended(String),
}
impl DirectionPurposeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Inbound => "inbound",
Self::Outbound => "outbound",
Self::Extended(v) => v,
}
}
}
impl Enumeration for DirectionPurposeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"inbound" => Some(Self::Inbound),
"outbound" => Some(Self::Outbound),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl DirectionPurposeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum GeographicCharacteristicEnum {
AroundABendInRoad,
OnBorder,
OnPass,
OverCrestOfHill,
Extended(String),
}
impl GeographicCharacteristicEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AroundABendInRoad => "aroundABendInRoad",
Self::OnBorder => "onBorder",
Self::OnPass => "onPass",
Self::OverCrestOfHill => "overCrestOfHill",
Self::Extended(v) => v,
}
}
}
impl Enumeration for GeographicCharacteristicEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"aroundABendInRoad" => Some(Self::AroundABendInRoad),
"onBorder" => Some(Self::OnBorder),
"onPass" => Some(Self::OnPass),
"overCrestOfHill" => Some(Self::OverCrestOfHill),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl GeographicCharacteristicEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type GmlPosList = com::LongString;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum HeightGradeEnum {
AboveGrade,
AtGrade,
BelowGrade,
Extended(String),
}
impl HeightGradeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AboveGrade => "aboveGrade",
Self::AtGrade => "atGrade",
Self::BelowGrade => "belowGrade",
Self::Extended(v) => v,
}
}
}
impl Enumeration for HeightGradeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"aboveGrade" => Some(Self::AboveGrade),
"atGrade" => Some(Self::AtGrade),
"belowGrade" => Some(Self::BelowGrade),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl HeightGradeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum HeightTypeEnum {
EllipsoidalHeight,
GravityRelatedHeight,
RelativeHeight,
Extended(String),
}
impl HeightTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::EllipsoidalHeight => "ellipsoidalHeight",
Self::GravityRelatedHeight => "gravityRelatedHeight",
Self::RelativeHeight => "relativeHeight",
Self::Extended(v) => v,
}
}
}
impl Enumeration for HeightTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"ellipsoidalHeight" => Some(Self::EllipsoidalHeight),
"gravityRelatedHeight" => Some(Self::GravityRelatedHeight),
"relativeHeight" => Some(Self::RelativeHeight),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl HeightTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum InfrastructureDescriptorEnum {
AtMotorwayInterchange,
AtRestArea,
AtServiceArea,
AtTollPlaza,
AtTunnelEntryOrExit,
InGallery,
InTunnel,
OnBridge,
OnConnector,
OnElevatedSection,
OnFlyover,
OnIceRoad,
OnLevelCrossing,
OnLinkRoad,
OnRoundabout,
OnTheRoadway,
OnUndergroundSection,
OnUnderpass,
WithinJunction,
Extended(String),
}
impl InfrastructureDescriptorEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AtMotorwayInterchange => "atMotorwayInterchange",
Self::AtRestArea => "atRestArea",
Self::AtServiceArea => "atServiceArea",
Self::AtTollPlaza => "atTollPlaza",
Self::AtTunnelEntryOrExit => "atTunnelEntryOrExit",
Self::InGallery => "inGallery",
Self::InTunnel => "inTunnel",
Self::OnBridge => "onBridge",
Self::OnConnector => "onConnector",
Self::OnElevatedSection => "onElevatedSection",
Self::OnFlyover => "onFlyover",
Self::OnIceRoad => "onIceRoad",
Self::OnLevelCrossing => "onLevelCrossing",
Self::OnLinkRoad => "onLinkRoad",
Self::OnRoundabout => "onRoundabout",
Self::OnTheRoadway => "onTheRoadway",
Self::OnUndergroundSection => "onUndergroundSection",
Self::OnUnderpass => "onUnderpass",
Self::WithinJunction => "withinJunction",
Self::Extended(v) => v,
}
}
}
impl Enumeration for InfrastructureDescriptorEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"atMotorwayInterchange" => Some(Self::AtMotorwayInterchange),
"atRestArea" => Some(Self::AtRestArea),
"atServiceArea" => Some(Self::AtServiceArea),
"atTollPlaza" => Some(Self::AtTollPlaza),
"atTunnelEntryOrExit" => Some(Self::AtTunnelEntryOrExit),
"inGallery" => Some(Self::InGallery),
"inTunnel" => Some(Self::InTunnel),
"onBridge" => Some(Self::OnBridge),
"onConnector" => Some(Self::OnConnector),
"onElevatedSection" => Some(Self::OnElevatedSection),
"onFlyover" => Some(Self::OnFlyover),
"onIceRoad" => Some(Self::OnIceRoad),
"onLevelCrossing" => Some(Self::OnLevelCrossing),
"onLinkRoad" => Some(Self::OnLinkRoad),
"onRoundabout" => Some(Self::OnRoundabout),
"onTheRoadway" => Some(Self::OnTheRoadway),
"onUndergroundSection" => Some(Self::OnUndergroundSection),
"onUnderpass" => Some(Self::OnUnderpass),
"withinJunction" => Some(Self::WithinJunction),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl InfrastructureDescriptorEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum LaneEnum {
AllLanesCompleteCarriageway,
BusLane,
BusStop,
CarPoolLane,
CentralReservation,
CrawlerLane,
CycleLane,
EmergencyLane,
EscapeLane,
ExpressLane,
HardShoulder,
HeavyVehicleLane,
LayBy,
LeftHandTurningLane,
LeftLane,
LocalTrafficLane,
MiddleLane,
OvertakingLane,
RightHandTurningLane,
RightLane,
RushHourLane,
SetDownArea,
SlowVehicleLane,
ThroughTrafficLane,
TidalFlowLane,
TurningLane,
Verge,
Extended(String),
}
impl LaneEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AllLanesCompleteCarriageway => "allLanesCompleteCarriageway",
Self::BusLane => "busLane",
Self::BusStop => "busStop",
Self::CarPoolLane => "carPoolLane",
Self::CentralReservation => "centralReservation",
Self::CrawlerLane => "crawlerLane",
Self::CycleLane => "cycleLane",
Self::EmergencyLane => "emergencyLane",
Self::EscapeLane => "escapeLane",
Self::ExpressLane => "expressLane",
Self::HardShoulder => "hardShoulder",
Self::HeavyVehicleLane => "heavyVehicleLane",
Self::LayBy => "layBy",
Self::LeftHandTurningLane => "leftHandTurningLane",
Self::LeftLane => "leftLane",
Self::LocalTrafficLane => "localTrafficLane",
Self::MiddleLane => "middleLane",
Self::OvertakingLane => "overtakingLane",
Self::RightHandTurningLane => "rightHandTurningLane",
Self::RightLane => "rightLane",
Self::RushHourLane => "rushHourLane",
Self::SetDownArea => "setDownArea",
Self::SlowVehicleLane => "slowVehicleLane",
Self::ThroughTrafficLane => "throughTrafficLane",
Self::TidalFlowLane => "tidalFlowLane",
Self::TurningLane => "turningLane",
Self::Verge => "verge",
Self::Extended(v) => v,
}
}
}
impl Enumeration for LaneEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"allLanesCompleteCarriageway" => Some(Self::AllLanesCompleteCarriageway),
"busLane" => Some(Self::BusLane),
"busStop" => Some(Self::BusStop),
"carPoolLane" => Some(Self::CarPoolLane),
"centralReservation" => Some(Self::CentralReservation),
"crawlerLane" => Some(Self::CrawlerLane),
"cycleLane" => Some(Self::CycleLane),
"emergencyLane" => Some(Self::EmergencyLane),
"escapeLane" => Some(Self::EscapeLane),
"expressLane" => Some(Self::ExpressLane),
"hardShoulder" => Some(Self::HardShoulder),
"heavyVehicleLane" => Some(Self::HeavyVehicleLane),
"layBy" => Some(Self::LayBy),
"leftHandTurningLane" => Some(Self::LeftHandTurningLane),
"leftLane" => Some(Self::LeftLane),
"localTrafficLane" => Some(Self::LocalTrafficLane),
"middleLane" => Some(Self::MiddleLane),
"overtakingLane" => Some(Self::OvertakingLane),
"rightHandTurningLane" => Some(Self::RightHandTurningLane),
"rightLane" => Some(Self::RightLane),
"rushHourLane" => Some(Self::RushHourLane),
"setDownArea" => Some(Self::SetDownArea),
"slowVehicleLane" => Some(Self::SlowVehicleLane),
"throughTrafficLane" => Some(Self::ThroughTrafficLane),
"tidalFlowLane" => Some(Self::TidalFlowLane),
"turningLane" => Some(Self::TurningLane),
"verge" => Some(Self::Verge),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl LaneEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum LinearDirectionEnum {
Both,
Opposite,
Aligned,
Unknown,
Extended(String),
}
impl LinearDirectionEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Both => "both",
Self::Opposite => "opposite",
Self::Aligned => "aligned",
Self::Unknown => "unknown",
Self::Extended(v) => v,
}
}
}
impl Enumeration for LinearDirectionEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"both" => Some(Self::Both),
"opposite" => Some(Self::Opposite),
"aligned" => Some(Self::Aligned),
"unknown" => Some(Self::Unknown),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl LinearDirectionEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum LinearElementNatureEnum {
Road,
RoadSection,
SlipRoad,
Other,
Extended(String),
}
impl LinearElementNatureEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Road => "road",
Self::RoadSection => "roadSection",
Self::SlipRoad => "slipRoad",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for LinearElementNatureEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"road" => Some(Self::Road),
"roadSection" => Some(Self::RoadSection),
"slipRoad" => Some(Self::SlipRoad),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl LinearElementNatureEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum NamedAreaTypeEnum {
ApplicationRegion,
Continent,
Country,
CountryGroup,
CarParkArea,
CarpoolArea,
FuzzyArea,
IndustrialArea,
Lake,
MeteorologicalArea,
MetropolitanArea,
Municipality,
ParkAndRideSite,
RuralCounty,
Sea,
TouristArea,
TrafficArea,
UrbanCounty,
Order1AdministrativeArea,
Order2AdministrativeArea,
Order3AdministrativeArea,
Order4AdministrativeArea,
Order5AdministrativeArea,
PoliceForceControlArea,
RoadOperatorControlArea,
WaterArea,
Extended(String),
}
impl NamedAreaTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::ApplicationRegion => "applicationRegion",
Self::Continent => "continent",
Self::Country => "country",
Self::CountryGroup => "countryGroup",
Self::CarParkArea => "carParkArea",
Self::CarpoolArea => "carpoolArea",
Self::FuzzyArea => "fuzzyArea",
Self::IndustrialArea => "industrialArea",
Self::Lake => "lake",
Self::MeteorologicalArea => "meteorologicalArea",
Self::MetropolitanArea => "metropolitanArea",
Self::Municipality => "municipality",
Self::ParkAndRideSite => "parkAndRideSite",
Self::RuralCounty => "ruralCounty",
Self::Sea => "sea",
Self::TouristArea => "touristArea",
Self::TrafficArea => "trafficArea",
Self::UrbanCounty => "urbanCounty",
Self::Order1AdministrativeArea => "order1AdministrativeArea",
Self::Order2AdministrativeArea => "order2AdministrativeArea",
Self::Order3AdministrativeArea => "order3AdministrativeArea",
Self::Order4AdministrativeArea => "order4AdministrativeArea",
Self::Order5AdministrativeArea => "order5AdministrativeArea",
Self::PoliceForceControlArea => "policeForceControlArea",
Self::RoadOperatorControlArea => "roadOperatorControlArea",
Self::WaterArea => "waterArea",
Self::Extended(v) => v,
}
}
}
impl Enumeration for NamedAreaTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"applicationRegion" => Some(Self::ApplicationRegion),
"continent" => Some(Self::Continent),
"country" => Some(Self::Country),
"countryGroup" => Some(Self::CountryGroup),
"carParkArea" => Some(Self::CarParkArea),
"carpoolArea" => Some(Self::CarpoolArea),
"fuzzyArea" => Some(Self::FuzzyArea),
"industrialArea" => Some(Self::IndustrialArea),
"lake" => Some(Self::Lake),
"meteorologicalArea" => Some(Self::MeteorologicalArea),
"metropolitanArea" => Some(Self::MetropolitanArea),
"municipality" => Some(Self::Municipality),
"parkAndRideSite" => Some(Self::ParkAndRideSite),
"ruralCounty" => Some(Self::RuralCounty),
"sea" => Some(Self::Sea),
"touristArea" => Some(Self::TouristArea),
"trafficArea" => Some(Self::TrafficArea),
"urbanCounty" => Some(Self::UrbanCounty),
"order1AdministrativeArea" => Some(Self::Order1AdministrativeArea),
"order2AdministrativeArea" => Some(Self::Order2AdministrativeArea),
"order3AdministrativeArea" => Some(Self::Order3AdministrativeArea),
"order4AdministrativeArea" => Some(Self::Order4AdministrativeArea),
"order5AdministrativeArea" => Some(Self::Order5AdministrativeArea),
"policeForceControlArea" => Some(Self::PoliceForceControlArea),
"roadOperatorControlArea" => Some(Self::RoadOperatorControlArea),
"waterArea" => Some(Self::WaterArea),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl NamedAreaTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type NutsCode = String;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum NutsCodeTypeEnum {
Nuts1Code,
Nuts2Code,
Nuts3Code,
Lau1Code,
Lau2Code,
Extended(String),
}
impl NutsCodeTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Nuts1Code => "nuts1Code",
Self::Nuts2Code => "nuts2Code",
Self::Nuts3Code => "nuts3Code",
Self::Lau1Code => "lau1Code",
Self::Lau2Code => "lau2Code",
Self::Extended(v) => v,
}
}
}
impl Enumeration for NutsCodeTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"nuts1Code" => Some(Self::Nuts1Code),
"nuts2Code" => Some(Self::Nuts2Code),
"nuts3Code" => Some(Self::Nuts3Code),
"lau1Code" => Some(Self::Lau1Code),
"lau2Code" => Some(Self::Lau2Code),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl NutsCodeTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum OpenlrFormOfWayEnum {
Undefined,
Motorway,
MultipleCarriageway,
SingleCarriageway,
Roundabout,
SlipRoad,
TrafficSquare,
Other,
Extended(String),
}
impl OpenlrFormOfWayEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Undefined => "undefined",
Self::Motorway => "motorway",
Self::MultipleCarriageway => "multipleCarriageway",
Self::SingleCarriageway => "singleCarriageway",
Self::Roundabout => "roundabout",
Self::SlipRoad => "slipRoad",
Self::TrafficSquare => "trafficSquare",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OpenlrFormOfWayEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"undefined" => Some(Self::Undefined),
"motorway" => Some(Self::Motorway),
"multipleCarriageway" => Some(Self::MultipleCarriageway),
"singleCarriageway" => Some(Self::SingleCarriageway),
"roundabout" => Some(Self::Roundabout),
"slipRoad" => Some(Self::SlipRoad),
"trafficSquare" => Some(Self::TrafficSquare),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OpenlrFormOfWayEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum OpenlrFunctionalRoadClassEnum {
Frc0,
Frc1,
Frc2,
Frc3,
Frc4,
Frc5,
Frc6,
Frc7,
Extended(String),
}
impl OpenlrFunctionalRoadClassEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Frc0 => "frc0",
Self::Frc1 => "frc1",
Self::Frc2 => "frc2",
Self::Frc3 => "frc3",
Self::Frc4 => "frc4",
Self::Frc5 => "frc5",
Self::Frc6 => "frc6",
Self::Frc7 => "frc7",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OpenlrFunctionalRoadClassEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"frc0" => Some(Self::Frc0),
"frc1" => Some(Self::Frc1),
"frc2" => Some(Self::Frc2),
"frc3" => Some(Self::Frc3),
"frc4" => Some(Self::Frc4),
"frc5" => Some(Self::Frc5),
"frc6" => Some(Self::Frc6),
"frc7" => Some(Self::Frc7),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OpenlrFunctionalRoadClassEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum OpenlrOrientationEnum {
NoOrientationOrUnknown,
WithLineDirection,
AgainstLineDirection,
Both,
Extended(String),
}
impl OpenlrOrientationEnum {
pub fn as_str(&self) -> &str {
match self {
Self::NoOrientationOrUnknown => "noOrientationOrUnknown",
Self::WithLineDirection => "withLineDirection",
Self::AgainstLineDirection => "againstLineDirection",
Self::Both => "both",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OpenlrOrientationEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"noOrientationOrUnknown" => Some(Self::NoOrientationOrUnknown),
"withLineDirection" => Some(Self::WithLineDirection),
"againstLineDirection" => Some(Self::AgainstLineDirection),
"both" => Some(Self::Both),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OpenlrOrientationEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum OpenlrSideOfRoadEnum {
OnRoadOrUnknown,
Right,
Left,
Both,
Extended(String),
}
impl OpenlrSideOfRoadEnum {
pub fn as_str(&self) -> &str {
match self {
Self::OnRoadOrUnknown => "onRoadOrUnknown",
Self::Right => "right",
Self::Left => "left",
Self::Both => "both",
Self::Extended(v) => v,
}
}
}
impl Enumeration for OpenlrSideOfRoadEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"onRoadOrUnknown" => Some(Self::OnRoadOrUnknown),
"right" => Some(Self::Right),
"left" => Some(Self::Left),
"both" => Some(Self::Both),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl OpenlrSideOfRoadEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum PositionConfidenceCodedErrorEnum {
OutOfRange,
Unavailable,
Extended(String),
}
impl PositionConfidenceCodedErrorEnum {
pub fn as_str(&self) -> &str {
match self {
Self::OutOfRange => "outOfRange",
Self::Unavailable => "unavailable",
Self::Extended(v) => v,
}
}
}
impl Enumeration for PositionConfidenceCodedErrorEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"outOfRange" => Some(Self::OutOfRange),
"unavailable" => Some(Self::Unavailable),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl PositionConfidenceCodedErrorEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ReferentTypeEnum {
Boundary,
Intersection,
ReferenceMarker,
Landmark,
RoadNode,
Extended(String),
}
impl ReferentTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Boundary => "boundary",
Self::Intersection => "intersection",
Self::ReferenceMarker => "referenceMarker",
Self::Landmark => "landmark",
Self::RoadNode => "roadNode",
Self::Extended(v) => v,
}
}
}
impl Enumeration for ReferentTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"boundary" => Some(Self::Boundary),
"intersection" => Some(Self::Intersection),
"referenceMarker" => Some(Self::ReferenceMarker),
"landmark" => Some(Self::Landmark),
"roadNode" => Some(Self::RoadNode),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl ReferentTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum RelativePositionOnCarriagewayEnum {
InTheCentre,
OnTheLeft,
OnTheRight,
Extended(String),
}
impl RelativePositionOnCarriagewayEnum {
pub fn as_str(&self) -> &str {
match self {
Self::InTheCentre => "inTheCentre",
Self::OnTheLeft => "onTheLeft",
Self::OnTheRight => "onTheRight",
Self::Extended(v) => v,
}
}
}
impl Enumeration for RelativePositionOnCarriagewayEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"inTheCentre" => Some(Self::InTheCentre),
"onTheLeft" => Some(Self::OnTheLeft),
"onTheRight" => Some(Self::OnTheRight),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl RelativePositionOnCarriagewayEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
pub type SubdivisionCode = String;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SubdivisionTypeEnum {
AdministrativeAtoll,
AdministrativeRegion,
AdministrativeTerritory,
ArcticRegion,
AutonomousCity,
AutonomousCityInNorthAfrica,
AutonomousCommunity,
AutonomousDistrict,
AutonomousProvince,
AutonomousRegion,
Canton,
CapitalCity,
City,
CityMunicipality,
CityOfCountyRight,
Commune,
CouncilArea,
County,
Country,
Department,
Dependency,
District,
DistrictMunicipality,
DistrictWithSpecialStatus,
Entity,
GeographicalEntity,
Governorate,
Laender,
LocalCouncil,
LondonBorough,
MetropolitanArea,
MetropolitanDepartment,
MetropolitanDistrict,
MetropolitanRegion,
Municipality,
OverseasDepartment,
OverseasRegion,
OverseasTerritorialCollectivity,
Parish,
Province,
Quarter,
Region,
Republic,
RepublicanCity,
SelfGovernedPart,
SpecialMunicipality,
State,
TerritorialUnit,
Territory,
TwoTierCounty,
UnitaryAuthority,
Ward,
Other,
Extended(String),
}
impl SubdivisionTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AdministrativeAtoll => "administrativeAtoll",
Self::AdministrativeRegion => "administrativeRegion",
Self::AdministrativeTerritory => "administrativeTerritory",
Self::ArcticRegion => "arcticRegion",
Self::AutonomousCity => "autonomousCity",
Self::AutonomousCityInNorthAfrica => "autonomousCityInNorthAfrica",
Self::AutonomousCommunity => "autonomousCommunity",
Self::AutonomousDistrict => "autonomousDistrict",
Self::AutonomousProvince => "autonomousProvince",
Self::AutonomousRegion => "autonomousRegion",
Self::Canton => "canton",
Self::CapitalCity => "capitalCity",
Self::City => "city",
Self::CityMunicipality => "cityMunicipality",
Self::CityOfCountyRight => "cityOfCountyRight",
Self::Commune => "commune",
Self::CouncilArea => "councilArea",
Self::County => "county",
Self::Country => "country",
Self::Department => "department",
Self::Dependency => "dependency",
Self::District => "district",
Self::DistrictMunicipality => "districtMunicipality",
Self::DistrictWithSpecialStatus => "districtWithSpecialStatus",
Self::Entity => "entity",
Self::GeographicalEntity => "geographicalEntity",
Self::Governorate => "governorate",
Self::Laender => "laender",
Self::LocalCouncil => "localCouncil",
Self::LondonBorough => "londonBorough",
Self::MetropolitanArea => "metropolitanArea",
Self::MetropolitanDepartment => "metropolitanDepartment",
Self::MetropolitanDistrict => "metropolitanDistrict",
Self::MetropolitanRegion => "metropolitanRegion",
Self::Municipality => "municipality",
Self::OverseasDepartment => "overseasDepartment",
Self::OverseasRegion => "overseasRegion",
Self::OverseasTerritorialCollectivity => "overseasTerritorialCollectivity",
Self::Parish => "parish",
Self::Province => "province",
Self::Quarter => "quarter",
Self::Region => "region",
Self::Republic => "republic",
Self::RepublicanCity => "republicanCity",
Self::SelfGovernedPart => "selfGovernedPart",
Self::SpecialMunicipality => "specialMunicipality",
Self::State => "state",
Self::TerritorialUnit => "territorialUnit",
Self::Territory => "territory",
Self::TwoTierCounty => "twoTierCounty",
Self::UnitaryAuthority => "unitaryAuthority",
Self::Ward => "ward",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for SubdivisionTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"administrativeAtoll" => Some(Self::AdministrativeAtoll),
"administrativeRegion" => Some(Self::AdministrativeRegion),
"administrativeTerritory" => Some(Self::AdministrativeTerritory),
"arcticRegion" => Some(Self::ArcticRegion),
"autonomousCity" => Some(Self::AutonomousCity),
"autonomousCityInNorthAfrica" => Some(Self::AutonomousCityInNorthAfrica),
"autonomousCommunity" => Some(Self::AutonomousCommunity),
"autonomousDistrict" => Some(Self::AutonomousDistrict),
"autonomousProvince" => Some(Self::AutonomousProvince),
"autonomousRegion" => Some(Self::AutonomousRegion),
"canton" => Some(Self::Canton),
"capitalCity" => Some(Self::CapitalCity),
"city" => Some(Self::City),
"cityMunicipality" => Some(Self::CityMunicipality),
"cityOfCountyRight" => Some(Self::CityOfCountyRight),
"commune" => Some(Self::Commune),
"councilArea" => Some(Self::CouncilArea),
"county" => Some(Self::County),
"country" => Some(Self::Country),
"department" => Some(Self::Department),
"dependency" => Some(Self::Dependency),
"district" => Some(Self::District),
"districtMunicipality" => Some(Self::DistrictMunicipality),
"districtWithSpecialStatus" => Some(Self::DistrictWithSpecialStatus),
"entity" => Some(Self::Entity),
"geographicalEntity" => Some(Self::GeographicalEntity),
"governorate" => Some(Self::Governorate),
"laender" => Some(Self::Laender),
"localCouncil" => Some(Self::LocalCouncil),
"londonBorough" => Some(Self::LondonBorough),
"metropolitanArea" => Some(Self::MetropolitanArea),
"metropolitanDepartment" => Some(Self::MetropolitanDepartment),
"metropolitanDistrict" => Some(Self::MetropolitanDistrict),
"metropolitanRegion" => Some(Self::MetropolitanRegion),
"municipality" => Some(Self::Municipality),
"overseasDepartment" => Some(Self::OverseasDepartment),
"overseasRegion" => Some(Self::OverseasRegion),
"overseasTerritorialCollectivity" => Some(Self::OverseasTerritorialCollectivity),
"parish" => Some(Self::Parish),
"province" => Some(Self::Province),
"quarter" => Some(Self::Quarter),
"region" => Some(Self::Region),
"republic" => Some(Self::Republic),
"republicanCity" => Some(Self::RepublicanCity),
"selfGovernedPart" => Some(Self::SelfGovernedPart),
"specialMunicipality" => Some(Self::SpecialMunicipality),
"state" => Some(Self::State),
"territorialUnit" => Some(Self::TerritorialUnit),
"territory" => Some(Self::Territory),
"twoTierCounty" => Some(Self::TwoTierCounty),
"unitaryAuthority" => Some(Self::UnitaryAuthority),
"ward" => Some(Self::Ward),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl SubdivisionTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc01AreaLocationSubtypeEnum {
LargeArea,
Other,
Extended(String),
}
impl TpegLoc01AreaLocationSubtypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::LargeArea => "largeArea",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc01AreaLocationSubtypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"largeArea" => Some(Self::LargeArea),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc01AreaLocationSubtypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc01FramedPointLocationSubtypeEnum {
FramedPoint,
Extended(String),
}
impl TpegLoc01FramedPointLocationSubtypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::FramedPoint => "framedPoint",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc01FramedPointLocationSubtypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"framedPoint" => Some(Self::FramedPoint),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc01FramedPointLocationSubtypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc01LinearLocationSubtypeEnum {
Segment,
Extended(String),
}
impl TpegLoc01LinearLocationSubtypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Segment => "segment",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc01LinearLocationSubtypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"segment" => Some(Self::Segment),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc01LinearLocationSubtypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc01SimplePointLocationSubtypeEnum {
Intersection,
NonLinkedPoint,
Extended(String),
}
impl TpegLoc01SimplePointLocationSubtypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Intersection => "intersection",
Self::NonLinkedPoint => "nonLinkedPoint",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc01SimplePointLocationSubtypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"intersection" => Some(Self::Intersection),
"nonLinkedPoint" => Some(Self::NonLinkedPoint),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc01SimplePointLocationSubtypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc03AreaDescriptorSubtypeEnum {
AdministrativeAreaName,
AdministrativeReferenceName,
AreaName,
CountyName,
LakeName,
NationName,
PoliceForceControlAreaName,
RegionName,
SeaName,
TownName,
Other,
Extended(String),
}
impl TpegLoc03AreaDescriptorSubtypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AdministrativeAreaName => "administrativeAreaName",
Self::AdministrativeReferenceName => "administrativeReferenceName",
Self::AreaName => "areaName",
Self::CountyName => "countyName",
Self::LakeName => "lakeName",
Self::NationName => "nationName",
Self::PoliceForceControlAreaName => "policeForceControlAreaName",
Self::RegionName => "regionName",
Self::SeaName => "seaName",
Self::TownName => "townName",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc03AreaDescriptorSubtypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"administrativeAreaName" => Some(Self::AdministrativeAreaName),
"administrativeReferenceName" => Some(Self::AdministrativeReferenceName),
"areaName" => Some(Self::AreaName),
"countyName" => Some(Self::CountyName),
"lakeName" => Some(Self::LakeName),
"nationName" => Some(Self::NationName),
"policeForceControlAreaName" => Some(Self::PoliceForceControlAreaName),
"regionName" => Some(Self::RegionName),
"seaName" => Some(Self::SeaName),
"townName" => Some(Self::TownName),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc03AreaDescriptorSubtypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc03IlcPointDescriptorSubtypeEnum {
TpegIlcName1,
TpegIlcName2,
TpegIlcName3,
Extended(String),
}
impl TpegLoc03IlcPointDescriptorSubtypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::TpegIlcName1 => "tpegIlcName1",
Self::TpegIlcName2 => "tpegIlcName2",
Self::TpegIlcName3 => "tpegIlcName3",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc03IlcPointDescriptorSubtypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"tpegIlcName1" => Some(Self::TpegIlcName1),
"tpegIlcName2" => Some(Self::TpegIlcName2),
"tpegIlcName3" => Some(Self::TpegIlcName3),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc03IlcPointDescriptorSubtypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc03JunctionPointDescriptorSubtypeEnum {
JunctionName,
Extended(String),
}
impl TpegLoc03JunctionPointDescriptorSubtypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::JunctionName => "junctionName",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc03JunctionPointDescriptorSubtypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"junctionName" => Some(Self::JunctionName),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc03JunctionPointDescriptorSubtypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc03OtherPointDescriptorSubtypeEnum {
AdministrativeAreaName,
AdministrativeReferenceName,
AirportName,
AreaName,
BuildingName,
BusStopIdentifier,
BusStopName,
CanalName,
CountyName,
FerryPortName,
IntersectionName,
LakeName,
LinkName,
LocalLinkName,
MetroStationName,
NationName,
NonLinkedPointName,
ParkingFacilityName,
PointName,
PointOfInterestName,
RailwayStation,
RegionName,
RiverName,
SeaName,
ServiceAreaName,
TidalRiverName,
TownName,
Other,
Extended(String),
}
impl TpegLoc03OtherPointDescriptorSubtypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::AdministrativeAreaName => "administrativeAreaName",
Self::AdministrativeReferenceName => "administrativeReferenceName",
Self::AirportName => "airportName",
Self::AreaName => "areaName",
Self::BuildingName => "buildingName",
Self::BusStopIdentifier => "busStopIdentifier",
Self::BusStopName => "busStopName",
Self::CanalName => "canalName",
Self::CountyName => "countyName",
Self::FerryPortName => "ferryPortName",
Self::IntersectionName => "intersectionName",
Self::LakeName => "lakeName",
Self::LinkName => "linkName",
Self::LocalLinkName => "localLinkName",
Self::MetroStationName => "metroStationName",
Self::NationName => "nationName",
Self::NonLinkedPointName => "nonLinkedPointName",
Self::ParkingFacilityName => "parkingFacilityName",
Self::PointName => "pointName",
Self::PointOfInterestName => "pointOfInterestName",
Self::RailwayStation => "railwayStation",
Self::RegionName => "regionName",
Self::RiverName => "riverName",
Self::SeaName => "seaName",
Self::ServiceAreaName => "serviceAreaName",
Self::TidalRiverName => "tidalRiverName",
Self::TownName => "townName",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc03OtherPointDescriptorSubtypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"administrativeAreaName" => Some(Self::AdministrativeAreaName),
"administrativeReferenceName" => Some(Self::AdministrativeReferenceName),
"airportName" => Some(Self::AirportName),
"areaName" => Some(Self::AreaName),
"buildingName" => Some(Self::BuildingName),
"busStopIdentifier" => Some(Self::BusStopIdentifier),
"busStopName" => Some(Self::BusStopName),
"canalName" => Some(Self::CanalName),
"countyName" => Some(Self::CountyName),
"ferryPortName" => Some(Self::FerryPortName),
"intersectionName" => Some(Self::IntersectionName),
"lakeName" => Some(Self::LakeName),
"linkName" => Some(Self::LinkName),
"localLinkName" => Some(Self::LocalLinkName),
"metroStationName" => Some(Self::MetroStationName),
"nationName" => Some(Self::NationName),
"nonLinkedPointName" => Some(Self::NonLinkedPointName),
"parkingFacilityName" => Some(Self::ParkingFacilityName),
"pointName" => Some(Self::PointName),
"pointOfInterestName" => Some(Self::PointOfInterestName),
"railwayStation" => Some(Self::RailwayStation),
"regionName" => Some(Self::RegionName),
"riverName" => Some(Self::RiverName),
"seaName" => Some(Self::SeaName),
"serviceAreaName" => Some(Self::ServiceAreaName),
"tidalRiverName" => Some(Self::TidalRiverName),
"townName" => Some(Self::TownName),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc03OtherPointDescriptorSubtypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TpegLoc04HeightTypeEnum {
Above,
AboveSeaLevel,
AboveStreetLevel,
At,
AtSeaLevel,
AtStreetLevel,
Below,
BelowSeaLevel,
BelowStreetLevel,
Undefined,
Unknown,
Other,
Extended(String),
}
impl TpegLoc04HeightTypeEnum {
pub fn as_str(&self) -> &str {
match self {
Self::Above => "above",
Self::AboveSeaLevel => "aboveSeaLevel",
Self::AboveStreetLevel => "aboveStreetLevel",
Self::At => "at",
Self::AtSeaLevel => "atSeaLevel",
Self::AtStreetLevel => "atStreetLevel",
Self::Below => "below",
Self::BelowSeaLevel => "belowSeaLevel",
Self::BelowStreetLevel => "belowStreetLevel",
Self::Undefined => "undefined",
Self::Unknown => "unknown",
Self::Other => "other",
Self::Extended(v) => v,
}
}
}
impl Enumeration for TpegLoc04HeightTypeEnum {
fn from_literal(literal: &str) -> Option<Self> {
match literal {
"above" => Some(Self::Above),
"aboveSeaLevel" => Some(Self::AboveSeaLevel),
"aboveStreetLevel" => Some(Self::AboveStreetLevel),
"at" => Some(Self::At),
"atSeaLevel" => Some(Self::AtSeaLevel),
"atStreetLevel" => Some(Self::AtStreetLevel),
"below" => Some(Self::Below),
"belowSeaLevel" => Some(Self::BelowSeaLevel),
"belowStreetLevel" => Some(Self::BelowStreetLevel),
"undefined" => Some(Self::Undefined),
"unknown" => Some(Self::Unknown),
"other" => Some(Self::Other),
_ => None,
}
}
fn extended(value: String) -> Self {
Self::Extended(value)
}
}
impl TpegLoc04HeightTypeEnum {
#[allow(unreachable_patterns)]
pub(crate) fn literal(&self) -> (&str, Option<&str>) {
match self {
Self::Extended(v) => ("_extended", Some(v)),
other => (other.as_str(), None),
}
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCArea {
pub alert_c_location_country_code: Option<String>,
pub alert_c_location_table_number: Option<String>,
pub alert_c_location_table_version: Option<String>,
pub area_location: Option<Box<AlertCLocation>>,
pub alert_c_area_extension: Option<Box<Extension>>,
}
impl AlertCArea {
const FIELDS: &'static [u32] = &[0xb06a4, 0xb06a6, 0xb06a7, 0xb06cc, 0xb0408];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb001b);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a4 => { let v = r.string()?; r.set(&mut e0, v, 1700); }
0xb06a6 => { let v = r.string()?; r.set(&mut e1, v, 1702); }
0xb06a7 => { let v = r.string()?; r.set(&mut e2, v, 1703); }
0xb06cc => { let v = Some(AlertCLocation::read(r)?); r.set(&mut e3, v.map(Box::new), 1740); }
0xb0408 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1032); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1700);
r.required(&e1, 1702);
r.required(&e2, 1703);
r.required(&e3, 1740);
let v = Self {
alert_c_location_country_code: e0,
alert_c_location_table_number: e1,
alert_c_location_table_version: e2,
area_location: e3,
alert_c_area_extension: e4,
};
r.close();
Ok(v)
}
}
impl AlertCArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location_country_code {
Some(v) => { w.max_len("alertCLocationCountryCode", v, 1024)?; w.leaf("loc:alertCLocationCountryCode", v)?; }
None => return Err(w.missing("loc:alertCLocationCountryCode")),
}
match &self.alert_c_location_table_number {
Some(v) => { w.max_len("alertCLocationTableNumber", v, 1024)?; w.leaf("loc:alertCLocationTableNumber", v)?; }
None => return Err(w.missing("loc:alertCLocationTableNumber")),
}
match &self.alert_c_location_table_version {
Some(v) => { w.max_len("alertCLocationTableVersion", v, 1024)?; w.leaf("loc:alertCLocationTableVersion", v)?; }
None => return Err(w.missing("loc:alertCLocationTableVersion")),
}
match &self.area_location {
Some(v) => { v.write(w, "loc:areaLocation", "", "")?; }
None => return Err(w.missing("loc:areaLocation")),
}
if let Some(v) = &self.alert_c_area_extension { w.extension("loc:_alertCAreaExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCDirection {
pub alert_c_direction_coded: Option<AlertCDirectionEnum>,
pub alert_c_direction_named: Option<MultilingualString>,
pub alert_c_affected_direction: Option<LinearDirectionEnum>,
pub alert_c_direction_extension: Option<Box<Extension>>,
}
impl AlertCDirection {
const FIELDS: &'static [u32] = &[0xb06a0, 0xb06a1, 0xb069d, 0xb0409];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb001c);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a0 => { let v = r.enumeration::<AlertCDirectionEnum>()?; r.set(&mut e0, v, 1696); }
0xb06a1 => { let v = r.multilingual()?; r.set(&mut e1, v, 1697); }
0xb069d => { let v = r.enumeration::<LinearDirectionEnum>()?; r.set(&mut e2, v, 1693); }
0xb0409 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1033); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1696);
r.required(&e2, 1693);
let v = Self {
alert_c_direction_coded: e0,
alert_c_direction_named: e1,
alert_c_affected_direction: e2,
alert_c_direction_extension: e3,
};
r.close();
Ok(v)
}
}
impl AlertCDirection {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_direction_coded {
Some(v) => { w.enumeration("loc:alertCDirectionCoded", v.literal())?; }
None => return Err(w.missing("loc:alertCDirectionCoded")),
}
if let Some(v) = &self.alert_c_direction_named { w.multilingual("loc:alertCDirectionNamed", v)?; }
match &self.alert_c_affected_direction {
Some(v) => { w.enumeration("loc:alertCAffectedDirection", v.literal())?; }
None => return Err(w.missing("loc:alertCAffectedDirection")),
}
if let Some(v) = &self.alert_c_direction_extension { w.extension("loc:_alertCDirectionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCLinearByCode {
pub alert_c_location_country_code: Option<String>,
pub alert_c_location_table_number: Option<String>,
pub alert_c_location_table_version: Option<String>,
pub alert_c_linear_extension: Option<Box<Extension>>,
pub alert_c_direction: Option<Box<AlertCDirection>>,
pub location_code_for_linear_location: Option<Box<AlertCLocation>>,
pub alert_c_linear_by_code_extension: Option<Box<Extension>>,
}
impl AlertCLinearByCode {
const FIELDS: &'static [u32] = &[0xb06a4, 0xb06a6, 0xb06a7, 0xb040b, 0xb069f, 0xb08de, 0xb040a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb001e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a4 => { let v = r.string()?; r.set(&mut e0, v, 1700); }
0xb06a6 => { let v = r.string()?; r.set(&mut e1, v, 1702); }
0xb06a7 => { let v = r.string()?; r.set(&mut e2, v, 1703); }
0xb040b => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1035); }
0xb069f => { let v = Some(AlertCDirection::read(r)?); r.set(&mut e4, v.map(Box::new), 1695); }
0xb08de => { let v = Some(AlertCLocation::read(r)?); r.set(&mut e5, v.map(Box::new), 2270); }
0xb040a => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1034); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1700);
r.required(&e1, 1702);
r.required(&e2, 1703);
r.required(&e4, 1695);
r.required(&e5, 2270);
let v = Self {
alert_c_location_country_code: e0,
alert_c_location_table_number: e1,
alert_c_location_table_version: e2,
alert_c_linear_extension: e3,
alert_c_direction: e4,
location_code_for_linear_location: e5,
alert_c_linear_by_code_extension: e6,
};
r.close();
Ok(v)
}
}
impl AlertCLinearByCode {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location_country_code {
Some(v) => { w.max_len("alertCLocationCountryCode", v, 1024)?; w.leaf("loc:alertCLocationCountryCode", v)?; }
None => return Err(w.missing("loc:alertCLocationCountryCode")),
}
match &self.alert_c_location_table_number {
Some(v) => { w.max_len("alertCLocationTableNumber", v, 1024)?; w.leaf("loc:alertCLocationTableNumber", v)?; }
None => return Err(w.missing("loc:alertCLocationTableNumber")),
}
match &self.alert_c_location_table_version {
Some(v) => { w.max_len("alertCLocationTableVersion", v, 1024)?; w.leaf("loc:alertCLocationTableVersion", v)?; }
None => return Err(w.missing("loc:alertCLocationTableVersion")),
}
if let Some(v) = &self.alert_c_linear_extension { w.extension("loc:_alertCLinearExtension", v)?; }
match &self.alert_c_direction {
Some(v) => { v.write(w, "loc:alertCDirection", "", "")?; }
None => return Err(w.missing("loc:alertCDirection")),
}
match &self.location_code_for_linear_location {
Some(v) => { v.write(w, "loc:locationCodeForLinearLocation", "", "")?; }
None => return Err(w.missing("loc:locationCodeForLinearLocation")),
}
if let Some(v) = &self.alert_c_linear_by_code_extension { w.extension("loc:_alertCLinearByCodeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCLocation {
pub alert_c_location_name: Option<MultilingualString>,
pub specific_location: Option<AlertCLocationCode>,
pub alert_c_location_extension: Option<Box<Extension>>,
}
impl AlertCLocation {
const FIELDS: &'static [u32] = &[0xb06a5, 0xb0b5f, 0xb040c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb001f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a5 => { let v = r.multilingual()?; r.set(&mut e0, v, 1701); }
0xb0b5f => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2911); }
0xb040c => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1036); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2911);
let v = Self {
alert_c_location_name: e0,
specific_location: e1,
alert_c_location_extension: e2,
};
r.close();
Ok(v)
}
}
impl AlertCLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.alert_c_location_name { w.multilingual("loc:alertCLocationName", v)?; }
match &self.specific_location {
Some(v) => { w.range("specificLocation", *v, 1, 63487)?; w.leaf("loc:specificLocation", v)?; }
None => return Err(w.missing("loc:specificLocation")),
}
if let Some(v) = &self.alert_c_location_extension { w.extension("loc:_alertCLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCMethod2Linear {
pub alert_c_location_country_code: Option<String>,
pub alert_c_location_table_number: Option<String>,
pub alert_c_location_table_version: Option<String>,
pub alert_c_linear_extension: Option<Box<Extension>>,
pub alert_c_direction: Option<Box<AlertCDirection>>,
pub alert_c_method2_primary_point_location: Option<Box<AlertCMethod2PrimaryPointLocation>>,
pub alert_c_method2_secondary_point_location: Option<Box<AlertCMethod2SecondaryPointLocation>>,
pub alert_c_method2_linear_extension: Option<Box<Extension>>,
}
impl AlertCMethod2Linear {
const FIELDS: &'static [u32] = &[0xb06a4, 0xb06a6, 0xb06a7, 0xb040b, 0xb069f, 0xb06a8, 0xb06a9, 0xb040d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0020);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a4 => { let v = r.string()?; r.set(&mut e0, v, 1700); }
0xb06a6 => { let v = r.string()?; r.set(&mut e1, v, 1702); }
0xb06a7 => { let v = r.string()?; r.set(&mut e2, v, 1703); }
0xb040b => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1035); }
0xb069f => { let v = Some(AlertCDirection::read(r)?); r.set(&mut e4, v.map(Box::new), 1695); }
0xb06a8 => { let v = Some(AlertCMethod2PrimaryPointLocation::read(r)?); r.set(&mut e5, v.map(Box::new), 1704); }
0xb06a9 => { let v = Some(AlertCMethod2SecondaryPointLocation::read(r)?); r.set(&mut e6, v.map(Box::new), 1705); }
0xb040d => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1037); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1700);
r.required(&e1, 1702);
r.required(&e2, 1703);
r.required(&e4, 1695);
r.required(&e5, 1704);
r.required(&e6, 1705);
let v = Self {
alert_c_location_country_code: e0,
alert_c_location_table_number: e1,
alert_c_location_table_version: e2,
alert_c_linear_extension: e3,
alert_c_direction: e4,
alert_c_method2_primary_point_location: e5,
alert_c_method2_secondary_point_location: e6,
alert_c_method2_linear_extension: e7,
};
r.close();
Ok(v)
}
}
impl AlertCMethod2Linear {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location_country_code {
Some(v) => { w.max_len("alertCLocationCountryCode", v, 1024)?; w.leaf("loc:alertCLocationCountryCode", v)?; }
None => return Err(w.missing("loc:alertCLocationCountryCode")),
}
match &self.alert_c_location_table_number {
Some(v) => { w.max_len("alertCLocationTableNumber", v, 1024)?; w.leaf("loc:alertCLocationTableNumber", v)?; }
None => return Err(w.missing("loc:alertCLocationTableNumber")),
}
match &self.alert_c_location_table_version {
Some(v) => { w.max_len("alertCLocationTableVersion", v, 1024)?; w.leaf("loc:alertCLocationTableVersion", v)?; }
None => return Err(w.missing("loc:alertCLocationTableVersion")),
}
if let Some(v) = &self.alert_c_linear_extension { w.extension("loc:_alertCLinearExtension", v)?; }
match &self.alert_c_direction {
Some(v) => { v.write(w, "loc:alertCDirection", "", "")?; }
None => return Err(w.missing("loc:alertCDirection")),
}
match &self.alert_c_method2_primary_point_location {
Some(v) => { v.write(w, "loc:alertCMethod2PrimaryPointLocation", "", "")?; }
None => return Err(w.missing("loc:alertCMethod2PrimaryPointLocation")),
}
match &self.alert_c_method2_secondary_point_location {
Some(v) => { v.write(w, "loc:alertCMethod2SecondaryPointLocation", "", "")?; }
None => return Err(w.missing("loc:alertCMethod2SecondaryPointLocation")),
}
if let Some(v) = &self.alert_c_method2_linear_extension { w.extension("loc:_alertCMethod2LinearExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCMethod2Point {
pub alert_c_location_country_code: Option<String>,
pub alert_c_location_table_number: Option<String>,
pub alert_c_location_table_version: Option<String>,
pub alert_c_point_extension: Option<Box<Extension>>,
pub alert_c_direction: Option<Box<AlertCDirection>>,
pub alert_c_method2_primary_point_location: Option<Box<AlertCMethod2PrimaryPointLocation>>,
pub alert_c_method2_point_extension: Option<Box<Extension>>,
}
impl AlertCMethod2Point {
const FIELDS: &'static [u32] = &[0xb06a4, 0xb06a6, 0xb06a7, 0xb0415, 0xb069f, 0xb06a8, 0xb040e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0021);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a4 => { let v = r.string()?; r.set(&mut e0, v, 1700); }
0xb06a6 => { let v = r.string()?; r.set(&mut e1, v, 1702); }
0xb06a7 => { let v = r.string()?; r.set(&mut e2, v, 1703); }
0xb0415 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1045); }
0xb069f => { let v = Some(AlertCDirection::read(r)?); r.set(&mut e4, v.map(Box::new), 1695); }
0xb06a8 => { let v = Some(AlertCMethod2PrimaryPointLocation::read(r)?); r.set(&mut e5, v.map(Box::new), 1704); }
0xb040e => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1038); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1700);
r.required(&e1, 1702);
r.required(&e2, 1703);
r.required(&e4, 1695);
r.required(&e5, 1704);
let v = Self {
alert_c_location_country_code: e0,
alert_c_location_table_number: e1,
alert_c_location_table_version: e2,
alert_c_point_extension: e3,
alert_c_direction: e4,
alert_c_method2_primary_point_location: e5,
alert_c_method2_point_extension: e6,
};
r.close();
Ok(v)
}
}
impl AlertCMethod2Point {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location_country_code {
Some(v) => { w.max_len("alertCLocationCountryCode", v, 1024)?; w.leaf("loc:alertCLocationCountryCode", v)?; }
None => return Err(w.missing("loc:alertCLocationCountryCode")),
}
match &self.alert_c_location_table_number {
Some(v) => { w.max_len("alertCLocationTableNumber", v, 1024)?; w.leaf("loc:alertCLocationTableNumber", v)?; }
None => return Err(w.missing("loc:alertCLocationTableNumber")),
}
match &self.alert_c_location_table_version {
Some(v) => { w.max_len("alertCLocationTableVersion", v, 1024)?; w.leaf("loc:alertCLocationTableVersion", v)?; }
None => return Err(w.missing("loc:alertCLocationTableVersion")),
}
if let Some(v) = &self.alert_c_point_extension { w.extension("loc:_alertCPointExtension", v)?; }
match &self.alert_c_direction {
Some(v) => { v.write(w, "loc:alertCDirection", "", "")?; }
None => return Err(w.missing("loc:alertCDirection")),
}
match &self.alert_c_method2_primary_point_location {
Some(v) => { v.write(w, "loc:alertCMethod2PrimaryPointLocation", "", "")?; }
None => return Err(w.missing("loc:alertCMethod2PrimaryPointLocation")),
}
if let Some(v) = &self.alert_c_method2_point_extension { w.extension("loc:_alertCMethod2PointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCMethod2PrimaryPointLocation {
pub alert_c_location: Option<Box<AlertCLocation>>,
pub alert_c_method2_primary_point_location_extension: Option<Box<Extension>>,
}
impl AlertCMethod2PrimaryPointLocation {
const FIELDS: &'static [u32] = &[0xb06a3, 0xb040f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0022);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a3 => { let v = Some(AlertCLocation::read(r)?); r.set(&mut e0, v.map(Box::new), 1699); }
0xb040f => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1039); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1699);
let v = Self {
alert_c_location: e0,
alert_c_method2_primary_point_location_extension: e1,
};
r.close();
Ok(v)
}
}
impl AlertCMethod2PrimaryPointLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location {
Some(v) => { v.write(w, "loc:alertCLocation", "", "")?; }
None => return Err(w.missing("loc:alertCLocation")),
}
if let Some(v) = &self.alert_c_method2_primary_point_location_extension { w.extension("loc:_alertCMethod2PrimaryPointLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCMethod2SecondaryPointLocation {
pub alert_c_location: Option<Box<AlertCLocation>>,
pub alert_c_method2_secondary_point_location_extension: Option<Box<Extension>>,
}
impl AlertCMethod2SecondaryPointLocation {
const FIELDS: &'static [u32] = &[0xb06a3, 0xb0410];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0023);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a3 => { let v = Some(AlertCLocation::read(r)?); r.set(&mut e0, v.map(Box::new), 1699); }
0xb0410 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1040); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1699);
let v = Self {
alert_c_location: e0,
alert_c_method2_secondary_point_location_extension: e1,
};
r.close();
Ok(v)
}
}
impl AlertCMethod2SecondaryPointLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location {
Some(v) => { v.write(w, "loc:alertCLocation", "", "")?; }
None => return Err(w.missing("loc:alertCLocation")),
}
if let Some(v) = &self.alert_c_method2_secondary_point_location_extension { w.extension("loc:_alertCMethod2SecondaryPointLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCMethod4Linear {
pub alert_c_location_country_code: Option<String>,
pub alert_c_location_table_number: Option<String>,
pub alert_c_location_table_version: Option<String>,
pub alert_c_linear_extension: Option<Box<Extension>>,
pub alert_c_direction: Option<Box<AlertCDirection>>,
pub alert_c_method4_primary_point_location: Option<Box<AlertCMethod4PrimaryPointLocation>>,
pub alert_c_method4_secondary_point_location: Option<Box<AlertCMethod4SecondaryPointLocation>>,
pub alert_c_method4_linear_extension: Option<Box<Extension>>,
}
impl AlertCMethod4Linear {
const FIELDS: &'static [u32] = &[0xb06a4, 0xb06a6, 0xb06a7, 0xb040b, 0xb069f, 0xb06aa, 0xb06ab, 0xb0411];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0024);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a4 => { let v = r.string()?; r.set(&mut e0, v, 1700); }
0xb06a6 => { let v = r.string()?; r.set(&mut e1, v, 1702); }
0xb06a7 => { let v = r.string()?; r.set(&mut e2, v, 1703); }
0xb040b => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1035); }
0xb069f => { let v = Some(AlertCDirection::read(r)?); r.set(&mut e4, v.map(Box::new), 1695); }
0xb06aa => { let v = Some(AlertCMethod4PrimaryPointLocation::read(r)?); r.set(&mut e5, v.map(Box::new), 1706); }
0xb06ab => { let v = Some(AlertCMethod4SecondaryPointLocation::read(r)?); r.set(&mut e6, v.map(Box::new), 1707); }
0xb0411 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1041); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1700);
r.required(&e1, 1702);
r.required(&e2, 1703);
r.required(&e4, 1695);
r.required(&e5, 1706);
r.required(&e6, 1707);
let v = Self {
alert_c_location_country_code: e0,
alert_c_location_table_number: e1,
alert_c_location_table_version: e2,
alert_c_linear_extension: e3,
alert_c_direction: e4,
alert_c_method4_primary_point_location: e5,
alert_c_method4_secondary_point_location: e6,
alert_c_method4_linear_extension: e7,
};
r.close();
Ok(v)
}
}
impl AlertCMethod4Linear {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location_country_code {
Some(v) => { w.max_len("alertCLocationCountryCode", v, 1024)?; w.leaf("loc:alertCLocationCountryCode", v)?; }
None => return Err(w.missing("loc:alertCLocationCountryCode")),
}
match &self.alert_c_location_table_number {
Some(v) => { w.max_len("alertCLocationTableNumber", v, 1024)?; w.leaf("loc:alertCLocationTableNumber", v)?; }
None => return Err(w.missing("loc:alertCLocationTableNumber")),
}
match &self.alert_c_location_table_version {
Some(v) => { w.max_len("alertCLocationTableVersion", v, 1024)?; w.leaf("loc:alertCLocationTableVersion", v)?; }
None => return Err(w.missing("loc:alertCLocationTableVersion")),
}
if let Some(v) = &self.alert_c_linear_extension { w.extension("loc:_alertCLinearExtension", v)?; }
match &self.alert_c_direction {
Some(v) => { v.write(w, "loc:alertCDirection", "", "")?; }
None => return Err(w.missing("loc:alertCDirection")),
}
match &self.alert_c_method4_primary_point_location {
Some(v) => { v.write(w, "loc:alertCMethod4PrimaryPointLocation", "", "")?; }
None => return Err(w.missing("loc:alertCMethod4PrimaryPointLocation")),
}
match &self.alert_c_method4_secondary_point_location {
Some(v) => { v.write(w, "loc:alertCMethod4SecondaryPointLocation", "", "")?; }
None => return Err(w.missing("loc:alertCMethod4SecondaryPointLocation")),
}
if let Some(v) = &self.alert_c_method4_linear_extension { w.extension("loc:_alertCMethod4LinearExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCMethod4Point {
pub alert_c_location_country_code: Option<String>,
pub alert_c_location_table_number: Option<String>,
pub alert_c_location_table_version: Option<String>,
pub alert_c_point_extension: Option<Box<Extension>>,
pub alert_c_direction: Option<Box<AlertCDirection>>,
pub alert_c_method4_primary_point_location: Option<Box<AlertCMethod4PrimaryPointLocation>>,
pub alert_c_method4_point_extension: Option<Box<Extension>>,
}
impl AlertCMethod4Point {
const FIELDS: &'static [u32] = &[0xb06a4, 0xb06a6, 0xb06a7, 0xb0415, 0xb069f, 0xb06aa, 0xb0412];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0025);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a4 => { let v = r.string()?; r.set(&mut e0, v, 1700); }
0xb06a6 => { let v = r.string()?; r.set(&mut e1, v, 1702); }
0xb06a7 => { let v = r.string()?; r.set(&mut e2, v, 1703); }
0xb0415 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1045); }
0xb069f => { let v = Some(AlertCDirection::read(r)?); r.set(&mut e4, v.map(Box::new), 1695); }
0xb06aa => { let v = Some(AlertCMethod4PrimaryPointLocation::read(r)?); r.set(&mut e5, v.map(Box::new), 1706); }
0xb0412 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1042); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1700);
r.required(&e1, 1702);
r.required(&e2, 1703);
r.required(&e4, 1695);
r.required(&e5, 1706);
let v = Self {
alert_c_location_country_code: e0,
alert_c_location_table_number: e1,
alert_c_location_table_version: e2,
alert_c_point_extension: e3,
alert_c_direction: e4,
alert_c_method4_primary_point_location: e5,
alert_c_method4_point_extension: e6,
};
r.close();
Ok(v)
}
}
impl AlertCMethod4Point {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location_country_code {
Some(v) => { w.max_len("alertCLocationCountryCode", v, 1024)?; w.leaf("loc:alertCLocationCountryCode", v)?; }
None => return Err(w.missing("loc:alertCLocationCountryCode")),
}
match &self.alert_c_location_table_number {
Some(v) => { w.max_len("alertCLocationTableNumber", v, 1024)?; w.leaf("loc:alertCLocationTableNumber", v)?; }
None => return Err(w.missing("loc:alertCLocationTableNumber")),
}
match &self.alert_c_location_table_version {
Some(v) => { w.max_len("alertCLocationTableVersion", v, 1024)?; w.leaf("loc:alertCLocationTableVersion", v)?; }
None => return Err(w.missing("loc:alertCLocationTableVersion")),
}
if let Some(v) = &self.alert_c_point_extension { w.extension("loc:_alertCPointExtension", v)?; }
match &self.alert_c_direction {
Some(v) => { v.write(w, "loc:alertCDirection", "", "")?; }
None => return Err(w.missing("loc:alertCDirection")),
}
match &self.alert_c_method4_primary_point_location {
Some(v) => { v.write(w, "loc:alertCMethod4PrimaryPointLocation", "", "")?; }
None => return Err(w.missing("loc:alertCMethod4PrimaryPointLocation")),
}
if let Some(v) = &self.alert_c_method4_point_extension { w.extension("loc:_alertCMethod4PointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCMethod4PrimaryPointLocation {
pub alert_c_location: Option<Box<AlertCLocation>>,
pub offset_distance: Option<Box<OffsetDistance>>,
pub alert_c_method4_primary_point_location_extension: Option<Box<Extension>>,
}
impl AlertCMethod4PrimaryPointLocation {
const FIELDS: &'static [u32] = &[0xb06a3, 0xb09a5, 0xb0413];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0026);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a3 => { let v = Some(AlertCLocation::read(r)?); r.set(&mut e0, v.map(Box::new), 1699); }
0xb09a5 => { let v = Some(OffsetDistance::read(r)?); r.set(&mut e1, v.map(Box::new), 2469); }
0xb0413 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1043); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1699);
r.required(&e1, 2469);
let v = Self {
alert_c_location: e0,
offset_distance: e1,
alert_c_method4_primary_point_location_extension: e2,
};
r.close();
Ok(v)
}
}
impl AlertCMethod4PrimaryPointLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location {
Some(v) => { v.write(w, "loc:alertCLocation", "", "")?; }
None => return Err(w.missing("loc:alertCLocation")),
}
match &self.offset_distance {
Some(v) => { v.write(w, "loc:offsetDistance", "", "")?; }
None => return Err(w.missing("loc:offsetDistance")),
}
if let Some(v) = &self.alert_c_method4_primary_point_location_extension { w.extension("loc:_alertCMethod4PrimaryPointLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AlertCMethod4SecondaryPointLocation {
pub alert_c_location: Option<Box<AlertCLocation>>,
pub offset_distance: Option<Box<OffsetDistance>>,
pub alert_c_method4_secondary_point_location_extension: Option<Box<Extension>>,
}
impl AlertCMethod4SecondaryPointLocation {
const FIELDS: &'static [u32] = &[0xb06a3, 0xb09a5, 0xb0414];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0027);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06a3 => { let v = Some(AlertCLocation::read(r)?); r.set(&mut e0, v.map(Box::new), 1699); }
0xb09a5 => { let v = Some(OffsetDistance::read(r)?); r.set(&mut e1, v.map(Box::new), 2469); }
0xb0414 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1044); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1699);
r.required(&e1, 2469);
let v = Self {
alert_c_location: e0,
offset_distance: e1,
alert_c_method4_secondary_point_location_extension: e2,
};
r.close();
Ok(v)
}
}
impl AlertCMethod4SecondaryPointLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.alert_c_location {
Some(v) => { v.write(w, "loc:alertCLocation", "", "")?; }
None => return Err(w.missing("loc:alertCLocation")),
}
match &self.offset_distance {
Some(v) => { v.write(w, "loc:offsetDistance", "", "")?; }
None => return Err(w.missing("loc:offsetDistance")),
}
if let Some(v) = &self.alert_c_method4_secondary_point_location_extension { w.extension("loc:_alertCMethod4SecondaryPointLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AltitudeConfidence {
pub altitude_accuracy_coded_value: Option<AltitudeAccuracyEnum>,
pub altitude_accuracy_coded_error: Option<PositionConfidenceCodedErrorEnum>,
pub altitude_confidence_extension: Option<Box<Extension>>,
}
impl AltitudeConfidence {
const FIELDS: &'static [u32] = &[0xb06b5, 0xb06b4, 0xb041a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb002d);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06b5 => { let v = r.enumeration::<AltitudeAccuracyEnum>()?; r.set(&mut e0, v, 1717); }
0xb06b4 => { let v = r.enumeration::<PositionConfidenceCodedErrorEnum>()?; r.set(&mut e1, v, 1716); }
0xb041a => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1050); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
altitude_accuracy_coded_value: e0,
altitude_accuracy_coded_error: e1,
altitude_confidence_extension: e2,
};
r.close();
Ok(v)
}
}
impl AltitudeConfidence {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.altitude_accuracy_coded_value { w.enumeration("loc:altitudeAccuracyCodedValue", v.literal())?; }
if let Some(v) = &self.altitude_accuracy_coded_error { w.enumeration("loc:altitudeAccuracyCodedError", v.literal())?; }
if let Some(v) = &self.altitude_confidence_extension { w.extension("loc:_altitudeConfidenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AreaDestination {
pub destination_extension: Option<Box<Extension>>,
pub area_location: Option<Box<AreaLocation>>,
pub area_destination_extension: Option<Box<Extension>>,
}
impl AreaDestination {
const FIELDS: &'static [u32] = &[0xb045d, 0xb06cc, 0xb0421];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0034);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb045d => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1117); }
0xb06cc => { let v = Some(AreaLocation::read(r)?); r.set(&mut e1, v.map(Box::new), 1740); }
0xb0421 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1057); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1740);
let v = Self {
destination_extension: e0,
area_location: e1,
area_destination_extension: e2,
};
r.close();
Ok(v)
}
}
impl AreaDestination {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.destination_extension { w.extension("loc:_destinationExtension", v)?; }
match &self.area_location {
Some(v) => { v.write(w, "loc:areaLocation", "", "")?; }
None => return Err(w.missing("loc:areaLocation")),
}
if let Some(v) = &self.area_destination_extension { w.extension("loc:_areaDestinationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct AreaLocation {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub external_referencing: Vec<ExternalReferencing>,
pub coordinates_for_display: Option<Box<PointCoordinates>>,
pub location_extension: Option<Box<LocationExtensionType>>,
pub areas_at_which_applicable: Option<AreaPlacesEnum>,
pub alert_c_area: Vec<AlertCArea>,
pub tpeg_area_location: Option<TpegAreaLocation>,
pub named_area: Option<AnyNamedArea>,
pub gml_multi_polygon: Option<Box<GmlMultiPolygon>>,
pub openlr_area_location_reference: Option<OpenlrAreaLocationReference>,
pub area_location_extension: Option<Box<Extension>>,
}
impl AreaLocation {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb0809, 0xb0743, 0xb04df, 0xb06ce, 0xb069e, 0xb0bce, 0xb094b, 0xb0846, 0xb09a9, 0xb0422];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0035);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = Vec::new();
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb0809 => { let v = Some(ExternalReferencing::read(r)?); e1.extend(v); }
0xb0743 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e2, v.map(Box::new), 1859); }
0xb04df => { let v = Some(LocationExtensionType::read(r)?); r.set(&mut e3, v.map(Box::new), 1247); }
0xb06ce => { let v = r.enumeration::<AreaPlacesEnum>()?; r.set(&mut e4, v, 1742); }
0xb069e => { let v = Some(AlertCArea::read(r)?); e5.extend(v); }
0xb0bce => { let v = TpegAreaLocation::read(r)?; r.set(&mut e6, v, 3022); }
0xb094b => { let v = AnyNamedArea::read(r)?; r.set(&mut e7, v, 2379); }
0xb0846 => { let v = Some(GmlMultiPolygon::read(r)?); r.set(&mut e8, v.map(Box::new), 2118); }
0xb09a9 => { let v = OpenlrAreaLocationReference::read(r)?; r.set(&mut e9, v, 2473); }
0xb0422 => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1058); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
location_reference_extension: e0,
external_referencing: e1,
coordinates_for_display: e2,
location_extension: e3,
areas_at_which_applicable: e4,
alert_c_area: e5,
tpeg_area_location: e6,
named_area: e7,
gml_multi_polygon: e8,
openlr_area_location_reference: e9,
area_location_extension: e10,
};
r.close();
Ok(v)
}
}
impl AreaLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
for v in &self.external_referencing { v.write(w, "loc:externalReferencing", "", "")?; }
if let Some(v) = &self.coordinates_for_display { v.write(w, "loc:coordinatesForDisplay", "", "")?; }
if let Some(v) = &self.location_extension { v.write(w, "loc:_locationExtension", "", "")?; }
if let Some(v) = &self.areas_at_which_applicable { w.enumeration("loc:areasAtWhichApplicable", v.literal())?; }
for v in &self.alert_c_area { v.write(w, "loc:alertCArea", "", "")?; }
if let Some(v) = &self.tpeg_area_location { v.write(w, "loc:tpegAreaLocation")?; }
if let Some(v) = &self.named_area { v.write(w, "loc:namedArea")?; }
if let Some(v) = &self.gml_multi_polygon { v.write(w, "loc:gmlMultiPolygon", "", "")?; }
if let Some(v) = &self.openlr_area_location_reference { v.write(w, "loc:openlrAreaLocationReference")?; }
if let Some(v) = &self.area_location_extension { w.extension("loc:_areaLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Carriageway {
pub carriageway: Option<CarriagewayEnum>,
pub original_number_of_lanes: Option<com::Integer>,
pub lane: Vec<Lane>,
pub carriageway_extension: Option<Box<Extension>>,
}
impl Carriageway {
const FIELDS: &'static [u32] = &[0xb070a, 0xb09e2, 0xb08ab, 0xb0435];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0049);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb070a => { let v = r.enumeration::<CarriagewayEnum>()?; r.set(&mut e0, v, 1802); }
0xb09e2 => { let v = r.value::<i64>()?; r.set(&mut e1, v, 2530); }
0xb08ab => { let v = Some(Lane::read(r)?); e2.extend(v); }
0xb0435 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1077); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1802);
let v = Self {
carriageway: e0,
original_number_of_lanes: e1,
lane: e2,
carriageway_extension: e3,
};
r.close();
Ok(v)
}
}
impl Carriageway {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.carriageway {
Some(v) => { w.enumeration("loc:carriageway", v.literal())?; }
None => return Err(w.missing("loc:carriageway")),
}
if let Some(v) = &self.original_number_of_lanes { w.leaf("loc:originalNumberOfLanes", v)?; }
for v in &self.lane { v.write(w, "loc:lane", "", "")?; }
if let Some(v) = &self.carriageway_extension { w.extension("loc:_carriagewayExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DistanceFromLinearElementReferent {
pub distance_along_linear_element_extension: Option<Box<Extension>>,
pub distance_along: Option<com::MetresAsFloat>,
pub from_referent: Option<Box<Referent>>,
pub towards_referent: Option<Box<Referent>>,
pub distance_from_linear_element_referent_extension: Option<Box<Extension>>,
}
impl DistanceFromLinearElementReferent {
const FIELDS: &'static [u32] = &[0xb0470, 0xb079c, 0xb0834, 0xb0bcc, 0xb0471];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0086);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0470 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1136); }
0xb079c => { let v = r.value::<f32>()?; r.set(&mut e1, v, 1948); }
0xb0834 => { let v = Some(Referent::read(r)?); r.set(&mut e2, v.map(Box::new), 2100); }
0xb0bcc => { let v = Some(Referent::read(r)?); r.set(&mut e3, v.map(Box::new), 3020); }
0xb0471 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1137); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1948);
r.required(&e2, 2100);
let v = Self {
distance_along_linear_element_extension: e0,
distance_along: e1,
from_referent: e2,
towards_referent: e3,
distance_from_linear_element_referent_extension: e4,
};
r.close();
Ok(v)
}
}
impl DistanceFromLinearElementReferent {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.distance_along_linear_element_extension { w.extension("loc:_distanceAlongLinearElementExtension", v)?; }
match &self.distance_along {
Some(v) => { w.leaf("loc:distanceAlong", v)?; }
None => return Err(w.missing("loc:distanceAlong")),
}
match &self.from_referent {
Some(v) => { v.write(w, "loc:fromReferent", "", "")?; }
None => return Err(w.missing("loc:fromReferent")),
}
if let Some(v) = &self.towards_referent { v.write(w, "loc:towardsReferent", "", "")?; }
if let Some(v) = &self.distance_from_linear_element_referent_extension { w.extension("loc:_distanceFromLinearElementReferentExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct DistanceFromLinearElementStart {
pub distance_along_linear_element_extension: Option<Box<Extension>>,
pub distance_along: Option<com::MetresAsFloat>,
pub distance_from_linear_element_start_extension: Option<Box<Extension>>,
}
impl DistanceFromLinearElementStart {
const FIELDS: &'static [u32] = &[0xb0470, 0xb079c, 0xb0472];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0087);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0470 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1136); }
0xb079c => { let v = r.value::<f32>()?; r.set(&mut e1, v, 1948); }
0xb0472 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1138); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1948);
let v = Self {
distance_along_linear_element_extension: e0,
distance_along: e1,
distance_from_linear_element_start_extension: e2,
};
r.close();
Ok(v)
}
}
impl DistanceFromLinearElementStart {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.distance_along_linear_element_extension { w.extension("loc:_distanceAlongLinearElementExtension", v)?; }
match &self.distance_along {
Some(v) => { w.leaf("loc:distanceAlong", v)?; }
None => return Err(w.missing("loc:distanceAlong")),
}
if let Some(v) = &self.distance_from_linear_element_start_extension { w.extension("loc:_distanceFromLinearElementStartExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ExternalReferencing {
pub external_location_code: Option<String>,
pub external_referencing_system: Option<String>,
pub external_referencing_extension: Option<Box<Extension>>,
}
impl ExternalReferencing {
const FIELDS: &'static [u32] = &[0xb0806, 0xb080a, 0xb0495];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00aa);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0806 => { let v = r.string()?; r.set(&mut e0, v, 2054); }
0xb080a => { let v = r.string()?; r.set(&mut e1, v, 2058); }
0xb0495 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1173); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2054);
r.required(&e1, 2058);
let v = Self {
external_location_code: e0,
external_referencing_system: e1,
external_referencing_extension: e2,
};
r.close();
Ok(v)
}
}
impl ExternalReferencing {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.external_location_code {
Some(v) => { w.max_len("externalLocationCode", v, 1024)?; w.leaf("loc:externalLocationCode", v)?; }
None => return Err(w.missing("loc:externalLocationCode")),
}
match &self.external_referencing_system {
Some(v) => { w.max_len("externalReferencingSystem", v, 1024)?; w.leaf("loc:externalReferencingSystem", v)?; }
None => return Err(w.missing("loc:externalReferencingSystem")),
}
if let Some(v) = &self.external_referencing_extension { w.extension("loc:_externalReferencingExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GmlLineString {
pub srs_dimension: Option<com::NonNegativeInteger>,
pub srs_name: Option<String>,
pub pos_list: Option<GmlPosList>,
pub gml_line_string_extension: Option<Box<Extension>>,
}
impl GmlLineString {
const FIELDS: &'static [u32] = &[0xb0a4d, 0xb04af];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00c5);
let a0 = r.attr_value::<u64>(2918)?;
let a1 = r.attr(2919);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0a4d => { let v = r.string()?; r.set(&mut e0, v, 2637); }
0xb04af => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1199); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2637);
let v = Self {
srs_dimension: a0,
srs_name: a1,
pos_list: e0,
gml_line_string_extension: e1,
};
r.close();
Ok(v)
}
}
impl GmlLineString {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.srs_dimension { w.attr_value("srsDimension", v)?; }
if let Some(v) = &self.srs_name { w.max_len("srsName", v, 1024)?; w.attr("srsName", v)?; }
match &self.pos_list {
Some(v) => { w.pattern("posList", v, Pattern::GmlPosList)?; w.leaf("loc:posList", v)?; }
None => return Err(w.missing("loc:posList")),
}
if let Some(v) = &self.gml_line_string_extension { w.extension("loc:_gmlLineStringExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GmlLinearRing {
pub srs_dimension: Option<com::NonNegativeInteger>,
pub srs_name: Option<String>,
pub pos_list: Option<GmlPosList>,
pub gml_line_string_extension: Option<Box<Extension>>,
pub gml_linear_ring_extension: Option<Box<Extension>>,
}
impl GmlLinearRing {
const FIELDS: &'static [u32] = &[0xb0a4d, 0xb04af, 0xb04b0];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00c6);
let a0 = r.attr_value::<u64>(2918)?;
let a1 = r.attr(2919);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0a4d => { let v = r.string()?; r.set(&mut e0, v, 2637); }
0xb04af => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1199); }
0xb04b0 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1200); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2637);
let v = Self {
srs_dimension: a0,
srs_name: a1,
pos_list: e0,
gml_line_string_extension: e1,
gml_linear_ring_extension: e2,
};
r.close();
Ok(v)
}
}
impl GmlLinearRing {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.srs_dimension { w.attr_value("srsDimension", v)?; }
if let Some(v) = &self.srs_name { w.max_len("srsName", v, 1024)?; w.attr("srsName", v)?; }
match &self.pos_list {
Some(v) => { w.pattern("posList", v, Pattern::GmlPosList)?; w.leaf("loc:posList", v)?; }
None => return Err(w.missing("loc:posList")),
}
if let Some(v) = &self.gml_line_string_extension { w.extension("loc:_gmlLineStringExtension", v)?; }
if let Some(v) = &self.gml_linear_ring_extension { w.extension("loc:_gmlLinearRingExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GmlMultiPolygon {
pub gml_area_name: Option<MultilingualString>,
pub gml_polygon: Vec<GmlPolygon>,
pub gml_multi_polygon_extension: Option<Box<Extension>>,
}
impl GmlMultiPolygon {
const FIELDS: &'static [u32] = &[0xb0844, 0xb0847, 0xb04b1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00c7);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0844 => { let v = r.multilingual()?; r.set(&mut e0, v, 2116); }
0xb0847 => { let v = Some(GmlPolygon::read(r)?); e1.extend(v); }
0xb04b1 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1201); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
gml_area_name: e0,
gml_polygon: e1,
gml_multi_polygon_extension: e2,
};
r.close();
Ok(v)
}
}
impl GmlMultiPolygon {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.gml_area_name { w.multilingual("loc:gmlAreaName", v)?; }
w.count("loc:gmlPolygon", self.gml_polygon.len(), 1, usize::MAX)?;
for v in &self.gml_polygon { v.write(w, "loc:gmlPolygon", "", "")?; }
if let Some(v) = &self.gml_multi_polygon_extension { w.extension("loc:_gmlMultiPolygonExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct GmlPolygon {
pub exterior: Option<Box<GmlLinearRing>>,
pub interior: Vec<GmlLinearRing>,
pub gml_polygon_extension: Option<Box<Extension>>,
}
impl GmlPolygon {
const FIELDS: &'static [u32] = &[0xb0800, 0xb088e, 0xb04b2];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00c8);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0800 => { let v = Some(GmlLinearRing::read(r)?); r.set(&mut e0, v.map(Box::new), 2048); }
0xb088e => { let v = Some(GmlLinearRing::read(r)?); e1.extend(v); }
0xb04b2 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1202); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2048);
let v = Self {
exterior: e0,
interior: e1,
gml_polygon_extension: e2,
};
r.close();
Ok(v)
}
}
impl GmlPolygon {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.exterior {
Some(v) => { v.write(w, "loc:exterior", "", "")?; }
None => return Err(w.missing("loc:exterior")),
}
for v in &self.interior { v.write(w, "loc:interior", "", "")?; }
if let Some(v) = &self.gml_polygon_extension { w.extension("loc:_gmlPolygonExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct HeightCoordinate {
pub height_value: Option<com::MetresAsFloat>,
pub height_type: Option<HeightTypeEnum>,
pub altitude_confidence: Option<Box<AltitudeConfidence>>,
pub vertical_position_accuracy: Option<Box<PositionAccuracy>>,
pub height_coordinate_extension: Option<Box<Extension>>,
}
impl HeightCoordinate {
const FIELDS: &'static [u32] = &[0xb0863, 0xb0862, 0xb06b6, 0xb0c4f, 0xb04bd];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00d3);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0863 => { let v = r.value::<f32>()?; r.set(&mut e0, v, 2147); }
0xb0862 => { let v = r.enumeration::<HeightTypeEnum>()?; r.set(&mut e1, v, 2146); }
0xb06b6 => { let v = Some(AltitudeConfidence::read(r)?); r.set(&mut e2, v.map(Box::new), 1718); }
0xb0c4f => { let v = Some(PositionAccuracy::read(r)?); r.set(&mut e3, v.map(Box::new), 3151); }
0xb04bd => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1213); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2147);
let v = Self {
height_value: e0,
height_type: e1,
altitude_confidence: e2,
vertical_position_accuracy: e3,
height_coordinate_extension: e4,
};
r.close();
Ok(v)
}
}
impl HeightCoordinate {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.height_value {
Some(v) => { w.leaf("loc:heightValue", v)?; }
None => return Err(w.missing("loc:heightValue")),
}
if let Some(v) = &self.height_type { w.enumeration("loc:heightType", v.literal())?; }
if let Some(v) = &self.altitude_confidence { v.write(w, "loc:altitudeConfidence", "", "")?; }
if let Some(v) = &self.vertical_position_accuracy { v.write(w, "loc:verticalPositionAccuracy", "", "")?; }
if let Some(v) = &self.height_coordinate_extension { w.extension("loc:_heightCoordinateExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct IsoNamedArea {
pub named_area_extension: Option<Box<Extension>>,
pub area_name: Option<MultilingualString>,
pub named_area_type: Option<NamedAreaTypeEnum>,
pub country: Option<com::CountryCode>,
pub loc_named_area_extension: Option<Box<NamedAreaExtensionType>>,
pub subdivision_type: Option<SubdivisionTypeEnum>,
pub subdivision_code: Option<SubdivisionCode>,
pub iso_named_area_extension: Option<Box<Extension>>,
}
impl IsoNamedArea {
const FIELDS: &'static [u32] = &[0x304fa, 0xb06cd, 0xb094e, 0xb0747, 0xb04fa, 0xb0b8b, 0xb0b8a, 0xb04cd];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00e4);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x304fa => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1274); }
0xb06cd => { let v = r.multilingual()?; r.set(&mut e1, v, 1741); }
0xb094e => { let v = r.enumeration::<NamedAreaTypeEnum>()?; r.set(&mut e2, v, 2382); }
0xb0747 => { let v = r.string()?; r.set(&mut e3, v, 1863); }
0xb04fa => { let v = Some(NamedAreaExtensionType::read(r)?); r.set(&mut e4, v.map(Box::new), 1274); }
0xb0b8b => { let v = r.enumeration::<SubdivisionTypeEnum>()?; r.set(&mut e5, v, 2955); }
0xb0b8a => { let v = r.string()?; r.set(&mut e6, v, 2954); }
0xb04cd => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1229); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1741);
r.required(&e5, 2955);
r.required(&e6, 2954);
let v = Self {
named_area_extension: e0,
area_name: e1,
named_area_type: e2,
country: e3,
loc_named_area_extension: e4,
subdivision_type: e5,
subdivision_code: e6,
iso_named_area_extension: e7,
};
r.close();
Ok(v)
}
}
impl IsoNamedArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.named_area_extension { w.extension("com:_namedAreaExtension", v)?; }
match &self.area_name {
Some(v) => { w.multilingual("loc:areaName", v)?; }
None => return Err(w.missing("loc:areaName")),
}
if let Some(v) = &self.named_area_type { w.enumeration("loc:namedAreaType", v.literal())?; }
if let Some(v) = &self.country { w.max_len("country", v, 2)?; w.leaf("loc:country", v)?; }
if let Some(v) = &self.loc_named_area_extension { v.write(w, "loc:_namedAreaExtension", "", "")?; }
match &self.subdivision_type {
Some(v) => { w.enumeration("loc:subdivisionType", v.literal())?; }
None => return Err(w.missing("loc:subdivisionType")),
}
match &self.subdivision_code {
Some(v) => { w.max_len("subdivisionCode", v, 3)?; w.leaf("loc:subdivisionCode", v)?; }
None => return Err(w.missing("loc:subdivisionCode")),
}
if let Some(v) = &self.iso_named_area_extension { w.extension("loc:_isoNamedAreaExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ItineraryByIndexedLocations {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub route_destination: Vec<Destination>,
pub itinerary_extension: Option<Box<Extension>>,
pub location_contained_in_itinerary: Vec<LocationContainedInItinerary>,
pub itinerary_by_indexed_locations_extension: Option<Box<Extension>>,
}
impl ItineraryByIndexedLocations {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb0b10, 0xb04d0, 0xb08e0, 0xb04ce];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00e6);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb0b10 => { let v = Destination::read(r)?; e1.extend(v); }
0xb04d0 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1232); }
0xb08e0 => { let v = Some(LocationContainedInItinerary::read(r)?); e3.extend(v); }
0xb04ce => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1230); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
location_reference_extension: e0,
route_destination: e1,
itinerary_extension: e2,
location_contained_in_itinerary: e3,
itinerary_by_indexed_locations_extension: e4,
};
r.close();
Ok(v)
}
}
impl ItineraryByIndexedLocations {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
for v in &self.route_destination { v.write(w, "loc:routeDestination")?; }
if let Some(v) = &self.itinerary_extension { w.extension("loc:_itineraryExtension", v)?; }
for v in &self.location_contained_in_itinerary { v.write(w, "loc:locationContainedInItinerary", "", "")?; }
if let Some(v) = &self.itinerary_by_indexed_locations_extension { w.extension("loc:_itineraryByIndexedLocationsExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct ItineraryByReference {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub route_destination: Vec<Destination>,
pub itinerary_extension: Option<Box<Extension>>,
pub predefined_itinerary_reference: Option<Box<com::VersionedReference>>,
pub itinerary_by_reference_extension: Option<Box<Extension>>,
}
impl ItineraryByReference {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb0b10, 0xb04d0, 0xb0a62, 0xb04cf];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00e7);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb0b10 => { let v = Destination::read(r)?; e1.extend(v); }
0xb04d0 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1232); }
0xb0a62 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e3, v.map(Box::new), 2658); }
0xb04cf => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1231); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e3, 2658);
let v = Self {
location_reference_extension: e0,
route_destination: e1,
itinerary_extension: e2,
predefined_itinerary_reference: e3,
itinerary_by_reference_extension: e4,
};
r.close();
Ok(v)
}
}
impl ItineraryByReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
for v in &self.route_destination { v.write(w, "loc:routeDestination")?; }
if let Some(v) = &self.itinerary_extension { w.extension("loc:_itineraryExtension", v)?; }
match &self.predefined_itinerary_reference {
Some(v) => { v.write(w, "loc:predefinedItineraryReference", "", " targetClass=\"loc:PredefinedItinerary\"")?; }
None => return Err(w.missing("loc:predefinedItineraryReference")),
}
if let Some(v) = &self.itinerary_by_reference_extension { w.extension("loc:_itineraryByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Lane {
pub lane_number: Option<com::Integer>,
pub lane_usage: Option<LaneEnum>,
pub lane_extension: Option<Box<Extension>>,
}
impl Lane {
const FIELDS: &'static [u32] = &[0xb08ac, 0xb08ae, 0xb04d3];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00ea);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb08ac => { let v = r.value::<i64>()?; r.set(&mut e0, v, 2220); }
0xb08ae => { let v = r.enumeration::<LaneEnum>()?; r.set(&mut e1, v, 2222); }
0xb04d3 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1235); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
lane_number: e0,
lane_usage: e1,
lane_extension: e2,
};
r.close();
Ok(v)
}
}
impl Lane {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.lane_number { w.leaf("loc:laneNumber", v)?; }
if let Some(v) = &self.lane_usage { w.enumeration("loc:laneUsage", v.literal())?; }
if let Some(v) = &self.lane_extension { w.extension("loc:_laneExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LinearElement {
pub road_name: Option<MultilingualString>,
pub road_number: Option<String>,
pub linear_element_reference_model: Option<String>,
pub linear_element_reference_model_version: Option<String>,
pub linear_element_nature: Option<LinearElementNatureEnum>,
pub linear_element_extension: Option<Box<Extension>>,
}
impl LinearElement {
const FIELDS: &'static [u32] = &[0xb0af7, 0xb0af8, 0xb08d3, 0xb08d4, 0xb08d2, 0xb04d9];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00ed);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0af7 => { let v = r.multilingual()?; r.set(&mut e0, v, 2807); }
0xb0af8 => { let v = r.string()?; r.set(&mut e1, v, 2808); }
0xb08d3 => { let v = r.string()?; r.set(&mut e2, v, 2259); }
0xb08d4 => { let v = r.string()?; r.set(&mut e3, v, 2260); }
0xb08d2 => { let v = r.enumeration::<LinearElementNatureEnum>()?; r.set(&mut e4, v, 2258); }
0xb04d9 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1241); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
road_name: e0,
road_number: e1,
linear_element_reference_model: e2,
linear_element_reference_model_version: e3,
linear_element_nature: e4,
linear_element_extension: e5,
};
r.close();
Ok(v)
}
}
impl LinearElement {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.road_name { w.multilingual("loc:roadName", v)?; }
if let Some(v) = &self.road_number { w.max_len("roadNumber", v, 1024)?; w.leaf("loc:roadNumber", v)?; }
if let Some(v) = &self.linear_element_reference_model { w.max_len("linearElementReferenceModel", v, 1024)?; w.leaf("loc:linearElementReferenceModel", v)?; }
if let Some(v) = &self.linear_element_reference_model_version { w.max_len("linearElementReferenceModelVersion", v, 1024)?; w.leaf("loc:linearElementReferenceModelVersion", v)?; }
if let Some(v) = &self.linear_element_nature { w.enumeration("loc:linearElementNature", v.literal())?; }
if let Some(v) = &self.linear_element_extension { w.extension("loc:_linearElementExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LinearElementByCode {
pub road_name: Option<MultilingualString>,
pub road_number: Option<String>,
pub linear_element_reference_model: Option<String>,
pub linear_element_reference_model_version: Option<String>,
pub linear_element_nature: Option<LinearElementNatureEnum>,
pub linear_element_extension: Option<Box<Extension>>,
pub linear_element_identifier: Option<String>,
pub linear_element_by_code_extension: Option<Box<Extension>>,
}
impl LinearElementByCode {
const FIELDS: &'static [u32] = &[0xb0af7, 0xb0af8, 0xb08d3, 0xb08d4, 0xb08d2, 0xb04d9, 0xb08d1, 0xb04d6];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00ee);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0af7 => { let v = r.multilingual()?; r.set(&mut e0, v, 2807); }
0xb0af8 => { let v = r.string()?; r.set(&mut e1, v, 2808); }
0xb08d3 => { let v = r.string()?; r.set(&mut e2, v, 2259); }
0xb08d4 => { let v = r.string()?; r.set(&mut e3, v, 2260); }
0xb08d2 => { let v = r.enumeration::<LinearElementNatureEnum>()?; r.set(&mut e4, v, 2258); }
0xb04d9 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1241); }
0xb08d1 => { let v = r.string()?; r.set(&mut e6, v, 2257); }
0xb04d6 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1238); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e6, 2257);
let v = Self {
road_name: e0,
road_number: e1,
linear_element_reference_model: e2,
linear_element_reference_model_version: e3,
linear_element_nature: e4,
linear_element_extension: e5,
linear_element_identifier: e6,
linear_element_by_code_extension: e7,
};
r.close();
Ok(v)
}
}
impl LinearElementByCode {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.road_name { w.multilingual("loc:roadName", v)?; }
if let Some(v) = &self.road_number { w.max_len("roadNumber", v, 1024)?; w.leaf("loc:roadNumber", v)?; }
if let Some(v) = &self.linear_element_reference_model { w.max_len("linearElementReferenceModel", v, 1024)?; w.leaf("loc:linearElementReferenceModel", v)?; }
if let Some(v) = &self.linear_element_reference_model_version { w.max_len("linearElementReferenceModelVersion", v, 1024)?; w.leaf("loc:linearElementReferenceModelVersion", v)?; }
if let Some(v) = &self.linear_element_nature { w.enumeration("loc:linearElementNature", v.literal())?; }
if let Some(v) = &self.linear_element_extension { w.extension("loc:_linearElementExtension", v)?; }
match &self.linear_element_identifier {
Some(v) => { w.max_len("linearElementIdentifier", v, 1024)?; w.leaf("loc:linearElementIdentifier", v)?; }
None => return Err(w.missing("loc:linearElementIdentifier")),
}
if let Some(v) = &self.linear_element_by_code_extension { w.extension("loc:_linearElementByCodeExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LinearElementByLineString {
pub road_name: Option<MultilingualString>,
pub road_number: Option<String>,
pub linear_element_reference_model: Option<String>,
pub linear_element_reference_model_version: Option<String>,
pub linear_element_nature: Option<LinearElementNatureEnum>,
pub linear_element_extension: Option<Box<Extension>>,
pub gml_line_string: Option<AnyGmlLineString>,
pub linear_element_by_line_string_extension: Option<Box<Extension>>,
}
impl LinearElementByLineString {
const FIELDS: &'static [u32] = &[0xb0af7, 0xb0af8, 0xb08d3, 0xb08d4, 0xb08d2, 0xb04d9, 0xb0845, 0xb04d7];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00ef);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0af7 => { let v = r.multilingual()?; r.set(&mut e0, v, 2807); }
0xb0af8 => { let v = r.string()?; r.set(&mut e1, v, 2808); }
0xb08d3 => { let v = r.string()?; r.set(&mut e2, v, 2259); }
0xb08d4 => { let v = r.string()?; r.set(&mut e3, v, 2260); }
0xb08d2 => { let v = r.enumeration::<LinearElementNatureEnum>()?; r.set(&mut e4, v, 2258); }
0xb04d9 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1241); }
0xb0845 => { let v = AnyGmlLineString::read(r)?; r.set(&mut e6, v, 2117); }
0xb04d7 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1239); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e6, 2117);
let v = Self {
road_name: e0,
road_number: e1,
linear_element_reference_model: e2,
linear_element_reference_model_version: e3,
linear_element_nature: e4,
linear_element_extension: e5,
gml_line_string: e6,
linear_element_by_line_string_extension: e7,
};
r.close();
Ok(v)
}
}
impl LinearElementByLineString {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.road_name { w.multilingual("loc:roadName", v)?; }
if let Some(v) = &self.road_number { w.max_len("roadNumber", v, 1024)?; w.leaf("loc:roadNumber", v)?; }
if let Some(v) = &self.linear_element_reference_model { w.max_len("linearElementReferenceModel", v, 1024)?; w.leaf("loc:linearElementReferenceModel", v)?; }
if let Some(v) = &self.linear_element_reference_model_version { w.max_len("linearElementReferenceModelVersion", v, 1024)?; w.leaf("loc:linearElementReferenceModelVersion", v)?; }
if let Some(v) = &self.linear_element_nature { w.enumeration("loc:linearElementNature", v.literal())?; }
if let Some(v) = &self.linear_element_extension { w.extension("loc:_linearElementExtension", v)?; }
match &self.gml_line_string {
Some(v) => { v.write(w, "loc:gmlLineString")?; }
None => return Err(w.missing("loc:gmlLineString")),
}
if let Some(v) = &self.linear_element_by_line_string_extension { w.extension("loc:_linearElementByLineStringExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LinearElementByPoints {
pub road_name: Option<MultilingualString>,
pub road_number: Option<String>,
pub linear_element_reference_model: Option<String>,
pub linear_element_reference_model_version: Option<String>,
pub linear_element_nature: Option<LinearElementNatureEnum>,
pub linear_element_extension: Option<Box<Extension>>,
pub start_point_of_linear_element: Option<Box<Referent>>,
pub intermediate_point_on_linear_element: Vec<IntermediatePointOnLinearElement>,
pub end_point_of_linear_element: Option<Box<Referent>>,
pub linear_element_by_points_extension: Option<Box<Extension>>,
}
impl LinearElementByPoints {
const FIELDS: &'static [u32] = &[0xb0af7, 0xb0af8, 0xb08d3, 0xb08d4, 0xb08d2, 0xb04d9, 0xb0b6f, 0xb088f, 0xb07c8, 0xb04d8];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00f0);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0af7 => { let v = r.multilingual()?; r.set(&mut e0, v, 2807); }
0xb0af8 => { let v = r.string()?; r.set(&mut e1, v, 2808); }
0xb08d3 => { let v = r.string()?; r.set(&mut e2, v, 2259); }
0xb08d4 => { let v = r.string()?; r.set(&mut e3, v, 2260); }
0xb08d2 => { let v = r.enumeration::<LinearElementNatureEnum>()?; r.set(&mut e4, v, 2258); }
0xb04d9 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1241); }
0xb0b6f => { let v = Some(Referent::read(r)?); r.set(&mut e6, v.map(Box::new), 2927); }
0xb088f => { let v = Some(IntermediatePointOnLinearElement::read(r)?); e7.extend(v); }
0xb07c8 => { let v = Some(Referent::read(r)?); r.set(&mut e8, v.map(Box::new), 1992); }
0xb04d8 => { let v = r.raw()?; r.set(&mut e9, v.map(Box::new), 1240); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e6, 2927);
r.required(&e8, 1992);
let v = Self {
road_name: e0,
road_number: e1,
linear_element_reference_model: e2,
linear_element_reference_model_version: e3,
linear_element_nature: e4,
linear_element_extension: e5,
start_point_of_linear_element: e6,
intermediate_point_on_linear_element: e7,
end_point_of_linear_element: e8,
linear_element_by_points_extension: e9,
};
r.close();
Ok(v)
}
}
impl LinearElementByPoints {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.road_name { w.multilingual("loc:roadName", v)?; }
if let Some(v) = &self.road_number { w.max_len("roadNumber", v, 1024)?; w.leaf("loc:roadNumber", v)?; }
if let Some(v) = &self.linear_element_reference_model { w.max_len("linearElementReferenceModel", v, 1024)?; w.leaf("loc:linearElementReferenceModel", v)?; }
if let Some(v) = &self.linear_element_reference_model_version { w.max_len("linearElementReferenceModelVersion", v, 1024)?; w.leaf("loc:linearElementReferenceModelVersion", v)?; }
if let Some(v) = &self.linear_element_nature { w.enumeration("loc:linearElementNature", v.literal())?; }
if let Some(v) = &self.linear_element_extension { w.extension("loc:_linearElementExtension", v)?; }
match &self.start_point_of_linear_element {
Some(v) => { v.write(w, "loc:startPointOfLinearElement", "", "")?; }
None => return Err(w.missing("loc:startPointOfLinearElement")),
}
for v in &self.intermediate_point_on_linear_element { v.write(w, "loc:intermediatePointOnLinearElement", "", "")?; }
match &self.end_point_of_linear_element {
Some(v) => { v.write(w, "loc:endPointOfLinearElement", "", "")?; }
None => return Err(w.missing("loc:endPointOfLinearElement")),
}
if let Some(v) = &self.linear_element_by_points_extension { w.extension("loc:_linearElementByPointsExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LinearLocation {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub external_referencing: Vec<ExternalReferencing>,
pub coordinates_for_display: Option<Box<PointCoordinates>>,
pub location_extension: Option<Box<LocationExtensionType>>,
pub supplementary_positional_description: Option<Box<SupplementaryPositionalDescription>>,
pub destination: Option<Destination>,
pub network_location_extension: Option<Box<Extension>>,
pub openlr_linear: Option<Box<OpenlrLinear>>,
pub gml_line_string: Option<AnyGmlLineString>,
pub secondary_supplementary_description: Option<Box<SupplementaryPositionalDescription>>,
pub linear_location_extension: Option<Box<Extension>>,
}
impl LinearLocation {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb0809, 0xb0743, 0xb04df, 0xb0b94, 0xb0779, 0xb04fb, 0xb09b3, 0xb0845, 0xb0b1f, 0xb04da];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00f1);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb0809 => { let v = Some(ExternalReferencing::read(r)?); e1.extend(v); }
0xb0743 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e2, v.map(Box::new), 1859); }
0xb04df => { let v = Some(LocationExtensionType::read(r)?); r.set(&mut e3, v.map(Box::new), 1247); }
0xb0b94 => { let v = Some(SupplementaryPositionalDescription::read(r)?); r.set(&mut e4, v.map(Box::new), 2964); }
0xb0779 => { let v = Destination::read(r)?; r.set(&mut e5, v, 1913); }
0xb04fb => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1275); }
0xb09b3 => { let v = Some(OpenlrLinear::read(r)?); r.set(&mut e7, v.map(Box::new), 2483); }
0xb0845 => { let v = AnyGmlLineString::read(r)?; r.set(&mut e8, v, 2117); }
0xb0b1f => { let v = Some(SupplementaryPositionalDescription::read(r)?); r.set(&mut e9, v.map(Box::new), 2847); }
0xb04da => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1242); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
location_reference_extension: e0,
external_referencing: e1,
coordinates_for_display: e2,
location_extension: e3,
supplementary_positional_description: e4,
destination: e5,
network_location_extension: e6,
openlr_linear: e7,
gml_line_string: e8,
secondary_supplementary_description: e9,
linear_location_extension: e10,
};
r.close();
Ok(v)
}
}
impl LinearLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
for v in &self.external_referencing { v.write(w, "loc:externalReferencing", "", "")?; }
if let Some(v) = &self.coordinates_for_display { v.write(w, "loc:coordinatesForDisplay", "", "")?; }
if let Some(v) = &self.location_extension { v.write(w, "loc:_locationExtension", "", "")?; }
if let Some(v) = &self.supplementary_positional_description { v.write(w, "loc:supplementaryPositionalDescription", "", "")?; }
if let Some(v) = &self.destination { v.write(w, "loc:destination")?; }
if let Some(v) = &self.network_location_extension { w.extension("loc:_networkLocationExtension", v)?; }
if let Some(v) = &self.openlr_linear { v.write(w, "loc:openlrLinear", "", "")?; }
if let Some(v) = &self.gml_line_string { v.write(w, "loc:gmlLineString")?; }
if let Some(v) = &self.secondary_supplementary_description { v.write(w, "loc:secondarySupplementaryDescription", "", "")?; }
if let Some(v) = &self.linear_location_extension { w.extension("loc:_linearLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LinearWithinLinearElement {
pub administrative_area_of_linear_section: Option<MultilingualString>,
pub direction_on_linear_section: Option<DirectionEnum>,
pub direction_relative_on_linear_section: Option<LinearDirectionEnum>,
pub height_grade_of_linear_section: Option<HeightGradeEnum>,
pub linear_element: Option<AnyLinearElement>,
pub from_point: Option<DistanceAlongLinearElement>,
pub to_point: Option<DistanceAlongLinearElement>,
pub linear_within_linear_element_extension: Option<Box<Extension>>,
}
impl LinearWithinLinearElement {
const FIELDS: &'static [u32] = &[0xb0695, 0xb078b, 0xb078e, 0xb0860, 0xb08d0, 0xb0833, 0xb0bc7, 0xb04db];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00f2);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0695 => { let v = r.multilingual()?; r.set(&mut e0, v, 1685); }
0xb078b => { let v = r.enumeration::<DirectionEnum>()?; r.set(&mut e1, v, 1931); }
0xb078e => { let v = r.enumeration::<LinearDirectionEnum>()?; r.set(&mut e2, v, 1934); }
0xb0860 => { let v = r.enumeration::<HeightGradeEnum>()?; r.set(&mut e3, v, 2144); }
0xb08d0 => { let v = AnyLinearElement::read(r)?; r.set(&mut e4, v, 2256); }
0xb0833 => { let v = DistanceAlongLinearElement::read(r)?; r.set(&mut e5, v, 2099); }
0xb0bc7 => { let v = DistanceAlongLinearElement::read(r)?; r.set(&mut e6, v, 3015); }
0xb04db => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1243); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2256);
r.required(&e5, 2099);
r.required(&e6, 3015);
let v = Self {
administrative_area_of_linear_section: e0,
direction_on_linear_section: e1,
direction_relative_on_linear_section: e2,
height_grade_of_linear_section: e3,
linear_element: e4,
from_point: e5,
to_point: e6,
linear_within_linear_element_extension: e7,
};
r.close();
Ok(v)
}
}
impl LinearWithinLinearElement {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.administrative_area_of_linear_section { w.multilingual("loc:administrativeAreaOfLinearSection", v)?; }
if let Some(v) = &self.direction_on_linear_section { w.enumeration("loc:directionOnLinearSection", v.literal())?; }
if let Some(v) = &self.direction_relative_on_linear_section { w.enumeration("loc:directionRelativeOnLinearSection", v.literal())?; }
if let Some(v) = &self.height_grade_of_linear_section { w.enumeration("loc:heightGradeOfLinearSection", v.literal())?; }
match &self.linear_element {
Some(v) => { v.write(w, "loc:linearElement")?; }
None => return Err(w.missing("loc:linearElement")),
}
match &self.from_point {
Some(v) => { v.write(w, "loc:fromPoint")?; }
None => return Err(w.missing("loc:fromPoint")),
}
match &self.to_point {
Some(v) => { v.write(w, "loc:toPoint")?; }
None => return Err(w.missing("loc:toPoint")),
}
if let Some(v) = &self.linear_within_linear_element_extension { w.extension("loc:_linearWithinLinearElementExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LocationByReference {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub external_referencing: Vec<ExternalReferencing>,
pub coordinates_for_display: Option<Box<PointCoordinates>>,
pub location_extension: Option<Box<LocationExtensionType>>,
pub predefined_location_reference: Option<Box<com::VersionedReference>>,
pub location_by_reference_extension: Option<Box<Extension>>,
}
impl LocationByReference {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb0809, 0xb0743, 0xb04df, 0xb0a67, 0xb04dd];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00f5);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb0809 => { let v = Some(ExternalReferencing::read(r)?); e1.extend(v); }
0xb0743 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e2, v.map(Box::new), 1859); }
0xb04df => { let v = Some(LocationExtensionType::read(r)?); r.set(&mut e3, v.map(Box::new), 1247); }
0xb0a67 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e4, v.map(Box::new), 2663); }
0xb04dd => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1245); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2663);
let v = Self {
location_reference_extension: e0,
external_referencing: e1,
coordinates_for_display: e2,
location_extension: e3,
predefined_location_reference: e4,
location_by_reference_extension: e5,
};
r.close();
Ok(v)
}
}
impl LocationByReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
for v in &self.external_referencing { v.write(w, "loc:externalReferencing", "", "")?; }
if let Some(v) = &self.coordinates_for_display { v.write(w, "loc:coordinatesForDisplay", "", "")?; }
if let Some(v) = &self.location_extension { v.write(w, "loc:_locationExtension", "", "")?; }
match &self.predefined_location_reference {
Some(v) => { v.write(w, "loc:predefinedLocationReference", "", " targetClass=\"loc:PredefinedLocation\"")?; }
None => return Err(w.missing("loc:predefinedLocationReference")),
}
if let Some(v) = &self.location_by_reference_extension { w.extension("loc:_locationByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LocationGroupByList {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub location_group_extension: Option<Box<Extension>>,
pub location_contained_in_group: Vec<Location>,
pub location_group_by_list_extension: Option<Box<Extension>>,
}
impl LocationGroupByList {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb04e2, 0xb08df, 0xb04e0];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00f8);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb04e2 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1250); }
0xb08df => { let v = Location::read(r)?; e2.extend(v); }
0xb04e0 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1248); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
location_reference_extension: e0,
location_group_extension: e1,
location_contained_in_group: e2,
location_group_by_list_extension: e3,
};
r.close();
Ok(v)
}
}
impl LocationGroupByList {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
if let Some(v) = &self.location_group_extension { w.extension("loc:_locationGroupExtension", v)?; }
w.count("loc:locationContainedInGroup", self.location_contained_in_group.len(), 2, usize::MAX)?;
for v in &self.location_contained_in_group { v.write(w, "loc:locationContainedInGroup")?; }
if let Some(v) = &self.location_group_by_list_extension { w.extension("loc:_locationGroupByListExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LocationGroupByReference {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub location_group_extension: Option<Box<Extension>>,
pub predefined_location_group_reference: Option<Box<com::VersionedReference>>,
pub location_group_by_reference_extension: Option<Box<Extension>>,
}
impl LocationGroupByReference {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb04e2, 0xb0a65, 0xb04e1];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb00f9);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb04e2 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1250); }
0xb0a65 => { let v = Some(com::VersionedReference::read(r)?); r.set(&mut e2, v.map(Box::new), 2661); }
0xb04e1 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1249); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2661);
let v = Self {
location_reference_extension: e0,
location_group_extension: e1,
predefined_location_group_reference: e2,
location_group_by_reference_extension: e3,
};
r.close();
Ok(v)
}
}
impl LocationGroupByReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
if let Some(v) = &self.location_group_extension { w.extension("loc:_locationGroupExtension", v)?; }
match &self.predefined_location_group_reference {
Some(v) => { v.write(w, "loc:predefinedLocationGroupReference", "", " targetClass=\"loc:PredefinedLocationGroup\"")?; }
None => return Err(w.missing("loc:predefinedLocationGroupReference")),
}
if let Some(v) = &self.location_group_by_reference_extension { w.extension("loc:_locationGroupByReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct NamedArea {
pub named_area_extension: Option<Box<Extension>>,
pub area_name: Option<MultilingualString>,
pub named_area_type: Option<NamedAreaTypeEnum>,
pub country: Option<com::CountryCode>,
pub loc_named_area_extension: Option<Box<NamedAreaExtensionType>>,
}
impl NamedArea {
const FIELDS: &'static [u32] = &[0x304fa, 0xb06cd, 0xb094e, 0xb0747, 0xb04fa];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0113);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x304fa => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1274); }
0xb06cd => { let v = r.multilingual()?; r.set(&mut e1, v, 1741); }
0xb094e => { let v = r.enumeration::<NamedAreaTypeEnum>()?; r.set(&mut e2, v, 2382); }
0xb0747 => { let v = r.string()?; r.set(&mut e3, v, 1863); }
0xb04fa => { let v = Some(NamedAreaExtensionType::read(r)?); r.set(&mut e4, v.map(Box::new), 1274); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1741);
let v = Self {
named_area_extension: e0,
area_name: e1,
named_area_type: e2,
country: e3,
loc_named_area_extension: e4,
};
r.close();
Ok(v)
}
}
impl NamedArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.named_area_extension { w.extension("com:_namedAreaExtension", v)?; }
match &self.area_name {
Some(v) => { w.multilingual("loc:areaName", v)?; }
None => return Err(w.missing("loc:areaName")),
}
if let Some(v) = &self.named_area_type { w.enumeration("loc:namedAreaType", v.literal())?; }
if let Some(v) = &self.country { w.max_len("country", v, 2)?; w.leaf("loc:country", v)?; }
if let Some(v) = &self.loc_named_area_extension { v.write(w, "loc:_namedAreaExtension", "", "")?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct NutsNamedArea {
pub named_area_extension: Option<Box<Extension>>,
pub area_name: Option<MultilingualString>,
pub named_area_type: Option<NamedAreaTypeEnum>,
pub country: Option<com::CountryCode>,
pub loc_named_area_extension: Option<Box<NamedAreaExtensionType>>,
pub nuts_code_type: Option<NutsCodeTypeEnum>,
pub nuts_code: Option<NutsCode>,
pub nuts_named_area_extension: Option<Box<Extension>>,
}
impl NutsNamedArea {
const FIELDS: &'static [u32] = &[0x304fa, 0xb06cd, 0xb094e, 0xb0747, 0xb04fa, 0xb0995, 0xb0994, 0xb050b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0126);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x304fa => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1274); }
0xb06cd => { let v = r.multilingual()?; r.set(&mut e1, v, 1741); }
0xb094e => { let v = r.enumeration::<NamedAreaTypeEnum>()?; r.set(&mut e2, v, 2382); }
0xb0747 => { let v = r.string()?; r.set(&mut e3, v, 1863); }
0xb04fa => { let v = Some(NamedAreaExtensionType::read(r)?); r.set(&mut e4, v.map(Box::new), 1274); }
0xb0995 => { let v = r.enumeration::<NutsCodeTypeEnum>()?; r.set(&mut e5, v, 2453); }
0xb0994 => { let v = r.string()?; r.set(&mut e6, v, 2452); }
0xb050b => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1291); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 1741);
r.required(&e5, 2453);
r.required(&e6, 2452);
let v = Self {
named_area_extension: e0,
area_name: e1,
named_area_type: e2,
country: e3,
loc_named_area_extension: e4,
nuts_code_type: e5,
nuts_code: e6,
nuts_named_area_extension: e7,
};
r.close();
Ok(v)
}
}
impl NutsNamedArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.named_area_extension { w.extension("com:_namedAreaExtension", v)?; }
match &self.area_name {
Some(v) => { w.multilingual("loc:areaName", v)?; }
None => return Err(w.missing("loc:areaName")),
}
if let Some(v) = &self.named_area_type { w.enumeration("loc:namedAreaType", v.literal())?; }
if let Some(v) = &self.country { w.max_len("country", v, 2)?; w.leaf("loc:country", v)?; }
if let Some(v) = &self.loc_named_area_extension { v.write(w, "loc:_namedAreaExtension", "", "")?; }
match &self.nuts_code_type {
Some(v) => { w.enumeration("loc:nutsCodeType", v.literal())?; }
None => return Err(w.missing("loc:nutsCodeType")),
}
match &self.nuts_code {
Some(v) => { w.max_len("nutsCode", v, 5)?; w.leaf("loc:nutsCode", v)?; }
None => return Err(w.missing("loc:nutsCode")),
}
if let Some(v) = &self.nuts_named_area_extension { w.extension("loc:_nutsNamedAreaExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OffsetDistance {
pub offset_distance: Option<com::MetresAsNonNegativeInteger>,
pub offset_distance_extension: Option<Box<Extension>>,
}
impl OffsetDistance {
const FIELDS: &'static [u32] = &[0xb09a5, 0xb0512];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb012d);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09a5 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2469); }
0xb0512 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1298); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2469);
let v = Self {
offset_distance: e0,
offset_distance_extension: e1,
};
r.close();
Ok(v)
}
}
impl OffsetDistance {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.offset_distance {
Some(v) => { w.leaf("loc:offsetDistance", v)?; }
None => return Err(w.missing("loc:offsetDistance")),
}
if let Some(v) = &self.offset_distance_extension { w.extension("loc:_offsetDistanceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrCircleLocationReference {
pub openlr_area_location_reference_extension: Option<Box<Extension>>,
pub openlr_radius: Option<com::MetresAsNonNegativeInteger>,
pub openlr_geo_coordinate: Option<Box<OpenlrGeoCoordinate>>,
pub openlr_circle_location_reference_extension: Option<Box<Extension>>,
}
impl OpenlrCircleLocationReference {
const FIELDS: &'static [u32] = &[0xb0514, 0xb09c0, 0xb09af, 0xb0517];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0132);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0514 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1300); }
0xb09c0 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2496); }
0xb09af => { let v = Some(OpenlrGeoCoordinate::read(r)?); r.set(&mut e2, v.map(Box::new), 2479); }
0xb0517 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1303); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2496);
r.required(&e2, 2479);
let v = Self {
openlr_area_location_reference_extension: e0,
openlr_radius: e1,
openlr_geo_coordinate: e2,
openlr_circle_location_reference_extension: e3,
};
r.close();
Ok(v)
}
}
impl OpenlrCircleLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_area_location_reference_extension { w.extension("loc:_openlrAreaLocationReferenceExtension", v)?; }
match &self.openlr_radius {
Some(v) => { w.leaf("loc:openlrRadius", v)?; }
None => return Err(w.missing("loc:openlrRadius")),
}
match &self.openlr_geo_coordinate {
Some(v) => { v.write(w, "loc:openlrGeoCoordinate", "", "")?; }
None => return Err(w.missing("loc:openlrGeoCoordinate")),
}
if let Some(v) = &self.openlr_circle_location_reference_extension { w.extension("loc:_openlrCircleLocationReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrClosedLineLocationReference {
pub openlr_area_location_reference_extension: Option<Box<Extension>>,
pub openlr_location_reference_point: Vec<OpenlrLocationReferencePoint>,
pub openlr_last_line: Option<Box<OpenlrLastLocationReferencePoint>>,
pub openlr_closed_line_location_reference_extension: Option<Box<Extension>>,
}
impl OpenlrClosedLineLocationReference {
const FIELDS: &'static [u32] = &[0xb0514, 0xb09b4, 0xb09b0, 0xb0518];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0133);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0514 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1300); }
0xb09b4 => { let v = Some(OpenlrLocationReferencePoint::read(r)?); e1.extend(v); }
0xb09b0 => { let v = Some(OpenlrLastLocationReferencePoint::read(r)?); r.set(&mut e2, v.map(Box::new), 2480); }
0xb0518 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1304); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2480);
let v = Self {
openlr_area_location_reference_extension: e0,
openlr_location_reference_point: e1,
openlr_last_line: e2,
openlr_closed_line_location_reference_extension: e3,
};
r.close();
Ok(v)
}
}
impl OpenlrClosedLineLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_area_location_reference_extension { w.extension("loc:_openlrAreaLocationReferenceExtension", v)?; }
w.count("loc:openlrLocationReferencePoint", self.openlr_location_reference_point.len(), 1, usize::MAX)?;
for v in &self.openlr_location_reference_point { v.write(w, "loc:openlrLocationReferencePoint", "", "")?; }
match &self.openlr_last_line {
Some(v) => { v.write(w, "loc:openlrLastLine", "", "")?; }
None => return Err(w.missing("loc:openlrLastLine")),
}
if let Some(v) = &self.openlr_closed_line_location_reference_extension { w.extension("loc:_openlrClosedLineLocationReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrGeoCoordinate {
pub openlr_point_location_reference_extension: Option<Box<Extension>>,
pub openlr_coordinates: Option<Box<PointCoordinates>>,
pub openlr_geo_coordinate_extension: Option<Box<Extension>>,
}
impl OpenlrGeoCoordinate {
const FIELDS: &'static [u32] = &[0xb0524, 0xb09ab, 0xb0519];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0134);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0524 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1316); }
0xb09ab => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e1, v.map(Box::new), 2475); }
0xb0519 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1305); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2475);
let v = Self {
openlr_point_location_reference_extension: e0,
openlr_coordinates: e1,
openlr_geo_coordinate_extension: e2,
};
r.close();
Ok(v)
}
}
impl OpenlrGeoCoordinate {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_point_location_reference_extension { w.extension("loc:_openlrPointLocationReferenceExtension", v)?; }
match &self.openlr_coordinates {
Some(v) => { v.write(w, "loc:openlrCoordinates", "", "")?; }
None => return Err(w.missing("loc:openlrCoordinates")),
}
if let Some(v) = &self.openlr_geo_coordinate_extension { w.extension("loc:_openlrGeoCoordinateExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrGridLocationReference {
pub openlr_area_location_reference_extension: Option<Box<Extension>>,
pub openlr_num_columns: Option<com::NonNegativeInteger>,
pub openlr_num_rows: Option<com::NonNegativeInteger>,
pub openlr_rectangle: Option<Box<OpenlrRectangle>>,
pub openlr_grid_location_reference_extension: Option<Box<Extension>>,
}
impl OpenlrGridLocationReference {
const FIELDS: &'static [u32] = &[0xb0514, 0xb09b8, 0xb09b9, 0xb09c1, 0xb051a];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0135);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0514 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1300); }
0xb09b8 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2488); }
0xb09b9 => { let v = r.value::<u64>()?; r.set(&mut e2, v, 2489); }
0xb09c1 => { let v = Some(OpenlrRectangle::read(r)?); r.set(&mut e3, v.map(Box::new), 2497); }
0xb051a => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1306); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2488);
r.required(&e2, 2489);
r.required(&e3, 2497);
let v = Self {
openlr_area_location_reference_extension: e0,
openlr_num_columns: e1,
openlr_num_rows: e2,
openlr_rectangle: e3,
openlr_grid_location_reference_extension: e4,
};
r.close();
Ok(v)
}
}
impl OpenlrGridLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_area_location_reference_extension { w.extension("loc:_openlrAreaLocationReferenceExtension", v)?; }
match &self.openlr_num_columns {
Some(v) => { w.leaf("loc:openlrNumColumns", v)?; }
None => return Err(w.missing("loc:openlrNumColumns")),
}
match &self.openlr_num_rows {
Some(v) => { w.leaf("loc:openlrNumRows", v)?; }
None => return Err(w.missing("loc:openlrNumRows")),
}
match &self.openlr_rectangle {
Some(v) => { v.write(w, "loc:openlrRectangle", "", "")?; }
None => return Err(w.missing("loc:openlrRectangle")),
}
if let Some(v) = &self.openlr_grid_location_reference_extension { w.extension("loc:_openlrGridLocationReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrLastLocationReferencePoint {
pub openlr_coordinates: Option<Box<PointCoordinates>>,
pub openlr_line_attributes: Option<Box<OpenlrLineAttributes>>,
pub openlr_base_reference_point_extension: Option<Box<Extension>>,
pub openlr_last_location_reference_point_extension: Option<Box<Extension>>,
}
impl OpenlrLastLocationReferencePoint {
const FIELDS: &'static [u32] = &[0xb09ab, 0xb09b2, 0xb0516, 0xb051b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0136);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09ab => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e0, v.map(Box::new), 2475); }
0xb09b2 => { let v = Some(OpenlrLineAttributes::read(r)?); r.set(&mut e1, v.map(Box::new), 2482); }
0xb0516 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1302); }
0xb051b => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1307); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2475);
r.required(&e1, 2482);
let v = Self {
openlr_coordinates: e0,
openlr_line_attributes: e1,
openlr_base_reference_point_extension: e2,
openlr_last_location_reference_point_extension: e3,
};
r.close();
Ok(v)
}
}
impl OpenlrLastLocationReferencePoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.openlr_coordinates {
Some(v) => { v.write(w, "loc:openlrCoordinates", "", "")?; }
None => return Err(w.missing("loc:openlrCoordinates")),
}
match &self.openlr_line_attributes {
Some(v) => { v.write(w, "loc:openlrLineAttributes", "", "")?; }
None => return Err(w.missing("loc:openlrLineAttributes")),
}
if let Some(v) = &self.openlr_base_reference_point_extension { w.extension("loc:_openlrBaseReferencePointExtension", v)?; }
if let Some(v) = &self.openlr_last_location_reference_point_extension { w.extension("loc:_openlrLastLocationReferencePointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrLineAttributes {
pub openlr_functional_road_class: Option<OpenlrFunctionalRoadClassEnum>,
pub openlr_form_of_way: Option<OpenlrFormOfWayEnum>,
pub openlr_bearing: Option<com::AngleInDegrees>,
pub openlr_line_attributes_extension: Option<Box<Extension>>,
}
impl OpenlrLineAttributes {
const FIELDS: &'static [u32] = &[0xb09ae, 0xb09ad, 0xb09aa, 0xb051c];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0137);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09ae => { let v = r.enumeration::<OpenlrFunctionalRoadClassEnum>()?; r.set(&mut e0, v, 2478); }
0xb09ad => { let v = r.enumeration::<OpenlrFormOfWayEnum>()?; r.set(&mut e1, v, 2477); }
0xb09aa => { let v = r.value::<u64>()?; r.set(&mut e2, v, 2474); }
0xb051c => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1308); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2478);
r.required(&e1, 2477);
r.required(&e2, 2474);
let v = Self {
openlr_functional_road_class: e0,
openlr_form_of_way: e1,
openlr_bearing: e2,
openlr_line_attributes_extension: e3,
};
r.close();
Ok(v)
}
}
impl OpenlrLineAttributes {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.openlr_functional_road_class {
Some(v) => { w.enumeration("loc:openlrFunctionalRoadClass", v.literal())?; }
None => return Err(w.missing("loc:openlrFunctionalRoadClass")),
}
match &self.openlr_form_of_way {
Some(v) => { w.enumeration("loc:openlrFormOfWay", v.literal())?; }
None => return Err(w.missing("loc:openlrFormOfWay")),
}
match &self.openlr_bearing {
Some(v) => { w.range("openlrBearing", *v, 0, 359)?; w.leaf("loc:openlrBearing", v)?; }
None => return Err(w.missing("loc:openlrBearing")),
}
if let Some(v) = &self.openlr_line_attributes_extension { w.extension("loc:_openlrLineAttributesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrLineLocationReference {
pub openlr_location_reference_point: Vec<OpenlrLocationReferencePoint>,
pub openlr_last_location_reference_point: Option<Box<OpenlrLastLocationReferencePoint>>,
pub openlr_offsets: Option<Box<OpenlrOffsets>>,
pub openlr_line_location_reference_extension: Option<Box<Extension>>,
}
impl OpenlrLineLocationReference {
const FIELDS: &'static [u32] = &[0xb09b4, 0xb09b1, 0xb09ba, 0xb051d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0138);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09b4 => { let v = Some(OpenlrLocationReferencePoint::read(r)?); e0.extend(v); }
0xb09b1 => { let v = Some(OpenlrLastLocationReferencePoint::read(r)?); r.set(&mut e1, v.map(Box::new), 2481); }
0xb09ba => { let v = Some(OpenlrOffsets::read(r)?); r.set(&mut e2, v.map(Box::new), 2490); }
0xb051d => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1309); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2481);
let v = Self {
openlr_location_reference_point: e0,
openlr_last_location_reference_point: e1,
openlr_offsets: e2,
openlr_line_location_reference_extension: e3,
};
r.close();
Ok(v)
}
}
impl OpenlrLineLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("loc:openlrLocationReferencePoint", self.openlr_location_reference_point.len(), 1, usize::MAX)?;
for v in &self.openlr_location_reference_point { v.write(w, "loc:openlrLocationReferencePoint", "", "")?; }
match &self.openlr_last_location_reference_point {
Some(v) => { v.write(w, "loc:openlrLastLocationReferencePoint", "", "")?; }
None => return Err(w.missing("loc:openlrLastLocationReferencePoint")),
}
if let Some(v) = &self.openlr_offsets { v.write(w, "loc:openlrOffsets", "", "")?; }
if let Some(v) = &self.openlr_line_location_reference_extension { w.extension("loc:_openlrLineLocationReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrLinear {
pub first_direction: Option<Box<OpenlrLineLocationReference>>,
pub opposite_direction: Option<Box<OpenlrLineLocationReference>>,
pub openlr_linear_extension: Option<Box<Extension>>,
}
impl OpenlrLinear {
const FIELDS: &'static [u32] = &[0xb0821, 0xb09d8, 0xb051e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0139);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0821 => { let v = Some(OpenlrLineLocationReference::read(r)?); r.set(&mut e0, v.map(Box::new), 2081); }
0xb09d8 => { let v = Some(OpenlrLineLocationReference::read(r)?); r.set(&mut e1, v.map(Box::new), 2520); }
0xb051e => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1310); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2081);
let v = Self {
first_direction: e0,
opposite_direction: e1,
openlr_linear_extension: e2,
};
r.close();
Ok(v)
}
}
impl OpenlrLinear {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.first_direction {
Some(v) => { v.write(w, "loc:firstDirection", "", "")?; }
None => return Err(w.missing("loc:firstDirection")),
}
if let Some(v) = &self.opposite_direction { v.write(w, "loc:oppositeDirection", "", "")?; }
if let Some(v) = &self.openlr_linear_extension { w.extension("loc:_openlrLinearExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrLocationReferencePoint {
pub openlr_coordinates: Option<Box<PointCoordinates>>,
pub openlr_line_attributes: Option<Box<OpenlrLineAttributes>>,
pub openlr_base_reference_point_extension: Option<Box<Extension>>,
pub openlr_path_attributes: Option<Box<OpenlrPathAttributes>>,
pub openlr_location_reference_point_extension: Option<Box<Extension>>,
}
impl OpenlrLocationReferencePoint {
const FIELDS: &'static [u32] = &[0xb09ab, 0xb09b2, 0xb0516, 0xb09bc, 0xb051f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb013a);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09ab => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e0, v.map(Box::new), 2475); }
0xb09b2 => { let v = Some(OpenlrLineAttributes::read(r)?); r.set(&mut e1, v.map(Box::new), 2482); }
0xb0516 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1302); }
0xb09bc => { let v = Some(OpenlrPathAttributes::read(r)?); r.set(&mut e3, v.map(Box::new), 2492); }
0xb051f => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1311); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2475);
r.required(&e1, 2482);
r.required(&e3, 2492);
let v = Self {
openlr_coordinates: e0,
openlr_line_attributes: e1,
openlr_base_reference_point_extension: e2,
openlr_path_attributes: e3,
openlr_location_reference_point_extension: e4,
};
r.close();
Ok(v)
}
}
impl OpenlrLocationReferencePoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.openlr_coordinates {
Some(v) => { v.write(w, "loc:openlrCoordinates", "", "")?; }
None => return Err(w.missing("loc:openlrCoordinates")),
}
match &self.openlr_line_attributes {
Some(v) => { v.write(w, "loc:openlrLineAttributes", "", "")?; }
None => return Err(w.missing("loc:openlrLineAttributes")),
}
if let Some(v) = &self.openlr_base_reference_point_extension { w.extension("loc:_openlrBaseReferencePointExtension", v)?; }
match &self.openlr_path_attributes {
Some(v) => { v.write(w, "loc:openlrPathAttributes", "", "")?; }
None => return Err(w.missing("loc:openlrPathAttributes")),
}
if let Some(v) = &self.openlr_location_reference_point_extension { w.extension("loc:_openlrLocationReferencePointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrOffsets {
pub openlr_positive_offset: Option<com::MetresAsNonNegativeInteger>,
pub openlr_negative_offset: Option<com::MetresAsNonNegativeInteger>,
pub openlr_offsets_extension: Option<Box<Extension>>,
}
impl OpenlrOffsets {
const FIELDS: &'static [u32] = &[0xb09bf, 0xb09b7, 0xb0520];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb013b);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09bf => { let v = r.value::<u64>()?; r.set(&mut e0, v, 2495); }
0xb09b7 => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2487); }
0xb0520 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1312); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
openlr_positive_offset: e0,
openlr_negative_offset: e1,
openlr_offsets_extension: e2,
};
r.close();
Ok(v)
}
}
impl OpenlrOffsets {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_positive_offset { w.leaf("loc:openlrPositiveOffset", v)?; }
if let Some(v) = &self.openlr_negative_offset { w.leaf("loc:openlrNegativeOffset", v)?; }
if let Some(v) = &self.openlr_offsets_extension { w.extension("loc:_openlrOffsetsExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrPathAttributes {
pub openlr_lowest_frc_to_next_lr_point: Option<OpenlrFunctionalRoadClassEnum>,
pub openlr_distance_to_next_lr_point: Option<com::NonNegativeInteger>,
pub openlr_path_attributes_extension: Option<Box<Extension>>,
}
impl OpenlrPathAttributes {
const FIELDS: &'static [u32] = &[0xb09b6, 0xb09ac, 0xb0521];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb013c);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09b6 => { let v = r.enumeration::<OpenlrFunctionalRoadClassEnum>()?; r.set(&mut e0, v, 2486); }
0xb09ac => { let v = r.value::<u64>()?; r.set(&mut e1, v, 2476); }
0xb0521 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1313); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2486);
r.required(&e1, 2476);
let v = Self {
openlr_lowest_frc_to_next_lr_point: e0,
openlr_distance_to_next_lr_point: e1,
openlr_path_attributes_extension: e2,
};
r.close();
Ok(v)
}
}
impl OpenlrPathAttributes {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.openlr_lowest_frc_to_next_lr_point {
Some(v) => { w.enumeration("loc:openlrLowestFrcToNextLRPoint", v.literal())?; }
None => return Err(w.missing("loc:openlrLowestFrcToNextLRPoint")),
}
match &self.openlr_distance_to_next_lr_point {
Some(v) => { w.leaf("loc:openlrDistanceToNextLRPoint", v)?; }
None => return Err(w.missing("loc:openlrDistanceToNextLRPoint")),
}
if let Some(v) = &self.openlr_path_attributes_extension { w.extension("loc:_openlrPathAttributesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrPoiWithAccessPoint {
pub openlr_point_location_reference_extension: Option<Box<Extension>>,
pub openlr_side_of_road: Option<OpenlrSideOfRoadEnum>,
pub openlr_orientation: Option<OpenlrOrientationEnum>,
pub openlr_location_reference_point: Option<Box<OpenlrLocationReferencePoint>>,
pub openlr_last_location_reference_point: Option<Box<OpenlrLastLocationReferencePoint>>,
pub openlr_offsets: Option<Box<OpenlrOffsets>>,
pub openlr_base_point_location_extension: Option<Box<Extension>>,
pub openlr_coordinates: Option<Box<PointCoordinates>>,
pub openlr_poi_with_access_point_extension: Option<Box<Extension>>,
}
impl OpenlrPoiWithAccessPoint {
const FIELDS: &'static [u32] = &[0xb0524, 0xb09c2, 0xb09bb, 0xb09b4, 0xb09b1, 0xb09ba, 0xb0515, 0xb09ab, 0xb0522];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb013d);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0524 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1316); }
0xb09c2 => { let v = r.enumeration::<OpenlrSideOfRoadEnum>()?; r.set(&mut e1, v, 2498); }
0xb09bb => { let v = r.enumeration::<OpenlrOrientationEnum>()?; r.set(&mut e2, v, 2491); }
0xb09b4 => { let v = Some(OpenlrLocationReferencePoint::read(r)?); r.set(&mut e3, v.map(Box::new), 2484); }
0xb09b1 => { let v = Some(OpenlrLastLocationReferencePoint::read(r)?); r.set(&mut e4, v.map(Box::new), 2481); }
0xb09ba => { let v = Some(OpenlrOffsets::read(r)?); r.set(&mut e5, v.map(Box::new), 2490); }
0xb0515 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1301); }
0xb09ab => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e7, v.map(Box::new), 2475); }
0xb0522 => { let v = r.raw()?; r.set(&mut e8, v.map(Box::new), 1314); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2498);
r.required(&e2, 2491);
r.required(&e3, 2484);
r.required(&e4, 2481);
r.required(&e7, 2475);
let v = Self {
openlr_point_location_reference_extension: e0,
openlr_side_of_road: e1,
openlr_orientation: e2,
openlr_location_reference_point: e3,
openlr_last_location_reference_point: e4,
openlr_offsets: e5,
openlr_base_point_location_extension: e6,
openlr_coordinates: e7,
openlr_poi_with_access_point_extension: e8,
};
r.close();
Ok(v)
}
}
impl OpenlrPoiWithAccessPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_point_location_reference_extension { w.extension("loc:_openlrPointLocationReferenceExtension", v)?; }
match &self.openlr_side_of_road {
Some(v) => { w.enumeration("loc:openlrSideOfRoad", v.literal())?; }
None => return Err(w.missing("loc:openlrSideOfRoad")),
}
match &self.openlr_orientation {
Some(v) => { w.enumeration("loc:openlrOrientation", v.literal())?; }
None => return Err(w.missing("loc:openlrOrientation")),
}
match &self.openlr_location_reference_point {
Some(v) => { v.write(w, "loc:openlrLocationReferencePoint", "", "")?; }
None => return Err(w.missing("loc:openlrLocationReferencePoint")),
}
match &self.openlr_last_location_reference_point {
Some(v) => { v.write(w, "loc:openlrLastLocationReferencePoint", "", "")?; }
None => return Err(w.missing("loc:openlrLastLocationReferencePoint")),
}
if let Some(v) = &self.openlr_offsets { v.write(w, "loc:openlrOffsets", "", "")?; }
if let Some(v) = &self.openlr_base_point_location_extension { w.extension("loc:_openlrBasePointLocationExtension", v)?; }
match &self.openlr_coordinates {
Some(v) => { v.write(w, "loc:openlrCoordinates", "", "")?; }
None => return Err(w.missing("loc:openlrCoordinates")),
}
if let Some(v) = &self.openlr_poi_with_access_point_extension { w.extension("loc:_openlrPoiWithAccessPointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrPointAlongLine {
pub openlr_point_location_reference_extension: Option<Box<Extension>>,
pub openlr_side_of_road: Option<OpenlrSideOfRoadEnum>,
pub openlr_orientation: Option<OpenlrOrientationEnum>,
pub openlr_location_reference_point: Option<Box<OpenlrLocationReferencePoint>>,
pub openlr_last_location_reference_point: Option<Box<OpenlrLastLocationReferencePoint>>,
pub openlr_offsets: Option<Box<OpenlrOffsets>>,
pub openlr_base_point_location_extension: Option<Box<Extension>>,
pub openlr_point_along_line_extension: Option<Box<Extension>>,
}
impl OpenlrPointAlongLine {
const FIELDS: &'static [u32] = &[0xb0524, 0xb09c2, 0xb09bb, 0xb09b4, 0xb09b1, 0xb09ba, 0xb0515, 0xb0523];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb013e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0524 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1316); }
0xb09c2 => { let v = r.enumeration::<OpenlrSideOfRoadEnum>()?; r.set(&mut e1, v, 2498); }
0xb09bb => { let v = r.enumeration::<OpenlrOrientationEnum>()?; r.set(&mut e2, v, 2491); }
0xb09b4 => { let v = Some(OpenlrLocationReferencePoint::read(r)?); r.set(&mut e3, v.map(Box::new), 2484); }
0xb09b1 => { let v = Some(OpenlrLastLocationReferencePoint::read(r)?); r.set(&mut e4, v.map(Box::new), 2481); }
0xb09ba => { let v = Some(OpenlrOffsets::read(r)?); r.set(&mut e5, v.map(Box::new), 2490); }
0xb0515 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1301); }
0xb0523 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1315); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2498);
r.required(&e2, 2491);
r.required(&e3, 2484);
r.required(&e4, 2481);
let v = Self {
openlr_point_location_reference_extension: e0,
openlr_side_of_road: e1,
openlr_orientation: e2,
openlr_location_reference_point: e3,
openlr_last_location_reference_point: e4,
openlr_offsets: e5,
openlr_base_point_location_extension: e6,
openlr_point_along_line_extension: e7,
};
r.close();
Ok(v)
}
}
impl OpenlrPointAlongLine {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_point_location_reference_extension { w.extension("loc:_openlrPointLocationReferenceExtension", v)?; }
match &self.openlr_side_of_road {
Some(v) => { w.enumeration("loc:openlrSideOfRoad", v.literal())?; }
None => return Err(w.missing("loc:openlrSideOfRoad")),
}
match &self.openlr_orientation {
Some(v) => { w.enumeration("loc:openlrOrientation", v.literal())?; }
None => return Err(w.missing("loc:openlrOrientation")),
}
match &self.openlr_location_reference_point {
Some(v) => { v.write(w, "loc:openlrLocationReferencePoint", "", "")?; }
None => return Err(w.missing("loc:openlrLocationReferencePoint")),
}
match &self.openlr_last_location_reference_point {
Some(v) => { v.write(w, "loc:openlrLastLocationReferencePoint", "", "")?; }
None => return Err(w.missing("loc:openlrLastLocationReferencePoint")),
}
if let Some(v) = &self.openlr_offsets { v.write(w, "loc:openlrOffsets", "", "")?; }
if let Some(v) = &self.openlr_base_point_location_extension { w.extension("loc:_openlrBasePointLocationExtension", v)?; }
if let Some(v) = &self.openlr_point_along_line_extension { w.extension("loc:_openlrPointAlongLineExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrPolygonCorners {
pub openlr_coordinates: Vec<PointCoordinates>,
pub openlr_polygon_corners_extension: Option<Box<Extension>>,
}
impl OpenlrPolygonCorners {
const FIELDS: &'static [u32] = &[0xb09ab, 0xb0525];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0140);
r.attrs_done();
let mut e0 = Vec::new();
let mut e1 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09ab => { let v = Some(PointCoordinates::read(r)?); e0.extend(v); }
0xb0525 => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1317); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
openlr_coordinates: e0,
openlr_polygon_corners_extension: e1,
};
r.close();
Ok(v)
}
}
impl OpenlrPolygonCorners {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.count("loc:openlrCoordinates", self.openlr_coordinates.len(), 3, usize::MAX)?;
for v in &self.openlr_coordinates { v.write(w, "loc:openlrCoordinates", "", "")?; }
if let Some(v) = &self.openlr_polygon_corners_extension { w.extension("loc:_openlrPolygonCornersExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrPolygonLocationReference {
pub openlr_area_location_reference_extension: Option<Box<Extension>>,
pub openlr_polygon_corners: Option<Box<OpenlrPolygonCorners>>,
pub openlr_polygon_location_reference_extension: Option<Box<Extension>>,
}
impl OpenlrPolygonLocationReference {
const FIELDS: &'static [u32] = &[0xb0514, 0xb09be, 0xb0526];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0141);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0514 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1300); }
0xb09be => { let v = Some(OpenlrPolygonCorners::read(r)?); r.set(&mut e1, v.map(Box::new), 2494); }
0xb0526 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1318); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2494);
let v = Self {
openlr_area_location_reference_extension: e0,
openlr_polygon_corners: e1,
openlr_polygon_location_reference_extension: e2,
};
r.close();
Ok(v)
}
}
impl OpenlrPolygonLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_area_location_reference_extension { w.extension("loc:_openlrAreaLocationReferenceExtension", v)?; }
match &self.openlr_polygon_corners {
Some(v) => { v.write(w, "loc:openlrPolygonCorners", "", "")?; }
None => return Err(w.missing("loc:openlrPolygonCorners")),
}
if let Some(v) = &self.openlr_polygon_location_reference_extension { w.extension("loc:_openlrPolygonLocationReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrRectangle {
pub openlr_lower_left: Option<Box<PointCoordinates>>,
pub openlr_upper_right: Option<Box<PointCoordinates>>,
pub openlr_rectangle_extension: Option<Box<Extension>>,
}
impl OpenlrRectangle {
const FIELDS: &'static [u32] = &[0xb09b5, 0xb09c3, 0xb0527];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0142);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb09b5 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e0, v.map(Box::new), 2485); }
0xb09c3 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e1, v.map(Box::new), 2499); }
0xb0527 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1319); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2485);
r.required(&e1, 2499);
let v = Self {
openlr_lower_left: e0,
openlr_upper_right: e1,
openlr_rectangle_extension: e2,
};
r.close();
Ok(v)
}
}
impl OpenlrRectangle {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.openlr_lower_left {
Some(v) => { v.write(w, "loc:openlrLowerLeft", "", "")?; }
None => return Err(w.missing("loc:openlrLowerLeft")),
}
match &self.openlr_upper_right {
Some(v) => { v.write(w, "loc:openlrUpperRight", "", "")?; }
None => return Err(w.missing("loc:openlrUpperRight")),
}
if let Some(v) = &self.openlr_rectangle_extension { w.extension("loc:_openlrRectangleExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OpenlrRectangleLocationReference {
pub openlr_area_location_reference_extension: Option<Box<Extension>>,
pub openlr_rectangle: Option<Box<OpenlrRectangle>>,
pub openlr_rectangle_location_reference_extension: Option<Box<Extension>>,
}
impl OpenlrRectangleLocationReference {
const FIELDS: &'static [u32] = &[0xb0514, 0xb09c1, 0xb0528];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0143);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0514 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1300); }
0xb09c1 => { let v = Some(OpenlrRectangle::read(r)?); r.set(&mut e1, v.map(Box::new), 2497); }
0xb0528 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1320); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2497);
let v = Self {
openlr_area_location_reference_extension: e0,
openlr_rectangle: e1,
openlr_rectangle_location_reference_extension: e2,
};
r.close();
Ok(v)
}
}
impl OpenlrRectangleLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.openlr_area_location_reference_extension { w.extension("loc:_openlrAreaLocationReferenceExtension", v)?; }
match &self.openlr_rectangle {
Some(v) => { v.write(w, "loc:openlrRectangle", "", "")?; }
None => return Err(w.missing("loc:openlrRectangle")),
}
if let Some(v) = &self.openlr_rectangle_location_reference_extension { w.extension("loc:_openlrRectangleLocationReferenceExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PercentageDistanceAlongLinearElement {
pub distance_along_linear_element_extension: Option<Box<Extension>>,
pub percentage_distance_along: Option<com::Percentage>,
pub percentage_distance_along_linear_element_extension: Option<Box<Extension>>,
}
impl PercentageDistanceAlongLinearElement {
const FIELDS: &'static [u32] = &[0xb0470, 0xb0a1a, 0xb054d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0169);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0470 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1136); }
0xb0a1a => { let v = r.value::<f32>()?; r.set(&mut e1, v, 2586); }
0xb054d => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1357); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2586);
let v = Self {
distance_along_linear_element_extension: e0,
percentage_distance_along: e1,
percentage_distance_along_linear_element_extension: e2,
};
r.close();
Ok(v)
}
}
impl PercentageDistanceAlongLinearElement {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.distance_along_linear_element_extension { w.extension("loc:_distanceAlongLinearElementExtension", v)?; }
match &self.percentage_distance_along {
Some(v) => { w.leaf("loc:percentageDistanceAlong", v)?; }
None => return Err(w.missing("loc:percentageDistanceAlong")),
}
if let Some(v) = &self.percentage_distance_along_linear_element_extension { w.extension("loc:_percentageDistanceAlongLinearElementExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PointAlongLinearElement {
pub administrative_area_of_point: Option<MultilingualString>,
pub direction_at_point: Option<DirectionEnum>,
pub direction_relative_at_point: Option<LinearDirectionEnum>,
pub height_grade_of_point: Option<HeightGradeEnum>,
pub linear_element: Option<AnyLinearElement>,
pub distance_along_linear_element: Option<DistanceAlongLinearElement>,
pub point_along_linear_element_extension: Option<Box<Extension>>,
}
impl PointAlongLinearElement {
const FIELDS: &'static [u32] = &[0xb0696, 0xb0788, 0xb078d, 0xb0861, 0xb08d0, 0xb079d, 0xb055e];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb017b);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0696 => { let v = r.multilingual()?; r.set(&mut e0, v, 1686); }
0xb0788 => { let v = r.enumeration::<DirectionEnum>()?; r.set(&mut e1, v, 1928); }
0xb078d => { let v = r.enumeration::<LinearDirectionEnum>()?; r.set(&mut e2, v, 1933); }
0xb0861 => { let v = r.enumeration::<HeightGradeEnum>()?; r.set(&mut e3, v, 2145); }
0xb08d0 => { let v = AnyLinearElement::read(r)?; r.set(&mut e4, v, 2256); }
0xb079d => { let v = DistanceAlongLinearElement::read(r)?; r.set(&mut e5, v, 1949); }
0xb055e => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1374); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e4, 2256);
r.required(&e5, 1949);
let v = Self {
administrative_area_of_point: e0,
direction_at_point: e1,
direction_relative_at_point: e2,
height_grade_of_point: e3,
linear_element: e4,
distance_along_linear_element: e5,
point_along_linear_element_extension: e6,
};
r.close();
Ok(v)
}
}
impl PointAlongLinearElement {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.administrative_area_of_point { w.multilingual("loc:administrativeAreaOfPoint", v)?; }
if let Some(v) = &self.direction_at_point { w.enumeration("loc:directionAtPoint", v.literal())?; }
if let Some(v) = &self.direction_relative_at_point { w.enumeration("loc:directionRelativeAtPoint", v.literal())?; }
if let Some(v) = &self.height_grade_of_point { w.enumeration("loc:heightGradeOfPoint", v.literal())?; }
match &self.linear_element {
Some(v) => { v.write(w, "loc:linearElement")?; }
None => return Err(w.missing("loc:linearElement")),
}
match &self.distance_along_linear_element {
Some(v) => { v.write(w, "loc:distanceAlongLinearElement")?; }
None => return Err(w.missing("loc:distanceAlongLinearElement")),
}
if let Some(v) = &self.point_along_linear_element_extension { w.extension("loc:_pointAlongLinearElementExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PointByCoordinates {
pub bearing: Option<com::AngleInDegrees>,
pub point_coordinates: Option<Box<PointCoordinates>>,
pub point_by_coordinates_extension: Option<Box<Extension>>,
}
impl PointByCoordinates {
const FIELDS: &'static [u32] = &[0xb06f2, 0xb0a46, 0xb055f];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb017c);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb06f2 => { let v = r.value::<u64>()?; r.set(&mut e0, v, 1778); }
0xb0a46 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e1, v.map(Box::new), 2630); }
0xb055f => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1375); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2630);
let v = Self {
bearing: e0,
point_coordinates: e1,
point_by_coordinates_extension: e2,
};
r.close();
Ok(v)
}
}
impl PointByCoordinates {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.bearing { w.range("bearing", *v, 0, 359)?; w.leaf("loc:bearing", v)?; }
match &self.point_coordinates {
Some(v) => { v.write(w, "loc:pointCoordinates", "", "")?; }
None => return Err(w.missing("loc:pointCoordinates")),
}
if let Some(v) = &self.point_by_coordinates_extension { w.extension("loc:_pointByCoordinatesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PointCoordinates {
pub latitude: Option<com::Float>,
pub longitude: Option<com::Float>,
pub height_coordinate: Vec<HeightCoordinate>,
pub position_confidence_ellipse: Option<Box<PositionConfidenceEllipse>>,
pub horizontal_position_accuracy: Option<Box<PositionAccuracy>>,
pub point_coordinates_extension: Option<Box<Extension>>,
}
impl PointCoordinates {
const FIELDS: &'static [u32] = &[0xb08bf, 0xb08eb, 0xb085f, 0xb0a4f, 0xb0866, 0xb0560];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb017d);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb08bf => { let v = r.value::<f32>()?; r.set(&mut e0, v, 2239); }
0xb08eb => { let v = r.value::<f32>()?; r.set(&mut e1, v, 2283); }
0xb085f => { let v = Some(HeightCoordinate::read(r)?); e2.extend(v); }
0xb0a4f => { let v = Some(PositionConfidenceEllipse::read(r)?); r.set(&mut e3, v.map(Box::new), 2639); }
0xb0866 => { let v = Some(PositionAccuracy::read(r)?); r.set(&mut e4, v.map(Box::new), 2150); }
0xb0560 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1376); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2239);
r.required(&e1, 2283);
let v = Self {
latitude: e0,
longitude: e1,
height_coordinate: e2,
position_confidence_ellipse: e3,
horizontal_position_accuracy: e4,
point_coordinates_extension: e5,
};
r.close();
Ok(v)
}
}
impl PointCoordinates {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.latitude {
Some(v) => { w.leaf("loc:latitude", v)?; }
None => return Err(w.missing("loc:latitude")),
}
match &self.longitude {
Some(v) => { w.leaf("loc:longitude", v)?; }
None => return Err(w.missing("loc:longitude")),
}
w.count("loc:heightCoordinate", self.height_coordinate.len(), 0, 3)?;
for v in &self.height_coordinate { v.write(w, "loc:heightCoordinate", "", "")?; }
if let Some(v) = &self.position_confidence_ellipse { v.write(w, "loc:positionConfidenceEllipse", "", "")?; }
if let Some(v) = &self.horizontal_position_accuracy { v.write(w, "loc:horizontalPositionAccuracy", "", "")?; }
if let Some(v) = &self.point_coordinates_extension { w.extension("loc:_pointCoordinatesExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PointDestination {
pub destination_extension: Option<Box<Extension>>,
pub point_location: Option<AnyPointLocation>,
pub point_destination_extension: Option<Box<Extension>>,
}
impl PointDestination {
const FIELDS: &'static [u32] = &[0xb045d, 0xb0a47, 0xb0561];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb017e);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb045d => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1117); }
0xb0a47 => { let v = AnyPointLocation::read(r)?; r.set(&mut e1, v, 2631); }
0xb0561 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1377); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2631);
let v = Self {
destination_extension: e0,
point_location: e1,
point_destination_extension: e2,
};
r.close();
Ok(v)
}
}
impl PointDestination {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.destination_extension { w.extension("loc:_destinationExtension", v)?; }
match &self.point_location {
Some(v) => { v.write(w, "loc:pointLocation")?; }
None => return Err(w.missing("loc:pointLocation")),
}
if let Some(v) = &self.point_destination_extension { w.extension("loc:_pointDestinationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PointLocation {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub external_referencing: Vec<ExternalReferencing>,
pub coordinates_for_display: Option<Box<PointCoordinates>>,
pub location_extension: Option<Box<LocationExtensionType>>,
pub supplementary_positional_description: Option<Box<SupplementaryPositionalDescription>>,
pub destination: Option<Destination>,
pub network_location_extension: Option<Box<Extension>>,
pub point_by_coordinates: Option<Box<PointByCoordinates>>,
pub point_along_linear_element: Vec<PointAlongLinearElement>,
pub alert_c_point: Vec<AlertCPoint>,
pub tpeg_point_location: Option<TpegPointLocation>,
pub openlr_point_location_reference: Option<OpenlrPointLocationReference>,
pub point_location_extension: Option<Box<Extension>>,
}
impl PointLocation {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb0809, 0xb0743, 0xb04df, 0xb0b94, 0xb0779, 0xb04fb, 0xb0a45, 0xb0a44, 0xb06ac, 0xb0bd8, 0xb09bd, 0xb0562];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb017f);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = Vec::new();
let mut e9 = Vec::new();
let mut e10 = None;
let mut e11 = None;
let mut e12 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb0809 => { let v = Some(ExternalReferencing::read(r)?); e1.extend(v); }
0xb0743 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e2, v.map(Box::new), 1859); }
0xb04df => { let v = Some(LocationExtensionType::read(r)?); r.set(&mut e3, v.map(Box::new), 1247); }
0xb0b94 => { let v = Some(SupplementaryPositionalDescription::read(r)?); r.set(&mut e4, v.map(Box::new), 2964); }
0xb0779 => { let v = Destination::read(r)?; r.set(&mut e5, v, 1913); }
0xb04fb => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1275); }
0xb0a45 => { let v = Some(PointByCoordinates::read(r)?); r.set(&mut e7, v.map(Box::new), 2629); }
0xb0a44 => { let v = Some(PointAlongLinearElement::read(r)?); e8.extend(v); }
0xb06ac => { let v = AlertCPoint::read(r)?; e9.extend(v); }
0xb0bd8 => { let v = TpegPointLocation::read(r)?; r.set(&mut e10, v, 3032); }
0xb09bd => { let v = OpenlrPointLocationReference::read(r)?; r.set(&mut e11, v, 2493); }
0xb0562 => { let v = r.raw()?; r.set(&mut e12, v.map(Box::new), 1378); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
location_reference_extension: e0,
external_referencing: e1,
coordinates_for_display: e2,
location_extension: e3,
supplementary_positional_description: e4,
destination: e5,
network_location_extension: e6,
point_by_coordinates: e7,
point_along_linear_element: e8,
alert_c_point: e9,
tpeg_point_location: e10,
openlr_point_location_reference: e11,
point_location_extension: e12,
};
r.close();
Ok(v)
}
}
impl PointLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
for v in &self.external_referencing { v.write(w, "loc:externalReferencing", "", "")?; }
if let Some(v) = &self.coordinates_for_display { v.write(w, "loc:coordinatesForDisplay", "", "")?; }
if let Some(v) = &self.location_extension { v.write(w, "loc:_locationExtension", "", "")?; }
if let Some(v) = &self.supplementary_positional_description { v.write(w, "loc:supplementaryPositionalDescription", "", "")?; }
if let Some(v) = &self.destination { v.write(w, "loc:destination")?; }
if let Some(v) = &self.network_location_extension { w.extension("loc:_networkLocationExtension", v)?; }
if let Some(v) = &self.point_by_coordinates { v.write(w, "loc:pointByCoordinates", "", "")?; }
for v in &self.point_along_linear_element { v.write(w, "loc:pointAlongLinearElement", "", "")?; }
for v in &self.alert_c_point { v.write(w, "loc:alertCPoint")?; }
if let Some(v) = &self.tpeg_point_location { v.write(w, "loc:tpegPointLocation")?; }
if let Some(v) = &self.openlr_point_location_reference { v.write(w, "loc:openlrPointLocationReference")?; }
if let Some(v) = &self.point_location_extension { w.extension("loc:_pointLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PositionAccuracy {
pub accuracy_percentile50: Option<com::MetresAsFloat>,
pub accuracy_percentile75: Option<com::MetresAsFloat>,
pub accuracy_percentile95: Option<com::MetresAsFloat>,
pub position_accuracy_extension: Option<Box<Extension>>,
}
impl PositionAccuracy {
const FIELDS: &'static [u32] = &[0xb0671, 0xb0672, 0xb0673, 0xb0568];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0185);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0671 => { let v = r.value::<f32>()?; r.set(&mut e0, v, 1649); }
0xb0672 => { let v = r.value::<f32>()?; r.set(&mut e1, v, 1650); }
0xb0673 => { let v = r.value::<f32>()?; r.set(&mut e2, v, 1651); }
0xb0568 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1384); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
accuracy_percentile50: e0,
accuracy_percentile75: e1,
accuracy_percentile95: e2,
position_accuracy_extension: e3,
};
r.close();
Ok(v)
}
}
impl PositionAccuracy {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.accuracy_percentile50 { w.leaf("loc:accuracyPercentile50", v)?; }
if let Some(v) = &self.accuracy_percentile75 { w.leaf("loc:accuracyPercentile75", v)?; }
if let Some(v) = &self.accuracy_percentile95 { w.leaf("loc:accuracyPercentile95", v)?; }
if let Some(v) = &self.position_accuracy_extension { w.extension("loc:_positionAccuracyExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PositionConfidenceEllipse {
pub semi_major_axis_length: Option<com::MetresAsFloat>,
pub semi_major_axis_length_coded_error: Option<PositionConfidenceCodedErrorEnum>,
pub semi_minor_axis_length: Option<com::MetresAsFloat>,
pub semi_minor_axis_length_coded_error: Option<PositionConfidenceCodedErrorEnum>,
pub semi_major_axis_orientation: Option<com::AngleInDegrees>,
pub semi_major_axis_orientation_error: Option<com::Boolean>,
pub position_confidence_ellipse_extension: Option<Box<Extension>>,
}
impl PositionConfidenceEllipse {
const FIELDS: &'static [u32] = &[0xb0b24, 0xb0b25, 0xb0b28, 0xb0b29, 0xb0b26, 0xb0b27, 0xb0569];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0186);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0b24 => { let v = r.value::<f32>()?; r.set(&mut e0, v, 2852); }
0xb0b25 => { let v = r.enumeration::<PositionConfidenceCodedErrorEnum>()?; r.set(&mut e1, v, 2853); }
0xb0b28 => { let v = r.value::<f32>()?; r.set(&mut e2, v, 2856); }
0xb0b29 => { let v = r.enumeration::<PositionConfidenceCodedErrorEnum>()?; r.set(&mut e3, v, 2857); }
0xb0b26 => { let v = r.value::<u64>()?; r.set(&mut e4, v, 2854); }
0xb0b27 => { let v = r.value::<bool>()?; r.set(&mut e5, v, 2855); }
0xb0569 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1385); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
semi_major_axis_length: e0,
semi_major_axis_length_coded_error: e1,
semi_minor_axis_length: e2,
semi_minor_axis_length_coded_error: e3,
semi_major_axis_orientation: e4,
semi_major_axis_orientation_error: e5,
position_confidence_ellipse_extension: e6,
};
r.close();
Ok(v)
}
}
impl PositionConfidenceEllipse {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.semi_major_axis_length { w.leaf("loc:semiMajorAxisLength", v)?; }
if let Some(v) = &self.semi_major_axis_length_coded_error { w.enumeration("loc:semiMajorAxisLengthCodedError", v.literal())?; }
if let Some(v) = &self.semi_minor_axis_length { w.leaf("loc:semiMinorAxisLength", v)?; }
if let Some(v) = &self.semi_minor_axis_length_coded_error { w.enumeration("loc:semiMinorAxisLengthCodedError", v.literal())?; }
if let Some(v) = &self.semi_major_axis_orientation { w.range("semiMajorAxisOrientation", *v, 0, 359)?; w.leaf("loc:semiMajorAxisOrientation", v)?; }
if let Some(v) = &self.semi_major_axis_orientation_error { w.leaf("loc:semiMajorAxisOrientationError", v)?; }
if let Some(v) = &self.position_confidence_ellipse_extension { w.extension("loc:_positionConfidenceEllipseExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedItinerary {
pub id: Option<String>,
pub version: Option<String>,
pub predefined_location_reference_extension: Option<Box<Extension>>,
pub predefined_itinerary_name: Option<MultilingualString>,
pub itinerary: Option<Itinerary>,
pub predefined_location: Vec<PredefinedLocation>,
pub predefined_itinerary_extension: Option<Box<Extension>>,
}
impl PredefinedItinerary {
const FIELDS: &'static [u32] = &[0xb0574, 0xb0a61, 0xb08a0, 0xb0a63, 0xb0571];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb018e);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0574 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1396); }
0xb0a61 => { let v = r.multilingual()?; r.set(&mut e1, v, 2657); }
0xb08a0 => { let v = Itinerary::read(r)?; r.set(&mut e2, v, 2208); }
0xb0a63 => { let v = Some(PredefinedLocation::read(r)?); e3.extend(v); }
0xb0571 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1393); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
predefined_location_reference_extension: e0,
predefined_itinerary_name: e1,
itinerary: e2,
predefined_location: e3,
predefined_itinerary_extension: e4,
};
r.close();
Ok(v)
}
}
impl PredefinedItinerary {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.predefined_location_reference_extension { w.extension("loc:_predefinedLocationReferenceExtension", v)?; }
if let Some(v) = &self.predefined_itinerary_name { w.multilingual("loc:predefinedItineraryName", v)?; }
if let Some(v) = &self.itinerary { v.write(w, "loc:itinerary")?; }
for v in &self.predefined_location { v.write(w, "loc:predefinedLocation", "", "")?; }
if let Some(v) = &self.predefined_itinerary_extension { w.extension("loc:_predefinedItineraryExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedLocation {
pub id: Option<String>,
pub version: Option<String>,
pub predefined_location_reference_extension: Option<Box<Extension>>,
pub predefined_location_name: Option<MultilingualString>,
pub location: Option<Location>,
pub predefined_location_extension: Option<Box<Extension>>,
}
impl PredefinedLocation {
const FIELDS: &'static [u32] = &[0xb0574, 0xb0a66, 0xb08dc, 0xb0572];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb018f);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0574 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1396); }
0xb0a66 => { let v = r.multilingual()?; r.set(&mut e1, v, 2662); }
0xb08dc => { let v = Location::read(r)?; r.set(&mut e2, v, 2268); }
0xb0572 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1394); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2268);
let v = Self {
id: a0,
version: a1,
predefined_location_reference_extension: e0,
predefined_location_name: e1,
location: e2,
predefined_location_extension: e3,
};
r.close();
Ok(v)
}
}
impl PredefinedLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.predefined_location_reference_extension { w.extension("loc:_predefinedLocationReferenceExtension", v)?; }
if let Some(v) = &self.predefined_location_name { w.multilingual("loc:predefinedLocationName", v)?; }
match &self.location {
Some(v) => { v.write(w, "loc:location")?; }
None => return Err(w.missing("loc:location")),
}
if let Some(v) = &self.predefined_location_extension { w.extension("loc:_predefinedLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedLocationGroup {
pub id: Option<String>,
pub version: Option<String>,
pub predefined_location_reference_extension: Option<Box<Extension>>,
pub predefined_location_group_name: Option<MultilingualString>,
pub location_group: Option<LocationGroup>,
pub predefined_location: Vec<PredefinedLocation>,
pub predefined_location_group_extension: Option<Box<Extension>>,
}
impl PredefinedLocationGroup {
const FIELDS: &'static [u32] = &[0xb0574, 0xb0a64, 0xb08e3, 0xb0a63, 0xb0573];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0190);
let a0 = r.req_attr(2159);
let a1 = r.req_attr(3149);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0574 => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1396); }
0xb0a64 => { let v = r.multilingual()?; r.set(&mut e1, v, 2660); }
0xb08e3 => { let v = LocationGroup::read(r)?; r.set(&mut e2, v, 2275); }
0xb0a63 => { let v = Some(PredefinedLocation::read(r)?); e3.extend(v); }
0xb0573 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1395); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
id: a0,
version: a1,
predefined_location_reference_extension: e0,
predefined_location_group_name: e1,
location_group: e2,
predefined_location: e3,
predefined_location_group_extension: e4,
};
r.close();
Ok(v)
}
}
impl PredefinedLocationGroup {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.id {
Some(v) => { w.attr("id", v)?; }
None => return Err(w.missing_attr("id")),
}
match &self.version {
Some(v) => { w.attr("version", v)?; }
None => return Err(w.missing_attr("version")),
}
if let Some(v) = &self.predefined_location_reference_extension { w.extension("loc:_predefinedLocationReferenceExtension", v)?; }
if let Some(v) = &self.predefined_location_group_name { w.multilingual("loc:predefinedLocationGroupName", v)?; }
if let Some(v) = &self.location_group { v.write(w, "loc:locationGroup")?; }
for v in &self.predefined_location { v.write(w, "loc:predefinedLocation", "", "")?; }
if let Some(v) = &self.predefined_location_group_extension { w.extension("loc:_predefinedLocationGroupExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct PredefinedLocationsPublication {
pub lang: Option<com::Language>,
pub extension_name: Option<String>,
pub extension_version: Option<String>,
pub profile_name: Option<String>,
pub profile_version: Option<String>,
pub feed_description: Option<MultilingualString>,
pub feed_type: Option<String>,
pub publication_time: Option<DateTime>,
pub publication_creator: Option<Box<com::InternationalIdentifier>>,
pub payload_publication_extension: Option<Box<Extension>>,
pub header_information: Option<Box<com::HeaderInformation>>,
pub predefined_location_reference: Vec<PredefinedLocationReference>,
pub predefined_locations_publication_extension: Option<Box<Extension>>,
}
impl PredefinedLocationsPublication {
const FIELDS: &'static [u32] = &[0x3081d, 0x3081e, 0x30a94, 0x30a93, 0x30547, 0xb0857, 0xb0a67, 0xb0575];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0192);
let a0 = r.req_attr(2223);
let _ = r.attr(2373);
let a2 = r.attr(2046);
let a3 = r.attr(2047);
let a4 = r.attr(2689);
let a5 = r.attr(2690);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = Vec::new();
let mut e7 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0x3081d => { let v = r.multilingual()?; r.set(&mut e0, v, 2077); }
0x3081e => { let v = r.string()?; r.set(&mut e1, v, 2078); }
0x30a94 => { let v = r.date_time()?; r.set(&mut e2, v, 2708); }
0x30a93 => { let v = Some(com::InternationalIdentifier::read(r)?); r.set(&mut e3, v.map(Box::new), 2707); }
0x30547 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1351); }
0xb0857 => { let v = Some(com::HeaderInformation::read(r)?); r.set(&mut e5, v.map(Box::new), 2135); }
0xb0a67 => { let v = PredefinedLocationReference::read(r)?; e6.extend(v); }
0xb0575 => { let v = r.raw()?; r.set(&mut e7, v.map(Box::new), 1397); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e2, 2708);
r.required(&e3, 2707);
r.required(&e5, 2135);
let v = Self {
lang: a0,
extension_name: a2,
extension_version: a3,
profile_name: a4,
profile_version: a5,
feed_description: e0,
feed_type: e1,
publication_time: e2,
publication_creator: e3,
payload_publication_extension: e4,
header_information: e5,
predefined_location_reference: e6,
predefined_locations_publication_extension: e7,
};
r.close();
Ok(v)
}
}
impl PredefinedLocationsPublication {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
w.constant_attrs(" modelBaseVersion=\"3\"")?;
match &self.lang {
Some(v) => { w.pattern("lang", v, Pattern::Language)?; w.attr("lang", v)?; }
None => return Err(w.missing_attr("lang")),
}
if let Some(v) = &self.extension_name { w.attr("extensionName", v)?; }
if let Some(v) = &self.extension_version { w.attr("extensionVersion", v)?; }
if let Some(v) = &self.profile_name { w.attr("profileName", v)?; }
if let Some(v) = &self.profile_version { w.attr("profileVersion", v)?; }
if let Some(v) = &self.feed_description { w.multilingual("com:feedDescription", v)?; }
if let Some(v) = &self.feed_type { w.max_len("feedType", v, 1024)?; w.leaf("com:feedType", v)?; }
match &self.publication_time {
Some(v) => { w.leaf("com:publicationTime", v)?; }
None => return Err(w.missing("com:publicationTime")),
}
match &self.publication_creator {
Some(v) => { v.write(w, "com:publicationCreator", "", "")?; }
None => return Err(w.missing("com:publicationCreator")),
}
if let Some(v) = &self.payload_publication_extension { w.extension("com:_payloadPublicationExtension", v)?; }
match &self.header_information {
Some(v) => { v.write(w, "loc:headerInformation", "", "")?; }
None => return Err(w.missing("loc:headerInformation")),
}
w.count("loc:predefinedLocationReference", self.predefined_location_reference.len(), 1, usize::MAX)?;
for v in &self.predefined_location_reference { v.write(w, "loc:predefinedLocationReference")?; }
if let Some(v) = &self.predefined_locations_publication_extension { w.extension("loc:_predefinedLocationsPublicationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Referent {
pub referent_identifier: Option<String>,
pub referent_name: Option<String>,
pub referent_type: Option<ReferentTypeEnum>,
pub referent_description: Option<MultilingualString>,
pub point_coordinates: Option<Box<PointCoordinates>>,
pub referent_extension: Option<Box<Extension>>,
}
impl Referent {
const FIELDS: &'static [u32] = &[0xb0ac0, 0xb0ac1, 0xb0ac2, 0xb0abf, 0xb0a46, 0xb0591];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb01af);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0ac0 => { let v = r.string()?; r.set(&mut e0, v, 2752); }
0xb0ac1 => { let v = r.string()?; r.set(&mut e1, v, 2753); }
0xb0ac2 => { let v = r.enumeration::<ReferentTypeEnum>()?; r.set(&mut e2, v, 2754); }
0xb0abf => { let v = r.multilingual()?; r.set(&mut e3, v, 2751); }
0xb0a46 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e4, v.map(Box::new), 2630); }
0xb0591 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1425); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2752);
r.required(&e2, 2754);
let v = Self {
referent_identifier: e0,
referent_name: e1,
referent_type: e2,
referent_description: e3,
point_coordinates: e4,
referent_extension: e5,
};
r.close();
Ok(v)
}
}
impl Referent {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.referent_identifier {
Some(v) => { w.max_len("referentIdentifier", v, 1024)?; w.leaf("loc:referentIdentifier", v)?; }
None => return Err(w.missing("loc:referentIdentifier")),
}
if let Some(v) = &self.referent_name { w.max_len("referentName", v, 1024)?; w.leaf("loc:referentName", v)?; }
match &self.referent_type {
Some(v) => { w.enumeration("loc:referentType", v.literal())?; }
None => return Err(w.missing("loc:referentType")),
}
if let Some(v) = &self.referent_description { w.multilingual("loc:referentDescription", v)?; }
if let Some(v) = &self.point_coordinates { v.write(w, "loc:pointCoordinates", "", "")?; }
if let Some(v) = &self.referent_extension { w.extension("loc:_referentExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct RoadInformation {
pub road_destination: Option<String>,
pub road_name: Option<String>,
pub road_number: Option<String>,
pub road_information_extension: Option<Box<Extension>>,
}
impl RoadInformation {
const FIELDS: &'static [u32] = &[0xb0af3, 0xb0af7, 0xb0af8, 0xb05a4];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb01c2);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0af3 => { let v = r.string()?; r.set(&mut e0, v, 2803); }
0xb0af7 => { let v = r.string()?; r.set(&mut e1, v, 2807); }
0xb0af8 => { let v = r.string()?; r.set(&mut e2, v, 2808); }
0xb05a4 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1444); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
road_destination: e0,
road_name: e1,
road_number: e2,
road_information_extension: e3,
};
r.close();
Ok(v)
}
}
impl RoadInformation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.road_destination { w.max_len("roadDestination", v, 1024)?; w.leaf("loc:roadDestination", v)?; }
if let Some(v) = &self.road_name { w.max_len("roadName", v, 1024)?; w.leaf("loc:roadName", v)?; }
if let Some(v) = &self.road_number { w.max_len("roadNumber", v, 1024)?; w.leaf("loc:roadNumber", v)?; }
if let Some(v) = &self.road_information_extension { w.extension("loc:_roadInformationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SingleRoadLinearLocation {
pub location_reference_extension: Option<Box<LocationReferenceExtensionType>>,
pub external_referencing: Vec<ExternalReferencing>,
pub coordinates_for_display: Option<Box<PointCoordinates>>,
pub location_extension: Option<Box<LocationExtensionType>>,
pub supplementary_positional_description: Option<Box<SupplementaryPositionalDescription>>,
pub destination: Option<Destination>,
pub network_location_extension: Option<Box<Extension>>,
pub openlr_linear: Option<Box<OpenlrLinear>>,
pub gml_line_string: Option<AnyGmlLineString>,
pub secondary_supplementary_description: Option<Box<SupplementaryPositionalDescription>>,
pub linear_location_extension: Option<Box<Extension>>,
pub tpeg_linear_location: Option<Box<TpegLinearLocation>>,
pub alert_c_linear: Vec<AlertCLinear>,
pub linear_within_linear_element: Vec<LinearWithinLinearElement>,
pub single_road_linear_location_extension: Option<Box<Extension>>,
}
impl SingleRoadLinearLocation {
const FIELDS: &'static [u32] = &[0xb04e3, 0xb0809, 0xb0743, 0xb04df, 0xb0b94, 0xb0779, 0xb04fb, 0xb09b3, 0xb0845, 0xb0b1f, 0xb04da, 0xb0bd5, 0xb06a2, 0xb08d5, 0xb05ba];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb01da);
r.attrs_done();
let mut e0 = None;
let mut e1 = Vec::new();
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = None;
let mut e8 = None;
let mut e9 = None;
let mut e10 = None;
let mut e11 = None;
let mut e12 = Vec::new();
let mut e13 = Vec::new();
let mut e14 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb04e3 => { let v = Some(LocationReferenceExtensionType::read(r)?); r.set(&mut e0, v.map(Box::new), 1251); }
0xb0809 => { let v = Some(ExternalReferencing::read(r)?); e1.extend(v); }
0xb0743 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e2, v.map(Box::new), 1859); }
0xb04df => { let v = Some(LocationExtensionType::read(r)?); r.set(&mut e3, v.map(Box::new), 1247); }
0xb0b94 => { let v = Some(SupplementaryPositionalDescription::read(r)?); r.set(&mut e4, v.map(Box::new), 2964); }
0xb0779 => { let v = Destination::read(r)?; r.set(&mut e5, v, 1913); }
0xb04fb => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1275); }
0xb09b3 => { let v = Some(OpenlrLinear::read(r)?); r.set(&mut e7, v.map(Box::new), 2483); }
0xb0845 => { let v = AnyGmlLineString::read(r)?; r.set(&mut e8, v, 2117); }
0xb0b1f => { let v = Some(SupplementaryPositionalDescription::read(r)?); r.set(&mut e9, v.map(Box::new), 2847); }
0xb04da => { let v = r.raw()?; r.set(&mut e10, v.map(Box::new), 1242); }
0xb0bd5 => { let v = Some(TpegLinearLocation::read(r)?); r.set(&mut e11, v.map(Box::new), 3029); }
0xb06a2 => { let v = AlertCLinear::read(r)?; e12.extend(v); }
0xb08d5 => { let v = Some(LinearWithinLinearElement::read(r)?); e13.extend(v); }
0xb05ba => { let v = r.raw()?; r.set(&mut e14, v.map(Box::new), 1466); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
location_reference_extension: e0,
external_referencing: e1,
coordinates_for_display: e2,
location_extension: e3,
supplementary_positional_description: e4,
destination: e5,
network_location_extension: e6,
openlr_linear: e7,
gml_line_string: e8,
secondary_supplementary_description: e9,
linear_location_extension: e10,
tpeg_linear_location: e11,
alert_c_linear: e12,
linear_within_linear_element: e13,
single_road_linear_location_extension: e14,
};
r.close();
Ok(v)
}
}
impl SingleRoadLinearLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_reference_extension { v.write(w, "loc:_locationReferenceExtension", "", "")?; }
for v in &self.external_referencing { v.write(w, "loc:externalReferencing", "", "")?; }
if let Some(v) = &self.coordinates_for_display { v.write(w, "loc:coordinatesForDisplay", "", "")?; }
if let Some(v) = &self.location_extension { v.write(w, "loc:_locationExtension", "", "")?; }
if let Some(v) = &self.supplementary_positional_description { v.write(w, "loc:supplementaryPositionalDescription", "", "")?; }
if let Some(v) = &self.destination { v.write(w, "loc:destination")?; }
if let Some(v) = &self.network_location_extension { w.extension("loc:_networkLocationExtension", v)?; }
if let Some(v) = &self.openlr_linear { v.write(w, "loc:openlrLinear", "", "")?; }
if let Some(v) = &self.gml_line_string { v.write(w, "loc:gmlLineString")?; }
if let Some(v) = &self.secondary_supplementary_description { v.write(w, "loc:secondarySupplementaryDescription", "", "")?; }
if let Some(v) = &self.linear_location_extension { w.extension("loc:_linearLocationExtension", v)?; }
if let Some(v) = &self.tpeg_linear_location { v.write(w, "loc:tpegLinearLocation", "", "")?; }
for v in &self.alert_c_linear { v.write(w, "loc:alertCLinear")?; }
for v in &self.linear_within_linear_element { v.write(w, "loc:linearWithinLinearElement", "", "")?; }
if let Some(v) = &self.single_road_linear_location_extension { w.extension("loc:_singleRoadLinearLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryPositionalDescription {
pub location_precision: Option<com::MetresAsNonNegativeInteger>,
pub direction_purpose: Option<DirectionPurposeEnum>,
pub geographic_descriptor: Option<GeographicCharacteristicEnum>,
pub infrastructure_descriptor: Option<InfrastructureDescriptorEnum>,
pub length_affected: Option<com::MetresAsFloat>,
pub location_description: Option<MultilingualString>,
pub position_on_carriageway: Option<RelativePositionOnCarriagewayEnum>,
pub sequential_ramp_number: Option<com::NonNegativeInteger>,
pub carriageway: Vec<Carriageway>,
pub named_area: Option<AnyNamedArea>,
pub road_information: Vec<AnyRoadInformation>,
pub supplementary_positional_description_extension: Option<Box<SupplementaryPositionalDescriptionExtensionType>>,
}
impl SupplementaryPositionalDescription {
const FIELDS: &'static [u32] = &[0xb078c, 0xb0842, 0xb0889, 0xb08c6, 0xb08e1, 0xb0a50, 0xb0b2f, 0xb070a, 0xb094b, 0xb0af5, 0xb05e3];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0204);
let a0 = r.attr_value::<u64>(2279)?;
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
let mut e7 = Vec::new();
let mut e8 = None;
let mut e9 = Vec::new();
let mut e10 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb078c => { let v = r.enumeration::<DirectionPurposeEnum>()?; r.set(&mut e0, v, 1932); }
0xb0842 => { let v = r.enumeration::<GeographicCharacteristicEnum>()?; r.set(&mut e1, v, 2114); }
0xb0889 => { let v = r.enumeration::<InfrastructureDescriptorEnum>()?; r.set(&mut e2, v, 2185); }
0xb08c6 => { let v = r.value::<f32>()?; r.set(&mut e3, v, 2246); }
0xb08e1 => { let v = r.multilingual()?; r.set(&mut e4, v, 2273); }
0xb0a50 => { let v = r.enumeration::<RelativePositionOnCarriagewayEnum>()?; r.set(&mut e5, v, 2640); }
0xb0b2f => { let v = r.value::<u64>()?; r.set(&mut e6, v, 2863); }
0xb070a => { let v = Some(Carriageway::read(r)?); e7.extend(v); }
0xb094b => { let v = AnyNamedArea::read(r)?; r.set(&mut e8, v, 2379); }
0xb0af5 => { let v = AnyRoadInformation::read(r)?; e9.extend(v); }
0xb05e3 => { let v = Some(SupplementaryPositionalDescriptionExtensionType::read(r)?); r.set(&mut e10, v.map(Box::new), 1507); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
let v = Self {
location_precision: a0,
direction_purpose: e0,
geographic_descriptor: e1,
infrastructure_descriptor: e2,
length_affected: e3,
location_description: e4,
position_on_carriageway: e5,
sequential_ramp_number: e6,
carriageway: e7,
named_area: e8,
road_information: e9,
supplementary_positional_description_extension: e10,
};
r.close();
Ok(v)
}
}
impl SupplementaryPositionalDescription {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.location_precision { w.attr_value("locationPrecision", v)?; }
if let Some(v) = &self.direction_purpose { w.enumeration("loc:directionPurpose", v.literal())?; }
if let Some(v) = &self.geographic_descriptor { w.enumeration("loc:geographicDescriptor", v.literal())?; }
if let Some(v) = &self.infrastructure_descriptor { w.enumeration("loc:infrastructureDescriptor", v.literal())?; }
if let Some(v) = &self.length_affected { w.leaf("loc:lengthAffected", v)?; }
if let Some(v) = &self.location_description { w.multilingual("loc:locationDescription", v)?; }
if let Some(v) = &self.position_on_carriageway { w.enumeration("loc:positionOnCarriageway", v.literal())?; }
if let Some(v) = &self.sequential_ramp_number { w.leaf("loc:sequentialRampNumber", v)?; }
for v in &self.carriageway { v.write(w, "loc:carriageway", "", "")?; }
if let Some(v) = &self.named_area { v.write(w, "loc:namedArea")?; }
for v in &self.road_information { v.write(w, "loc:roadInformation")?; }
if let Some(v) = &self.supplementary_positional_description_extension { v.write(w, "loc:_supplementaryPositionalDescriptionExtension", "", "")?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegAreaDescriptor {
pub descriptor: Option<MultilingualString>,
pub tpeg_descriptor_extension: Option<Box<Extension>>,
pub tpeg_area_descriptor_type: Option<TpegLoc03AreaDescriptorSubtypeEnum>,
pub tpeg_area_descriptor_extension: Option<Box<Extension>>,
}
impl TpegAreaDescriptor {
const FIELDS: &'static [u32] = &[0xb0778, 0xb05ff, 0xb0bcd, 0xb05fd];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb021f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0778 => { let v = r.multilingual()?; r.set(&mut e0, v, 1912); }
0xb05ff => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1535); }
0xb0bcd => { let v = r.enumeration::<TpegLoc03AreaDescriptorSubtypeEnum>()?; r.set(&mut e2, v, 3021); }
0xb05fd => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1533); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1912);
r.required(&e2, 3021);
let v = Self {
descriptor: e0,
tpeg_descriptor_extension: e1,
tpeg_area_descriptor_type: e2,
tpeg_area_descriptor_extension: e3,
};
r.close();
Ok(v)
}
}
impl TpegAreaDescriptor {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.descriptor {
Some(v) => { w.multilingual("loc:descriptor", v)?; }
None => return Err(w.missing("loc:descriptor")),
}
if let Some(v) = &self.tpeg_descriptor_extension { w.extension("loc:_tpegDescriptorExtension", v)?; }
match &self.tpeg_area_descriptor_type {
Some(v) => { w.enumeration("loc:tpegAreaDescriptorType", v.literal())?; }
None => return Err(w.missing("loc:tpegAreaDescriptorType")),
}
if let Some(v) = &self.tpeg_area_descriptor_extension { w.extension("loc:_tpegAreaDescriptorExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegFramedPoint {
pub tpeg_direction: Option<DirectionEnum>,
pub tpeg_point_location_extension: Option<Box<Extension>>,
pub tpeg_framed_point_location_type: Option<TpegLoc01FramedPointLocationSubtypeEnum>,
pub framed_point: Option<Box<TpegNonJunctionPoint>>,
pub to: Option<TpegPoint>,
pub from: Option<TpegPoint>,
pub tpeg_framed_point_extension: Option<Box<Extension>>,
}
impl TpegFramedPoint {
const FIELDS: &'static [u32] = &[0xb0bd0, 0xb060c, 0xb0bd1, 0xb082a, 0xb0bc4, 0xb0830, 0xb0600];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0222);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0bd0 => { let v = r.enumeration::<DirectionEnum>()?; r.set(&mut e0, v, 3024); }
0xb060c => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1548); }
0xb0bd1 => { let v = r.enumeration::<TpegLoc01FramedPointLocationSubtypeEnum>()?; r.set(&mut e2, v, 3025); }
0xb082a => { let v = Some(TpegNonJunctionPoint::read(r)?); r.set(&mut e3, v.map(Box::new), 2090); }
0xb0bc4 => { let v = TpegPoint::read(r)?; r.set(&mut e4, v, 3012); }
0xb0830 => { let v = TpegPoint::read(r)?; r.set(&mut e5, v, 2096); }
0xb0600 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1536); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3024);
r.required(&e2, 3025);
r.required(&e3, 2090);
r.required(&e4, 3012);
r.required(&e5, 2096);
let v = Self {
tpeg_direction: e0,
tpeg_point_location_extension: e1,
tpeg_framed_point_location_type: e2,
framed_point: e3,
to: e4,
from: e5,
tpeg_framed_point_extension: e6,
};
r.close();
Ok(v)
}
}
impl TpegFramedPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.tpeg_direction {
Some(v) => { w.enumeration("loc:tpegDirection", v.literal())?; }
None => return Err(w.missing("loc:tpegDirection")),
}
if let Some(v) = &self.tpeg_point_location_extension { w.extension("loc:_tpegPointLocationExtension", v)?; }
match &self.tpeg_framed_point_location_type {
Some(v) => { w.enumeration("loc:tpegFramedPointLocationType", v.literal())?; }
None => return Err(w.missing("loc:tpegFramedPointLocationType")),
}
match &self.framed_point {
Some(v) => { v.write(w, "loc:framedPoint", "", "")?; }
None => return Err(w.missing("loc:framedPoint")),
}
match &self.to {
Some(v) => { v.write(w, "loc:to")?; }
None => return Err(w.missing("loc:to")),
}
match &self.from {
Some(v) => { v.write(w, "loc:from")?; }
None => return Err(w.missing("loc:from")),
}
if let Some(v) = &self.tpeg_framed_point_extension { w.extension("loc:_tpegFramedPointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegGeometricArea {
pub tpeg_area_location_type: Option<TpegLoc01AreaLocationSubtypeEnum>,
pub tpeg_height: Option<Box<TpegHeight>>,
pub tpeg_area_location_extension: Option<Box<Extension>>,
pub radius: Option<com::MetresAsNonNegativeInteger>,
pub centre_point: Option<Box<PointCoordinates>>,
pub name: Option<Box<TpegAreaDescriptor>>,
pub tpeg_geometric_area_extension: Option<Box<Extension>>,
}
impl TpegGeometricArea {
const FIELDS: &'static [u32] = &[0xb0bcf, 0xb0bd2, 0xb05fe, 0xb0a9c, 0xb0711, 0xb0949, 0xb0601];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0223);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
let mut e5 = None;
let mut e6 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0bcf => { let v = r.enumeration::<TpegLoc01AreaLocationSubtypeEnum>()?; r.set(&mut e0, v, 3023); }
0xb0bd2 => { let v = Some(TpegHeight::read(r)?); r.set(&mut e1, v.map(Box::new), 3026); }
0xb05fe => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1534); }
0xb0a9c => { let v = r.value::<u64>()?; r.set(&mut e3, v, 2716); }
0xb0711 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e4, v.map(Box::new), 1809); }
0xb0949 => { let v = Some(TpegAreaDescriptor::read(r)?); r.set(&mut e5, v.map(Box::new), 2377); }
0xb0601 => { let v = r.raw()?; r.set(&mut e6, v.map(Box::new), 1537); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3023);
r.required(&e3, 2716);
r.required(&e4, 1809);
let v = Self {
tpeg_area_location_type: e0,
tpeg_height: e1,
tpeg_area_location_extension: e2,
radius: e3,
centre_point: e4,
name: e5,
tpeg_geometric_area_extension: e6,
};
r.close();
Ok(v)
}
}
impl TpegGeometricArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.tpeg_area_location_type {
Some(v) => { w.enumeration("loc:tpegAreaLocationType", v.literal())?; }
None => return Err(w.missing("loc:tpegAreaLocationType")),
}
if let Some(v) = &self.tpeg_height { v.write(w, "loc:tpegHeight", "", "")?; }
if let Some(v) = &self.tpeg_area_location_extension { w.extension("loc:_tpegAreaLocationExtension", v)?; }
match &self.radius {
Some(v) => { w.leaf("loc:radius", v)?; }
None => return Err(w.missing("loc:radius")),
}
match &self.centre_point {
Some(v) => { v.write(w, "loc:centrePoint", "", "")?; }
None => return Err(w.missing("loc:centrePoint")),
}
if let Some(v) = &self.name { v.write(w, "loc:name", "", "")?; }
if let Some(v) = &self.tpeg_geometric_area_extension { w.extension("loc:_tpegGeometricAreaExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegHeight {
pub height: Option<com::MetresAsFloat>,
pub height_type: Option<TpegLoc04HeightTypeEnum>,
pub tpeg_height_extension: Option<Box<Extension>>,
}
impl TpegHeight {
const FIELDS: &'static [u32] = &[0xb085b, 0xb0862, 0xb0602];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0224);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb085b => { let v = r.value::<f32>()?; r.set(&mut e0, v, 2139); }
0xb0862 => { let v = r.enumeration::<TpegLoc04HeightTypeEnum>()?; r.set(&mut e1, v, 2146); }
0xb0602 => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1538); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2146);
let v = Self {
height: e0,
height_type: e1,
tpeg_height_extension: e2,
};
r.close();
Ok(v)
}
}
impl TpegHeight {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.height { w.leaf("loc:height", v)?; }
match &self.height_type {
Some(v) => { w.enumeration("loc:heightType", v.literal())?; }
None => return Err(w.missing("loc:heightType")),
}
if let Some(v) = &self.tpeg_height_extension { w.extension("loc:_tpegHeightExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegIlcPointDescriptor {
pub descriptor: Option<MultilingualString>,
pub tpeg_descriptor_extension: Option<Box<Extension>>,
pub tpeg_point_descriptor_extension: Option<Box<Extension>>,
pub tpeg_ilc_point_descriptor_type: Option<TpegLoc03IlcPointDescriptorSubtypeEnum>,
pub tpeg_ilc_point_descriptor_extension: Option<Box<Extension>>,
}
impl TpegIlcPointDescriptor {
const FIELDS: &'static [u32] = &[0xb0778, 0xb05ff, 0xb060a, 0xb0bd3, 0xb0603];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0225);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0778 => { let v = r.multilingual()?; r.set(&mut e0, v, 1912); }
0xb05ff => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1535); }
0xb060a => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1546); }
0xb0bd3 => { let v = r.enumeration::<TpegLoc03IlcPointDescriptorSubtypeEnum>()?; r.set(&mut e3, v, 3027); }
0xb0603 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1539); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1912);
r.required(&e3, 3027);
let v = Self {
descriptor: e0,
tpeg_descriptor_extension: e1,
tpeg_point_descriptor_extension: e2,
tpeg_ilc_point_descriptor_type: e3,
tpeg_ilc_point_descriptor_extension: e4,
};
r.close();
Ok(v)
}
}
impl TpegIlcPointDescriptor {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.descriptor {
Some(v) => { w.multilingual("loc:descriptor", v)?; }
None => return Err(w.missing("loc:descriptor")),
}
if let Some(v) = &self.tpeg_descriptor_extension { w.extension("loc:_tpegDescriptorExtension", v)?; }
if let Some(v) = &self.tpeg_point_descriptor_extension { w.extension("loc:_tpegPointDescriptorExtension", v)?; }
match &self.tpeg_ilc_point_descriptor_type {
Some(v) => { w.enumeration("loc:tpegIlcPointDescriptorType", v.literal())?; }
None => return Err(w.missing("loc:tpegIlcPointDescriptorType")),
}
if let Some(v) = &self.tpeg_ilc_point_descriptor_extension { w.extension("loc:_tpegIlcPointDescriptorExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegJunction {
pub tpeg_point_extension: Option<Box<Extension>>,
pub point_coordinates: Option<Box<PointCoordinates>>,
pub name: Option<Box<TpegJunctionPointDescriptor>>,
pub ilc: Vec<TpegIlcPointDescriptor>,
pub other_name: Vec<TpegOtherPointDescriptor>,
pub tpeg_junction_extension: Option<Box<Extension>>,
}
impl TpegJunction {
const FIELDS: &'static [u32] = &[0xb060b, 0xb0a46, 0xb0949, 0xb0871, 0xb09e8, 0xb0604];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0226);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = Vec::new();
let mut e5 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb060b => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1547); }
0xb0a46 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e1, v.map(Box::new), 2630); }
0xb0949 => { let v = Some(TpegJunctionPointDescriptor::read(r)?); r.set(&mut e2, v.map(Box::new), 2377); }
0xb0871 => { let v = Some(TpegIlcPointDescriptor::read(r)?); e3.extend(v); }
0xb09e8 => { let v = Some(TpegOtherPointDescriptor::read(r)?); e4.extend(v); }
0xb0604 => { let v = r.raw()?; r.set(&mut e5, v.map(Box::new), 1540); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2630);
let v = Self {
tpeg_point_extension: e0,
point_coordinates: e1,
name: e2,
ilc: e3,
other_name: e4,
tpeg_junction_extension: e5,
};
r.close();
Ok(v)
}
}
impl TpegJunction {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.tpeg_point_extension { w.extension("loc:_tpegPointExtension", v)?; }
match &self.point_coordinates {
Some(v) => { v.write(w, "loc:pointCoordinates", "", "")?; }
None => return Err(w.missing("loc:pointCoordinates")),
}
if let Some(v) = &self.name { v.write(w, "loc:name", "", "")?; }
w.count("loc:ilc", self.ilc.len(), 1, 3)?;
for v in &self.ilc { v.write(w, "loc:ilc", "", "")?; }
for v in &self.other_name { v.write(w, "loc:otherName", "", "")?; }
if let Some(v) = &self.tpeg_junction_extension { w.extension("loc:_tpegJunctionExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegJunctionPointDescriptor {
pub descriptor: Option<MultilingualString>,
pub tpeg_descriptor_extension: Option<Box<Extension>>,
pub tpeg_point_descriptor_extension: Option<Box<Extension>>,
pub tpeg_junction_point_descriptor_type: Option<TpegLoc03JunctionPointDescriptorSubtypeEnum>,
pub tpeg_junction_point_descriptor_extension: Option<Box<Extension>>,
}
impl TpegJunctionPointDescriptor {
const FIELDS: &'static [u32] = &[0xb0778, 0xb05ff, 0xb060a, 0xb0bd4, 0xb0605];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0227);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0778 => { let v = r.multilingual()?; r.set(&mut e0, v, 1912); }
0xb05ff => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1535); }
0xb060a => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1546); }
0xb0bd4 => { let v = r.enumeration::<TpegLoc03JunctionPointDescriptorSubtypeEnum>()?; r.set(&mut e3, v, 3028); }
0xb0605 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1541); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1912);
r.required(&e3, 3028);
let v = Self {
descriptor: e0,
tpeg_descriptor_extension: e1,
tpeg_point_descriptor_extension: e2,
tpeg_junction_point_descriptor_type: e3,
tpeg_junction_point_descriptor_extension: e4,
};
r.close();
Ok(v)
}
}
impl TpegJunctionPointDescriptor {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.descriptor {
Some(v) => { w.multilingual("loc:descriptor", v)?; }
None => return Err(w.missing("loc:descriptor")),
}
if let Some(v) = &self.tpeg_descriptor_extension { w.extension("loc:_tpegDescriptorExtension", v)?; }
if let Some(v) = &self.tpeg_point_descriptor_extension { w.extension("loc:_tpegPointDescriptorExtension", v)?; }
match &self.tpeg_junction_point_descriptor_type {
Some(v) => { w.enumeration("loc:tpegJunctionPointDescriptorType", v.literal())?; }
None => return Err(w.missing("loc:tpegJunctionPointDescriptorType")),
}
if let Some(v) = &self.tpeg_junction_point_descriptor_extension { w.extension("loc:_tpegJunctionPointDescriptorExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegLinearLocation {
pub tpeg_direction: Option<DirectionEnum>,
pub tpeg_linear_location_type: Option<TpegLoc01LinearLocationSubtypeEnum>,
pub to: Option<TpegPoint>,
pub from: Option<TpegPoint>,
pub tpeg_linear_location_extension: Option<Box<Extension>>,
}
impl TpegLinearLocation {
const FIELDS: &'static [u32] = &[0xb0bd0, 0xb0bd6, 0xb0bc4, 0xb0830, 0xb0606];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0228);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0bd0 => { let v = r.enumeration::<DirectionEnum>()?; r.set(&mut e0, v, 3024); }
0xb0bd6 => { let v = r.enumeration::<TpegLoc01LinearLocationSubtypeEnum>()?; r.set(&mut e1, v, 3030); }
0xb0bc4 => { let v = TpegPoint::read(r)?; r.set(&mut e2, v, 3012); }
0xb0830 => { let v = TpegPoint::read(r)?; r.set(&mut e3, v, 2096); }
0xb0606 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1542); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3024);
r.required(&e1, 3030);
r.required(&e2, 3012);
r.required(&e3, 2096);
let v = Self {
tpeg_direction: e0,
tpeg_linear_location_type: e1,
to: e2,
from: e3,
tpeg_linear_location_extension: e4,
};
r.close();
Ok(v)
}
}
impl TpegLinearLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.tpeg_direction {
Some(v) => { w.enumeration("loc:tpegDirection", v.literal())?; }
None => return Err(w.missing("loc:tpegDirection")),
}
match &self.tpeg_linear_location_type {
Some(v) => { w.enumeration("loc:tpegLinearLocationType", v.literal())?; }
None => return Err(w.missing("loc:tpegLinearLocationType")),
}
match &self.to {
Some(v) => { v.write(w, "loc:to")?; }
None => return Err(w.missing("loc:to")),
}
match &self.from {
Some(v) => { v.write(w, "loc:from")?; }
None => return Err(w.missing("loc:from")),
}
if let Some(v) = &self.tpeg_linear_location_extension { w.extension("loc:_tpegLinearLocationExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegNamedOnlyArea {
pub tpeg_area_location_type: Option<TpegLoc01AreaLocationSubtypeEnum>,
pub tpeg_height: Option<Box<TpegHeight>>,
pub tpeg_area_location_extension: Option<Box<Extension>>,
pub name: Vec<TpegAreaDescriptor>,
pub tpeg_named_only_area_extension: Option<Box<Extension>>,
}
impl TpegNamedOnlyArea {
const FIELDS: &'static [u32] = &[0xb0bcf, 0xb0bd2, 0xb05fe, 0xb0949, 0xb0607];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0229);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = Vec::new();
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0bcf => { let v = r.enumeration::<TpegLoc01AreaLocationSubtypeEnum>()?; r.set(&mut e0, v, 3023); }
0xb0bd2 => { let v = Some(TpegHeight::read(r)?); r.set(&mut e1, v.map(Box::new), 3026); }
0xb05fe => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1534); }
0xb0949 => { let v = Some(TpegAreaDescriptor::read(r)?); e3.extend(v); }
0xb0607 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1543); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3023);
let v = Self {
tpeg_area_location_type: e0,
tpeg_height: e1,
tpeg_area_location_extension: e2,
name: e3,
tpeg_named_only_area_extension: e4,
};
r.close();
Ok(v)
}
}
impl TpegNamedOnlyArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.tpeg_area_location_type {
Some(v) => { w.enumeration("loc:tpegAreaLocationType", v.literal())?; }
None => return Err(w.missing("loc:tpegAreaLocationType")),
}
if let Some(v) = &self.tpeg_height { v.write(w, "loc:tpegHeight", "", "")?; }
if let Some(v) = &self.tpeg_area_location_extension { w.extension("loc:_tpegAreaLocationExtension", v)?; }
w.count("loc:name", self.name.len(), 1, usize::MAX)?;
for v in &self.name { v.write(w, "loc:name", "", "")?; }
if let Some(v) = &self.tpeg_named_only_area_extension { w.extension("loc:_tpegNamedOnlyAreaExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegNonJunctionPoint {
pub tpeg_point_extension: Option<Box<Extension>>,
pub point_coordinates: Option<Box<PointCoordinates>>,
pub name: Vec<TpegOtherPointDescriptor>,
pub tpeg_non_junction_point_extension: Option<Box<Extension>>,
}
impl TpegNonJunctionPoint {
const FIELDS: &'static [u32] = &[0xb060b, 0xb0a46, 0xb0949, 0xb0608];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb022a);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = Vec::new();
let mut e3 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb060b => { let v = r.raw()?; r.set(&mut e0, v.map(Box::new), 1547); }
0xb0a46 => { let v = Some(PointCoordinates::read(r)?); r.set(&mut e1, v.map(Box::new), 2630); }
0xb0949 => { let v = Some(TpegOtherPointDescriptor::read(r)?); e2.extend(v); }
0xb0608 => { let v = r.raw()?; r.set(&mut e3, v.map(Box::new), 1544); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e1, 2630);
let v = Self {
tpeg_point_extension: e0,
point_coordinates: e1,
name: e2,
tpeg_non_junction_point_extension: e3,
};
r.close();
Ok(v)
}
}
impl TpegNonJunctionPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.tpeg_point_extension { w.extension("loc:_tpegPointExtension", v)?; }
match &self.point_coordinates {
Some(v) => { v.write(w, "loc:pointCoordinates", "", "")?; }
None => return Err(w.missing("loc:pointCoordinates")),
}
w.count("loc:name", self.name.len(), 1, usize::MAX)?;
for v in &self.name { v.write(w, "loc:name", "", "")?; }
if let Some(v) = &self.tpeg_non_junction_point_extension { w.extension("loc:_tpegNonJunctionPointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegOtherPointDescriptor {
pub descriptor: Option<MultilingualString>,
pub tpeg_descriptor_extension: Option<Box<Extension>>,
pub tpeg_point_descriptor_extension: Option<Box<Extension>>,
pub tpeg_other_point_descriptor_type: Option<TpegLoc03OtherPointDescriptorSubtypeEnum>,
pub tpeg_other_point_descriptor_extension: Option<Box<Extension>>,
}
impl TpegOtherPointDescriptor {
const FIELDS: &'static [u32] = &[0xb0778, 0xb05ff, 0xb060a, 0xb0bd7, 0xb0609];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb022b);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0778 => { let v = r.multilingual()?; r.set(&mut e0, v, 1912); }
0xb05ff => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1535); }
0xb060a => { let v = r.raw()?; r.set(&mut e2, v.map(Box::new), 1546); }
0xb0bd7 => { let v = r.enumeration::<TpegLoc03OtherPointDescriptorSubtypeEnum>()?; r.set(&mut e3, v, 3031); }
0xb0609 => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1545); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 1912);
r.required(&e3, 3031);
let v = Self {
descriptor: e0,
tpeg_descriptor_extension: e1,
tpeg_point_descriptor_extension: e2,
tpeg_other_point_descriptor_type: e3,
tpeg_other_point_descriptor_extension: e4,
};
r.close();
Ok(v)
}
}
impl TpegOtherPointDescriptor {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.descriptor {
Some(v) => { w.multilingual("loc:descriptor", v)?; }
None => return Err(w.missing("loc:descriptor")),
}
if let Some(v) = &self.tpeg_descriptor_extension { w.extension("loc:_tpegDescriptorExtension", v)?; }
if let Some(v) = &self.tpeg_point_descriptor_extension { w.extension("loc:_tpegPointDescriptorExtension", v)?; }
match &self.tpeg_other_point_descriptor_type {
Some(v) => { w.enumeration("loc:tpegOtherPointDescriptorType", v.literal())?; }
None => return Err(w.missing("loc:tpegOtherPointDescriptorType")),
}
if let Some(v) = &self.tpeg_other_point_descriptor_extension { w.extension("loc:_tpegOtherPointDescriptorExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct TpegSimplePoint {
pub tpeg_direction: Option<DirectionEnum>,
pub tpeg_point_location_extension: Option<Box<Extension>>,
pub tpeg_simple_point_location_type: Option<TpegLoc01SimplePointLocationSubtypeEnum>,
pub point: Option<TpegPoint>,
pub tpeg_simple_point_extension: Option<Box<Extension>>,
}
impl TpegSimplePoint {
const FIELDS: &'static [u32] = &[0xb0bd0, 0xb060c, 0xb0bd9, 0xb0a43, 0xb060d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb022f);
r.attrs_done();
let mut e0 = None;
let mut e1 = None;
let mut e2 = None;
let mut e3 = None;
let mut e4 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0bd0 => { let v = r.enumeration::<DirectionEnum>()?; r.set(&mut e0, v, 3024); }
0xb060c => { let v = r.raw()?; r.set(&mut e1, v.map(Box::new), 1548); }
0xb0bd9 => { let v = r.enumeration::<TpegLoc01SimplePointLocationSubtypeEnum>()?; r.set(&mut e2, v, 3033); }
0xb0a43 => { let v = TpegPoint::read(r)?; r.set(&mut e3, v, 2627); }
0xb060d => { let v = r.raw()?; r.set(&mut e4, v.map(Box::new), 1549); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 3024);
r.required(&e2, 3033);
r.required(&e3, 2627);
let v = Self {
tpeg_direction: e0,
tpeg_point_location_extension: e1,
tpeg_simple_point_location_type: e2,
point: e3,
tpeg_simple_point_extension: e4,
};
r.close();
Ok(v)
}
}
impl TpegSimplePoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.tpeg_direction {
Some(v) => { w.enumeration("loc:tpegDirection", v.literal())?; }
None => return Err(w.missing("loc:tpegDirection")),
}
if let Some(v) = &self.tpeg_point_location_extension { w.extension("loc:_tpegPointLocationExtension", v)?; }
match &self.tpeg_simple_point_location_type {
Some(v) => { w.enumeration("loc:tpegSimplePointLocationType", v.literal())?; }
None => return Err(w.missing("loc:tpegSimplePointLocationType")),
}
match &self.point {
Some(v) => { v.write(w, "loc:point")?; }
None => return Err(w.missing("loc:point")),
}
if let Some(v) = &self.tpeg_simple_point_extension { w.extension("loc:_tpegSimplePointExtension", v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct IntermediatePointOnLinearElement {
pub index: Option<i32>,
pub referent: Option<Box<Referent>>,
}
impl IntermediatePointOnLinearElement {
const FIELDS: &'static [u32] = &[0xb0abe];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0306);
let a0 = r.req_attr_value::<i32>(2177)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0abe => { let v = Some(Referent::read(r)?); r.set(&mut e0, v.map(Box::new), 2750); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2750);
let v = Self {
index: a0,
referent: e0,
};
r.close();
Ok(v)
}
}
impl IntermediatePointOnLinearElement {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.index {
Some(v) => { w.attr_value("index", v)?; }
None => return Err(w.missing_attr("index")),
}
match &self.referent {
Some(v) => { v.write(w, "loc:referent", "", "")?; }
None => return Err(w.missing("loc:referent")),
}
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LocationContainedInItinerary {
pub index: Option<i32>,
pub location: Option<Location>,
}
impl LocationContainedInItinerary {
const FIELDS: &'static [u32] = &[0xb08dc];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb030f);
let a0 = r.req_attr_value::<i32>(2177)?;
r.attrs_done();
let mut e0 = None;
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb08dc => { let v = Location::read(r)?; r.set(&mut e0, v, 2268); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => r.skip_unknown(key)?,
},
}
break;
}
}
r.required(&e0, 2268);
let v = Self {
index: a0,
location: e0,
};
r.close();
Ok(v)
}
}
impl LocationContainedInItinerary {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
match &self.index {
Some(v) => { w.attr_value("index", v)?; }
None => return Err(w.missing_attr("index")),
}
match &self.location {
Some(v) => { v.write(w, "loc:location")?; }
None => return Err(w.missing("loc:location")),
}
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LocationExtensionType {
pub afir_facility_location: Option<Box<afac::AfirFacilityLocation>>,
pub other: Vec<Extension>,
}
impl LocationExtensionType {
const FIELDS: &'static [u32] = &[0xb0699];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0310);
r.attrs_done();
let mut e0 = None;
let mut other = Vec::new();
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0699 => { let v = Some(afac::AfirFacilityLocation::read(r)?); r.set(&mut e0, v.map(Box::new), 1689); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => other.push(r.raw_element()?),
},
}
break;
}
}
let v = Self {
afir_facility_location: e0,
other,
};
r.close();
Ok(v)
}
}
impl LocationExtensionType {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.afir_facility_location { v.write(w, "loc:afirFacilityLocation", "", "")?; }
for v in &self.other { w.foreign_element(v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct LocationReferenceExtensionType {
pub facility_location: Option<Box<locx::FacilityLocation>>,
pub other: Vec<Extension>,
}
impl LocationReferenceExtensionType {
const FIELDS: &'static [u32] = &[0xb080b];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb0311);
r.attrs_done();
let mut e0 = None;
let mut other = Vec::new();
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb080b => { let v = Some(locx::FacilityLocation::read(r)?); r.set(&mut e0, v.map(Box::new), 2059); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => other.push(r.raw_element()?),
},
}
break;
}
}
let v = Self {
facility_location: e0,
other,
};
r.close();
Ok(v)
}
}
impl LocationReferenceExtensionType {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.facility_location { v.write(w, "loc:facilityLocation", "", "")?; }
for v in &self.other { w.foreign_element(v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct NamedAreaExtensionType {
pub named_area_extended: Option<Box<locx::NamedAreaExtended>>,
pub other: Vec<Extension>,
}
impl NamedAreaExtensionType {
const FIELDS: &'static [u32] = &[0xb094d];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb031e);
r.attrs_done();
let mut e0 = None;
let mut other = Vec::new();
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb094d => { let v = Some(locx::NamedAreaExtended::read(r)?); r.set(&mut e0, v.map(Box::new), 2381); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => other.push(r.raw_element()?),
},
}
break;
}
}
let v = Self {
named_area_extended: e0,
other,
};
r.close();
Ok(v)
}
}
impl NamedAreaExtensionType {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.named_area_extended { v.write(w, "loc:namedAreaExtended", "", "")?; }
for v in &self.other { w.foreign_element(v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, Default, PartialEq)]
pub struct SupplementaryPositionalDescriptionExtensionType {
pub supplementary_positional_description_extended: Option<Box<locx::SupplementaryPositionalDescriptionExtended>>,
pub other: Vec<Extension>,
}
impl SupplementaryPositionalDescriptionExtensionType {
const FIELDS: &'static [u32] = &[0xb0b95];
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Self, Error> {
r.expect_type(0xb03b2);
r.attrs_done();
let mut e0 = None;
let mut other = Vec::new();
while let Some(mut key) = r.next_child()? {
loop {
match key {
0xb0b95 => { let v = Some(locx::SupplementaryPositionalDescriptionExtended::read(r)?); r.set(&mut e0, v.map(Box::new), 2965); }
_ => match r.fallback(key, Self::FIELDS) {
Some(k) => { key = k; continue; }
None => other.push(r.raw_element()?),
},
}
break;
}
}
let v = Self {
supplementary_positional_description_extended: e0,
other,
};
r.close();
Ok(v)
}
}
impl SupplementaryPositionalDescriptionExtensionType {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str, kind: &'static str, fixed: &'static str) -> Result<(), Error> {
w.begin(tag)?;
w.constant_attrs(kind)?;
w.constant_attrs(fixed)?;
if let Some(v) = &self.supplementary_positional_description_extended { v.write(w, "loc:supplementaryPositionalDescriptionExtended", "", "")?; }
for v in &self.other { w.foreign_element(v)?; }
w.end(tag)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AlertCLinear {
AlertCLinearByCode(Box<AlertCLinearByCode>),
AlertCMethod2Linear(Box<AlertCMethod2Linear>),
AlertCMethod4Linear(Box<AlertCMethod4Linear>),
}
impl AlertCLinear {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb001e) => Self::AlertCLinearByCode(Box::new(AlertCLinearByCode::read(r)?)),
Some(0xb0020) => Self::AlertCMethod2Linear(Box::new(AlertCMethod2Linear::read(r)?)),
Some(0xb0024) => Self::AlertCMethod4Linear(Box::new(AlertCMethod4Linear::read(r)?)),
_ => {
r.unknown_type("AlertCLinear")?;
return Ok(None);
}
}))
}
pub fn alert_c_location_country_code(&self) -> Option<&str> {
match self {
Self::AlertCLinearByCode(v) => v.alert_c_location_country_code.as_deref(),
Self::AlertCMethod2Linear(v) => v.alert_c_location_country_code.as_deref(),
Self::AlertCMethod4Linear(v) => v.alert_c_location_country_code.as_deref(),
}
}
pub fn alert_c_location_table_number(&self) -> Option<&str> {
match self {
Self::AlertCLinearByCode(v) => v.alert_c_location_table_number.as_deref(),
Self::AlertCMethod2Linear(v) => v.alert_c_location_table_number.as_deref(),
Self::AlertCMethod4Linear(v) => v.alert_c_location_table_number.as_deref(),
}
}
pub fn alert_c_location_table_version(&self) -> Option<&str> {
match self {
Self::AlertCLinearByCode(v) => v.alert_c_location_table_version.as_deref(),
Self::AlertCMethod2Linear(v) => v.alert_c_location_table_version.as_deref(),
Self::AlertCMethod4Linear(v) => v.alert_c_location_table_version.as_deref(),
}
}
pub fn alert_c_linear_extension(&self) -> Option<&Extension> {
match self {
Self::AlertCLinearByCode(v) => v.alert_c_linear_extension.as_deref(),
Self::AlertCMethod2Linear(v) => v.alert_c_linear_extension.as_deref(),
Self::AlertCMethod4Linear(v) => v.alert_c_linear_extension.as_deref(),
}
}
}
impl AlertCLinear {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AlertCLinearByCode(v) => v.write(w, tag, " xsi:type=\"loc:AlertCLinearByCode\"", ""),
Self::AlertCMethod2Linear(v) => v.write(w, tag, " xsi:type=\"loc:AlertCMethod2Linear\"", ""),
Self::AlertCMethod4Linear(v) => v.write(w, tag, " xsi:type=\"loc:AlertCMethod4Linear\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AlertCPoint {
AlertCMethod2Point(Box<AlertCMethod2Point>),
AlertCMethod4Point(Box<AlertCMethod4Point>),
}
impl AlertCPoint {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0021) => Self::AlertCMethod2Point(Box::new(AlertCMethod2Point::read(r)?)),
Some(0xb0025) => Self::AlertCMethod4Point(Box::new(AlertCMethod4Point::read(r)?)),
_ => {
r.unknown_type("AlertCPoint")?;
return Ok(None);
}
}))
}
pub fn alert_c_location_country_code(&self) -> Option<&str> {
match self {
Self::AlertCMethod2Point(v) => v.alert_c_location_country_code.as_deref(),
Self::AlertCMethod4Point(v) => v.alert_c_location_country_code.as_deref(),
}
}
pub fn alert_c_location_table_number(&self) -> Option<&str> {
match self {
Self::AlertCMethod2Point(v) => v.alert_c_location_table_number.as_deref(),
Self::AlertCMethod4Point(v) => v.alert_c_location_table_number.as_deref(),
}
}
pub fn alert_c_location_table_version(&self) -> Option<&str> {
match self {
Self::AlertCMethod2Point(v) => v.alert_c_location_table_version.as_deref(),
Self::AlertCMethod4Point(v) => v.alert_c_location_table_version.as_deref(),
}
}
pub fn alert_c_point_extension(&self) -> Option<&Extension> {
match self {
Self::AlertCMethod2Point(v) => v.alert_c_point_extension.as_deref(),
Self::AlertCMethod4Point(v) => v.alert_c_point_extension.as_deref(),
}
}
}
impl AlertCPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AlertCMethod2Point(v) => v.write(w, tag, " xsi:type=\"loc:AlertCMethod2Point\"", ""),
Self::AlertCMethod4Point(v) => v.write(w, tag, " xsi:type=\"loc:AlertCMethod4Point\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Destination {
AreaDestination(Box<AreaDestination>),
PointDestination(Box<PointDestination>),
}
impl Destination {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0034) => Self::AreaDestination(Box::new(AreaDestination::read(r)?)),
Some(0xb017e) => Self::PointDestination(Box::new(PointDestination::read(r)?)),
_ => {
r.unknown_type("Destination")?;
return Ok(None);
}
}))
}
pub fn destination_extension(&self) -> Option<&Extension> {
match self {
Self::AreaDestination(v) => v.destination_extension.as_deref(),
Self::PointDestination(v) => v.destination_extension.as_deref(),
}
}
}
impl Destination {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AreaDestination(v) => v.write(w, tag, " xsi:type=\"loc:AreaDestination\"", ""),
Self::PointDestination(v) => v.write(w, tag, " xsi:type=\"loc:PointDestination\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum DistanceAlongLinearElement {
DistanceFromLinearElementReferent(Box<DistanceFromLinearElementReferent>),
DistanceFromLinearElementStart(Box<DistanceFromLinearElementStart>),
PercentageDistanceAlongLinearElement(Box<PercentageDistanceAlongLinearElement>),
}
impl DistanceAlongLinearElement {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0086) => Self::DistanceFromLinearElementReferent(Box::new(DistanceFromLinearElementReferent::read(r)?)),
Some(0xb0087) => Self::DistanceFromLinearElementStart(Box::new(DistanceFromLinearElementStart::read(r)?)),
Some(0xb0169) => Self::PercentageDistanceAlongLinearElement(Box::new(PercentageDistanceAlongLinearElement::read(r)?)),
_ => {
r.unknown_type("DistanceAlongLinearElement")?;
return Ok(None);
}
}))
}
pub fn distance_along_linear_element_extension(&self) -> Option<&Extension> {
match self {
Self::DistanceFromLinearElementReferent(v) => v.distance_along_linear_element_extension.as_deref(),
Self::DistanceFromLinearElementStart(v) => v.distance_along_linear_element_extension.as_deref(),
Self::PercentageDistanceAlongLinearElement(v) => v.distance_along_linear_element_extension.as_deref(),
}
}
}
impl DistanceAlongLinearElement {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::DistanceFromLinearElementReferent(v) => v.write(w, tag, " xsi:type=\"loc:DistanceFromLinearElementReferent\"", ""),
Self::DistanceFromLinearElementStart(v) => v.write(w, tag, " xsi:type=\"loc:DistanceFromLinearElementStart\"", ""),
Self::PercentageDistanceAlongLinearElement(v) => v.write(w, tag, " xsi:type=\"loc:PercentageDistanceAlongLinearElement\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyGmlLineString {
GmlLineString(Box<GmlLineString>),
GmlLinearRing(Box<GmlLinearRing>),
}
impl AnyGmlLineString {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb00c5) => Self::GmlLineString(Box::new(GmlLineString::read(r)?)),
Some(0xb00c6) => Self::GmlLinearRing(Box::new(GmlLinearRing::read(r)?)),
None => Self::GmlLineString(Box::new(GmlLineString::read(r)?)),
_ => {
r.unknown_type_as("GmlLineString");
Self::GmlLineString(Box::new(GmlLineString::read(r)?))
}
}))
}
pub fn srs_dimension(&self) -> Option<&com::NonNegativeInteger> {
match self {
Self::GmlLineString(v) => v.srs_dimension.as_ref(),
Self::GmlLinearRing(v) => v.srs_dimension.as_ref(),
}
}
pub fn srs_name(&self) -> Option<&str> {
match self {
Self::GmlLineString(v) => v.srs_name.as_deref(),
Self::GmlLinearRing(v) => v.srs_name.as_deref(),
}
}
pub fn pos_list(&self) -> Option<&str> {
match self {
Self::GmlLineString(v) => v.pos_list.as_deref(),
Self::GmlLinearRing(v) => v.pos_list.as_deref(),
}
}
pub fn gml_line_string_extension(&self) -> Option<&Extension> {
match self {
Self::GmlLineString(v) => v.gml_line_string_extension.as_deref(),
Self::GmlLinearRing(v) => v.gml_line_string_extension.as_deref(),
}
}
}
impl AnyGmlLineString {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::GmlLineString(v) => v.write(w, tag, "", ""),
Self::GmlLinearRing(v) => v.write(w, tag, " xsi:type=\"loc:GmlLinearRing\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Itinerary {
ItineraryByIndexedLocations(Box<ItineraryByIndexedLocations>),
ItineraryByReference(Box<ItineraryByReference>),
}
impl Itinerary {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb00e6) => Self::ItineraryByIndexedLocations(Box::new(ItineraryByIndexedLocations::read(r)?)),
Some(0xb00e7) => Self::ItineraryByReference(Box::new(ItineraryByReference::read(r)?)),
_ => {
r.unknown_type("Itinerary")?;
return Ok(None);
}
}))
}
pub fn location_reference_extension(&self) -> Option<&LocationReferenceExtensionType> {
match self {
Self::ItineraryByIndexedLocations(v) => v.location_reference_extension.as_deref(),
Self::ItineraryByReference(v) => v.location_reference_extension.as_deref(),
}
}
pub fn route_destination(&self) -> &[Destination] {
match self {
Self::ItineraryByIndexedLocations(v) => &v.route_destination,
Self::ItineraryByReference(v) => &v.route_destination,
}
}
pub fn itinerary_extension(&self) -> Option<&Extension> {
match self {
Self::ItineraryByIndexedLocations(v) => v.itinerary_extension.as_deref(),
Self::ItineraryByReference(v) => v.itinerary_extension.as_deref(),
}
}
}
impl Itinerary {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::ItineraryByIndexedLocations(v) => v.write(w, tag, " xsi:type=\"loc:ItineraryByIndexedLocations\"", ""),
Self::ItineraryByReference(v) => v.write(w, tag, " xsi:type=\"loc:ItineraryByReference\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyLinearElement {
LinearElement(Box<LinearElement>),
LinearElementByCode(Box<LinearElementByCode>),
LinearElementByLineString(Box<LinearElementByLineString>),
LinearElementByPoints(Box<LinearElementByPoints>),
}
impl AnyLinearElement {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb00ed) => Self::LinearElement(Box::new(LinearElement::read(r)?)),
Some(0xb00ee) => Self::LinearElementByCode(Box::new(LinearElementByCode::read(r)?)),
Some(0xb00ef) => Self::LinearElementByLineString(Box::new(LinearElementByLineString::read(r)?)),
Some(0xb00f0) => Self::LinearElementByPoints(Box::new(LinearElementByPoints::read(r)?)),
None => Self::LinearElement(Box::new(LinearElement::read(r)?)),
_ => {
r.unknown_type_as("LinearElement");
Self::LinearElement(Box::new(LinearElement::read(r)?))
}
}))
}
pub fn road_name(&self) -> Option<&MultilingualString> {
match self {
Self::LinearElement(v) => v.road_name.as_ref(),
Self::LinearElementByCode(v) => v.road_name.as_ref(),
Self::LinearElementByLineString(v) => v.road_name.as_ref(),
Self::LinearElementByPoints(v) => v.road_name.as_ref(),
}
}
pub fn road_number(&self) -> Option<&str> {
match self {
Self::LinearElement(v) => v.road_number.as_deref(),
Self::LinearElementByCode(v) => v.road_number.as_deref(),
Self::LinearElementByLineString(v) => v.road_number.as_deref(),
Self::LinearElementByPoints(v) => v.road_number.as_deref(),
}
}
pub fn linear_element_reference_model(&self) -> Option<&str> {
match self {
Self::LinearElement(v) => v.linear_element_reference_model.as_deref(),
Self::LinearElementByCode(v) => v.linear_element_reference_model.as_deref(),
Self::LinearElementByLineString(v) => v.linear_element_reference_model.as_deref(),
Self::LinearElementByPoints(v) => v.linear_element_reference_model.as_deref(),
}
}
pub fn linear_element_reference_model_version(&self) -> Option<&str> {
match self {
Self::LinearElement(v) => v.linear_element_reference_model_version.as_deref(),
Self::LinearElementByCode(v) => v.linear_element_reference_model_version.as_deref(),
Self::LinearElementByLineString(v) => v.linear_element_reference_model_version.as_deref(),
Self::LinearElementByPoints(v) => v.linear_element_reference_model_version.as_deref(),
}
}
pub fn linear_element_nature(&self) -> Option<&LinearElementNatureEnum> {
match self {
Self::LinearElement(v) => v.linear_element_nature.as_ref(),
Self::LinearElementByCode(v) => v.linear_element_nature.as_ref(),
Self::LinearElementByLineString(v) => v.linear_element_nature.as_ref(),
Self::LinearElementByPoints(v) => v.linear_element_nature.as_ref(),
}
}
pub fn linear_element_extension(&self) -> Option<&Extension> {
match self {
Self::LinearElement(v) => v.linear_element_extension.as_deref(),
Self::LinearElementByCode(v) => v.linear_element_extension.as_deref(),
Self::LinearElementByLineString(v) => v.linear_element_extension.as_deref(),
Self::LinearElementByPoints(v) => v.linear_element_extension.as_deref(),
}
}
}
impl AnyLinearElement {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::LinearElement(v) => v.write(w, tag, "", ""),
Self::LinearElementByCode(v) => v.write(w, tag, " xsi:type=\"loc:LinearElementByCode\"", ""),
Self::LinearElementByLineString(v) => v.write(w, tag, " xsi:type=\"loc:LinearElementByLineString\"", ""),
Self::LinearElementByPoints(v) => v.write(w, tag, " xsi:type=\"loc:LinearElementByPoints\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum Location {
AreaLocation(Box<AreaLocation>),
LocationByReference(Box<LocationByReference>),
LinearLocation(Box<LinearLocation>),
SingleRoadLinearLocation(Box<SingleRoadLinearLocation>),
PointLocation(Box<PointLocation>),
PointLocationForParking(Box<prk::PointLocationForParking>),
}
impl Location {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0035) => Self::AreaLocation(Box::new(AreaLocation::read(r)?)),
Some(0xb00f5) => Self::LocationByReference(Box::new(LocationByReference::read(r)?)),
Some(0xb00f1) => Self::LinearLocation(Box::new(LinearLocation::read(r)?)),
Some(0xb01da) => Self::SingleRoadLinearLocation(Box::new(SingleRoadLinearLocation::read(r)?)),
Some(0xb017f) => Self::PointLocation(Box::new(PointLocation::read(r)?)),
Some(0xc0180) => Self::PointLocationForParking(Box::new(prk::PointLocationForParking::read(r)?)),
_ => {
r.unknown_type("Location")?;
return Ok(None);
}
}))
}
pub fn location_reference_extension(&self) -> Option<&LocationReferenceExtensionType> {
match self {
Self::AreaLocation(v) => v.location_reference_extension.as_deref(),
Self::LocationByReference(v) => v.location_reference_extension.as_deref(),
Self::LinearLocation(v) => v.location_reference_extension.as_deref(),
Self::SingleRoadLinearLocation(v) => v.location_reference_extension.as_deref(),
Self::PointLocation(v) => v.location_reference_extension.as_deref(),
Self::PointLocationForParking(v) => v.location_reference_extension.as_deref(),
}
}
pub fn external_referencing(&self) -> &[ExternalReferencing] {
match self {
Self::AreaLocation(v) => &v.external_referencing,
Self::LocationByReference(v) => &v.external_referencing,
Self::LinearLocation(v) => &v.external_referencing,
Self::SingleRoadLinearLocation(v) => &v.external_referencing,
Self::PointLocation(v) => &v.external_referencing,
Self::PointLocationForParking(v) => &v.external_referencing,
}
}
pub fn coordinates_for_display(&self) -> Option<&PointCoordinates> {
match self {
Self::AreaLocation(v) => v.coordinates_for_display.as_deref(),
Self::LocationByReference(v) => v.coordinates_for_display.as_deref(),
Self::LinearLocation(v) => v.coordinates_for_display.as_deref(),
Self::SingleRoadLinearLocation(v) => v.coordinates_for_display.as_deref(),
Self::PointLocation(v) => v.coordinates_for_display.as_deref(),
Self::PointLocationForParking(v) => v.coordinates_for_display.as_deref(),
}
}
pub fn location_extension(&self) -> Option<&LocationExtensionType> {
match self {
Self::AreaLocation(v) => v.location_extension.as_deref(),
Self::LocationByReference(v) => v.location_extension.as_deref(),
Self::LinearLocation(v) => v.location_extension.as_deref(),
Self::SingleRoadLinearLocation(v) => v.location_extension.as_deref(),
Self::PointLocation(v) => v.location_extension.as_deref(),
Self::PointLocationForParking(v) => v.location_extension.as_deref(),
}
}
}
impl Location {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::AreaLocation(v) => v.write(w, tag, " xsi:type=\"loc:AreaLocation\"", ""),
Self::LocationByReference(v) => v.write(w, tag, " xsi:type=\"loc:LocationByReference\"", ""),
Self::LinearLocation(v) => v.write(w, tag, " xsi:type=\"loc:LinearLocation\"", ""),
Self::SingleRoadLinearLocation(v) => v.write(w, tag, " xsi:type=\"loc:SingleRoadLinearLocation\"", ""),
Self::PointLocation(v) => v.write(w, tag, " xsi:type=\"loc:PointLocation\"", ""),
Self::PointLocationForParking(v) => v.write(w, tag, " xsi:type=\"prk:PointLocationForParking\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum LocationGroup {
LocationGroupByList(Box<LocationGroupByList>),
LocationGroupByReference(Box<LocationGroupByReference>),
}
impl LocationGroup {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb00f8) => Self::LocationGroupByList(Box::new(LocationGroupByList::read(r)?)),
Some(0xb00f9) => Self::LocationGroupByReference(Box::new(LocationGroupByReference::read(r)?)),
_ => {
r.unknown_type("LocationGroup")?;
return Ok(None);
}
}))
}
pub fn location_reference_extension(&self) -> Option<&LocationReferenceExtensionType> {
match self {
Self::LocationGroupByList(v) => v.location_reference_extension.as_deref(),
Self::LocationGroupByReference(v) => v.location_reference_extension.as_deref(),
}
}
pub fn location_group_extension(&self) -> Option<&Extension> {
match self {
Self::LocationGroupByList(v) => v.location_group_extension.as_deref(),
Self::LocationGroupByReference(v) => v.location_group_extension.as_deref(),
}
}
}
impl LocationGroup {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::LocationGroupByList(v) => v.write(w, tag, " xsi:type=\"loc:LocationGroupByList\"", ""),
Self::LocationGroupByReference(v) => v.write(w, tag, " xsi:type=\"loc:LocationGroupByReference\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum LocationReference {
ItineraryByIndexedLocations(Box<ItineraryByIndexedLocations>),
ItineraryByReference(Box<ItineraryByReference>),
AreaLocation(Box<AreaLocation>),
LocationByReference(Box<LocationByReference>),
LinearLocation(Box<LinearLocation>),
SingleRoadLinearLocation(Box<SingleRoadLinearLocation>),
PointLocation(Box<PointLocation>),
PointLocationForParking(Box<prk::PointLocationForParking>),
LocationGroupByList(Box<LocationGroupByList>),
LocationGroupByReference(Box<LocationGroupByReference>),
}
impl LocationReference {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb00e6) => Self::ItineraryByIndexedLocations(Box::new(ItineraryByIndexedLocations::read(r)?)),
Some(0xb00e7) => Self::ItineraryByReference(Box::new(ItineraryByReference::read(r)?)),
Some(0xb0035) => Self::AreaLocation(Box::new(AreaLocation::read(r)?)),
Some(0xb00f5) => Self::LocationByReference(Box::new(LocationByReference::read(r)?)),
Some(0xb00f1) => Self::LinearLocation(Box::new(LinearLocation::read(r)?)),
Some(0xb01da) => Self::SingleRoadLinearLocation(Box::new(SingleRoadLinearLocation::read(r)?)),
Some(0xb017f) => Self::PointLocation(Box::new(PointLocation::read(r)?)),
Some(0xc0180) => Self::PointLocationForParking(Box::new(prk::PointLocationForParking::read(r)?)),
Some(0xb00f8) => Self::LocationGroupByList(Box::new(LocationGroupByList::read(r)?)),
Some(0xb00f9) => Self::LocationGroupByReference(Box::new(LocationGroupByReference::read(r)?)),
_ => {
r.unknown_type("LocationReference")?;
return Ok(None);
}
}))
}
pub fn location_reference_extension(&self) -> Option<&LocationReferenceExtensionType> {
match self {
Self::ItineraryByIndexedLocations(v) => v.location_reference_extension.as_deref(),
Self::ItineraryByReference(v) => v.location_reference_extension.as_deref(),
Self::AreaLocation(v) => v.location_reference_extension.as_deref(),
Self::LocationByReference(v) => v.location_reference_extension.as_deref(),
Self::LinearLocation(v) => v.location_reference_extension.as_deref(),
Self::SingleRoadLinearLocation(v) => v.location_reference_extension.as_deref(),
Self::PointLocation(v) => v.location_reference_extension.as_deref(),
Self::PointLocationForParking(v) => v.location_reference_extension.as_deref(),
Self::LocationGroupByList(v) => v.location_reference_extension.as_deref(),
Self::LocationGroupByReference(v) => v.location_reference_extension.as_deref(),
}
}
}
impl LocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::ItineraryByIndexedLocations(v) => v.write(w, tag, " xsi:type=\"loc:ItineraryByIndexedLocations\"", ""),
Self::ItineraryByReference(v) => v.write(w, tag, " xsi:type=\"loc:ItineraryByReference\"", ""),
Self::AreaLocation(v) => v.write(w, tag, " xsi:type=\"loc:AreaLocation\"", ""),
Self::LocationByReference(v) => v.write(w, tag, " xsi:type=\"loc:LocationByReference\"", ""),
Self::LinearLocation(v) => v.write(w, tag, " xsi:type=\"loc:LinearLocation\"", ""),
Self::SingleRoadLinearLocation(v) => v.write(w, tag, " xsi:type=\"loc:SingleRoadLinearLocation\"", ""),
Self::PointLocation(v) => v.write(w, tag, " xsi:type=\"loc:PointLocation\"", ""),
Self::PointLocationForParking(v) => v.write(w, tag, " xsi:type=\"prk:PointLocationForParking\"", ""),
Self::LocationGroupByList(v) => v.write(w, tag, " xsi:type=\"loc:LocationGroupByList\"", ""),
Self::LocationGroupByReference(v) => v.write(w, tag, " xsi:type=\"loc:LocationGroupByReference\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyNamedArea {
NamedArea(Box<NamedArea>),
IsoNamedArea(Box<IsoNamedArea>),
NutsNamedArea(Box<NutsNamedArea>),
}
impl AnyNamedArea {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0113) => Self::NamedArea(Box::new(NamedArea::read(r)?)),
Some(0xb00e4) => Self::IsoNamedArea(Box::new(IsoNamedArea::read(r)?)),
Some(0xb0126) => Self::NutsNamedArea(Box::new(NutsNamedArea::read(r)?)),
None => Self::NamedArea(Box::new(NamedArea::read(r)?)),
_ => {
r.unknown_type_as("NamedArea");
Self::NamedArea(Box::new(NamedArea::read(r)?))
}
}))
}
pub fn named_area_extension(&self) -> Option<&Extension> {
match self {
Self::NamedArea(v) => v.named_area_extension.as_deref(),
Self::IsoNamedArea(v) => v.named_area_extension.as_deref(),
Self::NutsNamedArea(v) => v.named_area_extension.as_deref(),
}
}
pub fn area_name(&self) -> Option<&MultilingualString> {
match self {
Self::NamedArea(v) => v.area_name.as_ref(),
Self::IsoNamedArea(v) => v.area_name.as_ref(),
Self::NutsNamedArea(v) => v.area_name.as_ref(),
}
}
pub fn named_area_type(&self) -> Option<&NamedAreaTypeEnum> {
match self {
Self::NamedArea(v) => v.named_area_type.as_ref(),
Self::IsoNamedArea(v) => v.named_area_type.as_ref(),
Self::NutsNamedArea(v) => v.named_area_type.as_ref(),
}
}
pub fn country(&self) -> Option<&str> {
match self {
Self::NamedArea(v) => v.country.as_deref(),
Self::IsoNamedArea(v) => v.country.as_deref(),
Self::NutsNamedArea(v) => v.country.as_deref(),
}
}
pub fn loc_named_area_extension(&self) -> Option<&NamedAreaExtensionType> {
match self {
Self::NamedArea(v) => v.loc_named_area_extension.as_deref(),
Self::IsoNamedArea(v) => v.loc_named_area_extension.as_deref(),
Self::NutsNamedArea(v) => v.loc_named_area_extension.as_deref(),
}
}
}
impl AnyNamedArea {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::NamedArea(v) => v.write(w, tag, "", ""),
Self::IsoNamedArea(v) => v.write(w, tag, " xsi:type=\"loc:IsoNamedArea\"", ""),
Self::NutsNamedArea(v) => v.write(w, tag, " xsi:type=\"loc:NutsNamedArea\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum NetworkLocation {
LinearLocation(Box<LinearLocation>),
SingleRoadLinearLocation(Box<SingleRoadLinearLocation>),
PointLocation(Box<PointLocation>),
PointLocationForParking(Box<prk::PointLocationForParking>),
}
impl NetworkLocation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb00f1) => Self::LinearLocation(Box::new(LinearLocation::read(r)?)),
Some(0xb01da) => Self::SingleRoadLinearLocation(Box::new(SingleRoadLinearLocation::read(r)?)),
Some(0xb017f) => Self::PointLocation(Box::new(PointLocation::read(r)?)),
Some(0xc0180) => Self::PointLocationForParking(Box::new(prk::PointLocationForParking::read(r)?)),
_ => {
r.unknown_type("NetworkLocation")?;
return Ok(None);
}
}))
}
pub fn location_reference_extension(&self) -> Option<&LocationReferenceExtensionType> {
match self {
Self::LinearLocation(v) => v.location_reference_extension.as_deref(),
Self::SingleRoadLinearLocation(v) => v.location_reference_extension.as_deref(),
Self::PointLocation(v) => v.location_reference_extension.as_deref(),
Self::PointLocationForParking(v) => v.location_reference_extension.as_deref(),
}
}
pub fn external_referencing(&self) -> &[ExternalReferencing] {
match self {
Self::LinearLocation(v) => &v.external_referencing,
Self::SingleRoadLinearLocation(v) => &v.external_referencing,
Self::PointLocation(v) => &v.external_referencing,
Self::PointLocationForParking(v) => &v.external_referencing,
}
}
pub fn coordinates_for_display(&self) -> Option<&PointCoordinates> {
match self {
Self::LinearLocation(v) => v.coordinates_for_display.as_deref(),
Self::SingleRoadLinearLocation(v) => v.coordinates_for_display.as_deref(),
Self::PointLocation(v) => v.coordinates_for_display.as_deref(),
Self::PointLocationForParking(v) => v.coordinates_for_display.as_deref(),
}
}
pub fn location_extension(&self) -> Option<&LocationExtensionType> {
match self {
Self::LinearLocation(v) => v.location_extension.as_deref(),
Self::SingleRoadLinearLocation(v) => v.location_extension.as_deref(),
Self::PointLocation(v) => v.location_extension.as_deref(),
Self::PointLocationForParking(v) => v.location_extension.as_deref(),
}
}
pub fn supplementary_positional_description(&self) -> Option<&SupplementaryPositionalDescription> {
match self {
Self::LinearLocation(v) => v.supplementary_positional_description.as_deref(),
Self::SingleRoadLinearLocation(v) => v.supplementary_positional_description.as_deref(),
Self::PointLocation(v) => v.supplementary_positional_description.as_deref(),
Self::PointLocationForParking(v) => v.supplementary_positional_description.as_deref(),
}
}
pub fn destination(&self) -> Option<&Destination> {
match self {
Self::LinearLocation(v) => v.destination.as_ref(),
Self::SingleRoadLinearLocation(v) => v.destination.as_ref(),
Self::PointLocation(v) => v.destination.as_ref(),
Self::PointLocationForParking(v) => v.destination.as_ref(),
}
}
pub fn network_location_extension(&self) -> Option<&Extension> {
match self {
Self::LinearLocation(v) => v.network_location_extension.as_deref(),
Self::SingleRoadLinearLocation(v) => v.network_location_extension.as_deref(),
Self::PointLocation(v) => v.network_location_extension.as_deref(),
Self::PointLocationForParking(v) => v.network_location_extension.as_deref(),
}
}
}
impl NetworkLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::LinearLocation(v) => v.write(w, tag, " xsi:type=\"loc:LinearLocation\"", ""),
Self::SingleRoadLinearLocation(v) => v.write(w, tag, " xsi:type=\"loc:SingleRoadLinearLocation\"", ""),
Self::PointLocation(v) => v.write(w, tag, " xsi:type=\"loc:PointLocation\"", ""),
Self::PointLocationForParking(v) => v.write(w, tag, " xsi:type=\"prk:PointLocationForParking\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum OpenlrAreaLocationReference {
OpenlrCircleLocationReference(Box<OpenlrCircleLocationReference>),
OpenlrClosedLineLocationReference(Box<OpenlrClosedLineLocationReference>),
OpenlrGridLocationReference(Box<OpenlrGridLocationReference>),
OpenlrPolygonLocationReference(Box<OpenlrPolygonLocationReference>),
OpenlrRectangleLocationReference(Box<OpenlrRectangleLocationReference>),
}
impl OpenlrAreaLocationReference {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0132) => Self::OpenlrCircleLocationReference(Box::new(OpenlrCircleLocationReference::read(r)?)),
Some(0xb0133) => Self::OpenlrClosedLineLocationReference(Box::new(OpenlrClosedLineLocationReference::read(r)?)),
Some(0xb0135) => Self::OpenlrGridLocationReference(Box::new(OpenlrGridLocationReference::read(r)?)),
Some(0xb0141) => Self::OpenlrPolygonLocationReference(Box::new(OpenlrPolygonLocationReference::read(r)?)),
Some(0xb0143) => Self::OpenlrRectangleLocationReference(Box::new(OpenlrRectangleLocationReference::read(r)?)),
_ => {
r.unknown_type("OpenlrAreaLocationReference")?;
return Ok(None);
}
}))
}
pub fn openlr_area_location_reference_extension(&self) -> Option<&Extension> {
match self {
Self::OpenlrCircleLocationReference(v) => v.openlr_area_location_reference_extension.as_deref(),
Self::OpenlrClosedLineLocationReference(v) => v.openlr_area_location_reference_extension.as_deref(),
Self::OpenlrGridLocationReference(v) => v.openlr_area_location_reference_extension.as_deref(),
Self::OpenlrPolygonLocationReference(v) => v.openlr_area_location_reference_extension.as_deref(),
Self::OpenlrRectangleLocationReference(v) => v.openlr_area_location_reference_extension.as_deref(),
}
}
}
impl OpenlrAreaLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::OpenlrCircleLocationReference(v) => v.write(w, tag, " xsi:type=\"loc:OpenlrCircleLocationReference\"", ""),
Self::OpenlrClosedLineLocationReference(v) => v.write(w, tag, " xsi:type=\"loc:OpenlrClosedLineLocationReference\"", ""),
Self::OpenlrGridLocationReference(v) => v.write(w, tag, " xsi:type=\"loc:OpenlrGridLocationReference\"", ""),
Self::OpenlrPolygonLocationReference(v) => v.write(w, tag, " xsi:type=\"loc:OpenlrPolygonLocationReference\"", ""),
Self::OpenlrRectangleLocationReference(v) => v.write(w, tag, " xsi:type=\"loc:OpenlrRectangleLocationReference\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum OpenlrPointLocationReference {
OpenlrPoiWithAccessPoint(Box<OpenlrPoiWithAccessPoint>),
OpenlrPointAlongLine(Box<OpenlrPointAlongLine>),
OpenlrGeoCoordinate(Box<OpenlrGeoCoordinate>),
}
impl OpenlrPointLocationReference {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb013d) => Self::OpenlrPoiWithAccessPoint(Box::new(OpenlrPoiWithAccessPoint::read(r)?)),
Some(0xb013e) => Self::OpenlrPointAlongLine(Box::new(OpenlrPointAlongLine::read(r)?)),
Some(0xb0134) => Self::OpenlrGeoCoordinate(Box::new(OpenlrGeoCoordinate::read(r)?)),
_ => {
r.unknown_type("OpenlrPointLocationReference")?;
return Ok(None);
}
}))
}
pub fn openlr_point_location_reference_extension(&self) -> Option<&Extension> {
match self {
Self::OpenlrPoiWithAccessPoint(v) => v.openlr_point_location_reference_extension.as_deref(),
Self::OpenlrPointAlongLine(v) => v.openlr_point_location_reference_extension.as_deref(),
Self::OpenlrGeoCoordinate(v) => v.openlr_point_location_reference_extension.as_deref(),
}
}
}
impl OpenlrPointLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::OpenlrPoiWithAccessPoint(v) => v.write(w, tag, " xsi:type=\"loc:OpenlrPoiWithAccessPoint\"", ""),
Self::OpenlrPointAlongLine(v) => v.write(w, tag, " xsi:type=\"loc:OpenlrPointAlongLine\"", ""),
Self::OpenlrGeoCoordinate(v) => v.write(w, tag, " xsi:type=\"loc:OpenlrGeoCoordinate\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyPointLocation {
PointLocation(Box<PointLocation>),
PointLocationForParking(Box<prk::PointLocationForParking>),
}
impl AnyPointLocation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb017f) => Self::PointLocation(Box::new(PointLocation::read(r)?)),
Some(0xc0180) => Self::PointLocationForParking(Box::new(prk::PointLocationForParking::read(r)?)),
None => Self::PointLocation(Box::new(PointLocation::read(r)?)),
_ => {
r.unknown_type_as("PointLocation");
Self::PointLocation(Box::new(PointLocation::read(r)?))
}
}))
}
pub fn location_reference_extension(&self) -> Option<&LocationReferenceExtensionType> {
match self {
Self::PointLocation(v) => v.location_reference_extension.as_deref(),
Self::PointLocationForParking(v) => v.location_reference_extension.as_deref(),
}
}
pub fn external_referencing(&self) -> &[ExternalReferencing] {
match self {
Self::PointLocation(v) => &v.external_referencing,
Self::PointLocationForParking(v) => &v.external_referencing,
}
}
pub fn coordinates_for_display(&self) -> Option<&PointCoordinates> {
match self {
Self::PointLocation(v) => v.coordinates_for_display.as_deref(),
Self::PointLocationForParking(v) => v.coordinates_for_display.as_deref(),
}
}
pub fn location_extension(&self) -> Option<&LocationExtensionType> {
match self {
Self::PointLocation(v) => v.location_extension.as_deref(),
Self::PointLocationForParking(v) => v.location_extension.as_deref(),
}
}
pub fn supplementary_positional_description(&self) -> Option<&SupplementaryPositionalDescription> {
match self {
Self::PointLocation(v) => v.supplementary_positional_description.as_deref(),
Self::PointLocationForParking(v) => v.supplementary_positional_description.as_deref(),
}
}
pub fn destination(&self) -> Option<&Destination> {
match self {
Self::PointLocation(v) => v.destination.as_ref(),
Self::PointLocationForParking(v) => v.destination.as_ref(),
}
}
pub fn network_location_extension(&self) -> Option<&Extension> {
match self {
Self::PointLocation(v) => v.network_location_extension.as_deref(),
Self::PointLocationForParking(v) => v.network_location_extension.as_deref(),
}
}
pub fn point_by_coordinates(&self) -> Option<&PointByCoordinates> {
match self {
Self::PointLocation(v) => v.point_by_coordinates.as_deref(),
Self::PointLocationForParking(v) => v.point_by_coordinates.as_deref(),
}
}
pub fn point_along_linear_element(&self) -> &[PointAlongLinearElement] {
match self {
Self::PointLocation(v) => &v.point_along_linear_element,
Self::PointLocationForParking(v) => &v.point_along_linear_element,
}
}
pub fn alert_c_point(&self) -> &[AlertCPoint] {
match self {
Self::PointLocation(v) => &v.alert_c_point,
Self::PointLocationForParking(v) => &v.alert_c_point,
}
}
pub fn tpeg_point_location(&self) -> Option<&TpegPointLocation> {
match self {
Self::PointLocation(v) => v.tpeg_point_location.as_ref(),
Self::PointLocationForParking(v) => v.tpeg_point_location.as_ref(),
}
}
pub fn openlr_point_location_reference(&self) -> Option<&OpenlrPointLocationReference> {
match self {
Self::PointLocation(v) => v.openlr_point_location_reference.as_ref(),
Self::PointLocationForParking(v) => v.openlr_point_location_reference.as_ref(),
}
}
pub fn point_location_extension(&self) -> Option<&Extension> {
match self {
Self::PointLocation(v) => v.point_location_extension.as_deref(),
Self::PointLocationForParking(v) => v.point_location_extension.as_deref(),
}
}
}
impl AnyPointLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::PointLocation(v) => v.write(w, tag, "", ""),
Self::PointLocationForParking(v) => v.write(w, tag, " xsi:type=\"prk:PointLocationForParking\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum PredefinedLocationReference {
PredefinedItinerary(Box<PredefinedItinerary>),
PredefinedLocation(Box<PredefinedLocation>),
PredefinedLocationGroup(Box<PredefinedLocationGroup>),
}
impl PredefinedLocationReference {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb018e) => Self::PredefinedItinerary(Box::new(PredefinedItinerary::read(r)?)),
Some(0xb018f) => Self::PredefinedLocation(Box::new(PredefinedLocation::read(r)?)),
Some(0xb0190) => Self::PredefinedLocationGroup(Box::new(PredefinedLocationGroup::read(r)?)),
_ => {
r.unknown_type("PredefinedLocationReference")?;
return Ok(None);
}
}))
}
pub fn predefined_location_reference_extension(&self) -> Option<&Extension> {
match self {
Self::PredefinedItinerary(v) => v.predefined_location_reference_extension.as_deref(),
Self::PredefinedLocation(v) => v.predefined_location_reference_extension.as_deref(),
Self::PredefinedLocationGroup(v) => v.predefined_location_reference_extension.as_deref(),
}
}
}
impl PredefinedLocationReference {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::PredefinedItinerary(v) => v.write(w, tag, " xsi:type=\"loc:PredefinedItinerary\"", ""),
Self::PredefinedLocation(v) => v.write(w, tag, " xsi:type=\"loc:PredefinedLocation\"", ""),
Self::PredefinedLocationGroup(v) => v.write(w, tag, " xsi:type=\"loc:PredefinedLocationGroup\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum AnyRoadInformation {
RoadInformation(Box<RoadInformation>),
RoadInformationEnhanced(Box<prk::RoadInformationEnhanced>),
}
impl AnyRoadInformation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb01c2) => Self::RoadInformation(Box::new(RoadInformation::read(r)?)),
Some(0xc01c3) => Self::RoadInformationEnhanced(Box::new(prk::RoadInformationEnhanced::read(r)?)),
None => Self::RoadInformation(Box::new(RoadInformation::read(r)?)),
_ => {
r.unknown_type_as("RoadInformation");
Self::RoadInformation(Box::new(RoadInformation::read(r)?))
}
}))
}
pub fn road_destination(&self) -> Option<&str> {
match self {
Self::RoadInformation(v) => v.road_destination.as_deref(),
Self::RoadInformationEnhanced(v) => v.road_destination.as_deref(),
}
}
pub fn road_name(&self) -> Option<&str> {
match self {
Self::RoadInformation(v) => v.road_name.as_deref(),
Self::RoadInformationEnhanced(v) => v.road_name.as_deref(),
}
}
pub fn road_number(&self) -> Option<&str> {
match self {
Self::RoadInformation(v) => v.road_number.as_deref(),
Self::RoadInformationEnhanced(v) => v.road_number.as_deref(),
}
}
pub fn road_information_extension(&self) -> Option<&Extension> {
match self {
Self::RoadInformation(v) => v.road_information_extension.as_deref(),
Self::RoadInformationEnhanced(v) => v.road_information_extension.as_deref(),
}
}
}
impl AnyRoadInformation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::RoadInformation(v) => v.write(w, tag, "", ""),
Self::RoadInformationEnhanced(v) => v.write(w, tag, " xsi:type=\"prk:RoadInformationEnhanced\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum TpegAreaLocation {
TpegGeometricArea(Box<TpegGeometricArea>),
TpegNamedOnlyArea(Box<TpegNamedOnlyArea>),
}
impl TpegAreaLocation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0223) => Self::TpegGeometricArea(Box::new(TpegGeometricArea::read(r)?)),
Some(0xb0229) => Self::TpegNamedOnlyArea(Box::new(TpegNamedOnlyArea::read(r)?)),
_ => {
r.unknown_type("TpegAreaLocation")?;
return Ok(None);
}
}))
}
pub fn tpeg_area_location_type(&self) -> Option<&TpegLoc01AreaLocationSubtypeEnum> {
match self {
Self::TpegGeometricArea(v) => v.tpeg_area_location_type.as_ref(),
Self::TpegNamedOnlyArea(v) => v.tpeg_area_location_type.as_ref(),
}
}
pub fn tpeg_height(&self) -> Option<&TpegHeight> {
match self {
Self::TpegGeometricArea(v) => v.tpeg_height.as_deref(),
Self::TpegNamedOnlyArea(v) => v.tpeg_height.as_deref(),
}
}
pub fn tpeg_area_location_extension(&self) -> Option<&Extension> {
match self {
Self::TpegGeometricArea(v) => v.tpeg_area_location_extension.as_deref(),
Self::TpegNamedOnlyArea(v) => v.tpeg_area_location_extension.as_deref(),
}
}
}
impl TpegAreaLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::TpegGeometricArea(v) => v.write(w, tag, " xsi:type=\"loc:TpegGeometricArea\"", ""),
Self::TpegNamedOnlyArea(v) => v.write(w, tag, " xsi:type=\"loc:TpegNamedOnlyArea\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum TpegPoint {
TpegJunction(Box<TpegJunction>),
TpegNonJunctionPoint(Box<TpegNonJunctionPoint>),
}
impl TpegPoint {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0226) => Self::TpegJunction(Box::new(TpegJunction::read(r)?)),
Some(0xb022a) => Self::TpegNonJunctionPoint(Box::new(TpegNonJunctionPoint::read(r)?)),
_ => {
r.unknown_type("TpegPoint")?;
return Ok(None);
}
}))
}
pub fn tpeg_point_extension(&self) -> Option<&Extension> {
match self {
Self::TpegJunction(v) => v.tpeg_point_extension.as_deref(),
Self::TpegNonJunctionPoint(v) => v.tpeg_point_extension.as_deref(),
}
}
}
impl TpegPoint {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::TpegJunction(v) => v.write(w, tag, " xsi:type=\"loc:TpegJunction\"", ""),
Self::TpegNonJunctionPoint(v) => v.write(w, tag, " xsi:type=\"loc:TpegNonJunctionPoint\"", ""),
}
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum TpegPointLocation {
TpegFramedPoint(Box<TpegFramedPoint>),
TpegSimplePoint(Box<TpegSimplePoint>),
}
impl TpegPointLocation {
pub(crate) fn read(r: &mut Xml<'_>) -> Result<Option<Self>, Error> {
Self::read_as(r, r.xsi_type())
}
pub(crate) fn read_as(r: &mut Xml<'_>, kind: Option<u32>) -> Result<Option<Self>, Error> {
Ok(Some(match kind {
Some(0xb0222) => Self::TpegFramedPoint(Box::new(TpegFramedPoint::read(r)?)),
Some(0xb022f) => Self::TpegSimplePoint(Box::new(TpegSimplePoint::read(r)?)),
_ => {
r.unknown_type("TpegPointLocation")?;
return Ok(None);
}
}))
}
pub fn tpeg_direction(&self) -> Option<&DirectionEnum> {
match self {
Self::TpegFramedPoint(v) => v.tpeg_direction.as_ref(),
Self::TpegSimplePoint(v) => v.tpeg_direction.as_ref(),
}
}
pub fn tpeg_point_location_extension(&self) -> Option<&Extension> {
match self {
Self::TpegFramedPoint(v) => v.tpeg_point_location_extension.as_deref(),
Self::TpegSimplePoint(v) => v.tpeg_point_location_extension.as_deref(),
}
}
}
impl TpegPointLocation {
pub(crate) fn write(&self, w: &mut Out<'_>, tag: &'static str) -> Result<(), Error> {
match self {
Self::TpegFramedPoint(v) => v.write(w, tag, " xsi:type=\"loc:TpegFramedPoint\"", ""),
Self::TpegSimplePoint(v) => v.write(w, tag, " xsi:type=\"loc:TpegSimplePoint\"", ""),
}
}
}