Class XmlMacroscopicNetworkLayerHelper


  • public class XmlMacroscopicNetworkLayerHelper
    extends Object
    Process the Infrastructure object populated with data from the XML file
    Author:
    gman6028, markr
    • Constructor Detail

      • XmlMacroscopicNetworkLayerHelper

        public XmlMacroscopicNetworkLayerHelper()
    • Method Detail

      • parseLengthElementFromLink

        public static Double parseLengthElementFromLink​(org.goplanit.xml.generated.XMLElementLinks.Link generatedLink)
        Get the link length from the length element in the XML file, if this has been set
        Parameters:
        generatedLink - object storing link data from XML file
        Returns:
        final length value
      • parseLengthFromLineString

        public static Double parseLengthFromLineString​(org.goplanit.xml.generated.XMLElementLinks.Link generatedLink,
                                                       PlanitJtsCrsUtils jtsUtils)
                                                throws PlanItException
        Get the link length from the gml:LineString element in the XML file, if this has been set
        Parameters:
        generatedLink - object storing link data from XML file
        jtsUtils - to compute length from geometry
        Returns:
        final length value
        Throws:
        PlanItException - thown if error
      • parseLinkGeometry

        public static org.locationtech.jts.geom.LineString parseLinkGeometry​(org.goplanit.xml.generated.XMLElementLinks.Link generatedLink)
        parse the geometry from the xml link
        Parameters:
        generatedLink - XML link
        Returns:
        created LineString if any, null if not present
      • parseLength

        public static double parseLength​(org.goplanit.xml.generated.XMLElementLinks.Link xmlLink,
                                         org.locationtech.jts.geom.LineString theLineString,
                                         PlanitJtsCrsUtils jtsUtils)
        parse the length of an XML Link based on geometry or length attribute
        Parameters:
        xmlLink - to extract length from
        theLineString - to extract length from (if not null) when no explicit length is set
        jtsUtils - to compute length from geometry
        Returns:
        length (in km)
      • injectDefaultLinkSegmentType

        public static void injectDefaultLinkSegmentType​(org.goplanit.xml.generated.XMLElementLayerConfiguration xmlLayerConfiguration)
        in case no link segment types are defined on the layer, we inject a default link segment type
        Parameters:
        xmlLayerConfiguration - to inject XML entry into