- java.lang.Object
-
- org.arakhne.afc.gis.road.io.XMLRoadUtil
-
public final class XMLRoadUtil extends Object
This class provides tools to create an XML representation of roads or to create roads from an XML representation.- Since:
- 15.0
- Version:
- 17.0 2020-01-04 14:41:56
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.gis
- Maven Artifact Id:
- gisroadinputoutput
-
-
Field Summary
Fields Modifier and Type Field Description static String
ATTR_HEIGHT
height=""
.static String
NODE_ROAD
<circle />
.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
readRoadNetwork(Element xmlNode, RoadNetwork primitive, PathBuilder pathBuilder, XMLResources resources)
Read the roads from the XML description.static StandardRoadNetwork
readRoadNetwork(Element xmlNode, PathBuilder pathBuilder, XMLResources resources)
Read the roads from the XML description.static RoadPolyline
readRoadPolyline(Element element, PathBuilder pathBuilder, XMLResources resources)
Read a road from the XML description.static RoadSegment
readRoadSegment(Element element, PathBuilder pathBuilder, XMLResources resources)
Read a road from the XML description.static void
writeRoadNetwork(Element xmlNode, RoadNetwork primitive, URL geometryURL, MapMetricProjection mapProjection, URL attributeURL, XMLBuilder builder, PathBuilder pathBuilder, XMLResources resources)
Write the XML description for the given container of roads.static Element
writeRoadPolyline(RoadPolyline primitive, XMLBuilder builder, XMLResources resources)
Write the XML description for the given road.static Element
writeRoadSegment(RoadSegment primitive, XMLBuilder builder, XMLResources resources)
Write the XML description for the given road.
-
-
-
Field Detail
-
NODE_ROAD
public static final String NODE_ROAD
<circle />
.- See Also:
- Constant Field Values
-
ATTR_HEIGHT
public static final String ATTR_HEIGHT
height=""
.- See Also:
- Constant Field Values
-
-
Method Detail
-
writeRoadPolyline
public static Element writeRoadPolyline(RoadPolyline primitive, XMLBuilder builder, XMLResources resources) throws IOException
Write the XML description for the given road.- Parameters:
primitive
- is the road to output.builder
- is the tool to create XML nodes.resources
- is the tool that permits to gather the resources.- Returns:
- the XML node of the map element.
- Throws:
IOException
- in case of error.
-
readRoadPolyline
public static RoadPolyline readRoadPolyline(Element element, PathBuilder pathBuilder, XMLResources resources) throws IOException
Read a road from the XML description.- Parameters:
element
- is the XML node to read.pathBuilder
- is the tool to make paths absolute.resources
- is the tool that permits to gather the resources.- Returns:
- the road.
- Throws:
IOException
- in case of error.
-
writeRoadSegment
public static Element writeRoadSegment(RoadSegment primitive, XMLBuilder builder, XMLResources resources) throws IOException
Write the XML description for the given road.- Parameters:
primitive
- is the road to output.builder
- is the tool to create XML nodes.resources
- is the tool that permits to gather the resources.- Returns:
- the XML node of the map element.
- Throws:
IOException
- in case of error.
-
readRoadSegment
public static RoadSegment readRoadSegment(Element element, PathBuilder pathBuilder, XMLResources resources) throws IOException
Read a road from the XML description.- Parameters:
element
- is the XML node to read.pathBuilder
- is the tool to make paths absolute.resources
- is the tool that permits to gather the resources.- Returns:
- the road.
- Throws:
IOException
- in case of error.
-
writeRoadNetwork
public static void writeRoadNetwork(Element xmlNode, RoadNetwork primitive, URL geometryURL, MapMetricProjection mapProjection, URL attributeURL, XMLBuilder builder, PathBuilder pathBuilder, XMLResources resources) throws IOException
Write the XML description for the given container of roads.- Parameters:
xmlNode
- is the XML node to fill with the container data.primitive
- is the container of roads to output.geometryURL
- is the URL of the file that contains the geometry of the roads. Ifnull
, the road will be directly written in the XML document.mapProjection
- is the map projection to use to write the geometry shapes.attributeURL
- is the URL of the file that contains the attributes of the roads. This parameter is used only if geometryURL is notnull
.builder
- is the tool to create XML nodes.pathBuilder
- is the tool to make paths relative.resources
- is the tool that permits to gather the resources.- Throws:
IOException
- in case of error.
-
readRoadNetwork
public static void readRoadNetwork(Element xmlNode, RoadNetwork primitive, PathBuilder pathBuilder, XMLResources resources) throws IOException
Read the roads from the XML description.- Parameters:
xmlNode
- is the XML node to fill with the container data.primitive
- is the container of roads to read.pathBuilder
- is the tool to make paths relative.resources
- is the tool that permits to gather the resources.- Throws:
IOException
- in case of error.
-
readRoadNetwork
public static StandardRoadNetwork readRoadNetwork(Element xmlNode, PathBuilder pathBuilder, XMLResources resources) throws IOException
Read the roads from the XML description.- Parameters:
xmlNode
- is the XML node to fill with the container data.pathBuilder
- is the tool to make paths relative.resources
- is the tool that permits to gather the resources.- Returns:
- the road network.
- Throws:
IOException
- in case of error.
-
-