Class XmlMacroscopicNetworkLayerHelper
- java.lang.Object
-
- org.goplanit.io.xml.network.physical.macroscopic.XmlMacroscopicNetworkLayerHelper
-
public class XmlMacroscopicNetworkLayerHelper extends Object
Process the Infrastructure object populated with data from the XML file- Author:
- gman6028, markr
-
-
Constructor Summary
Constructors Constructor Description XmlMacroscopicNetworkLayerHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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 typestatic 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 attributestatic 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 setstatic Double
parseLengthFromLineString(org.goplanit.xml.generated.XMLElementLinks.Link generatedLink, PlanitJtsCrsUtils jtsUtils)
Get the link length from the gml:LineString element in the XML file, if this has been setstatic org.locationtech.jts.geom.LineString
parseLinkGeometry(org.goplanit.xml.generated.XMLElementLinks.Link generatedLink)
parse the geometry from the xml link
-
-
-
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 filejtsUtils
- 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 fromtheLineString
- to extract length from (if not null) when no explicit length is setjtsUtils
- 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
-
-