Class 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
    • 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. If null, 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 not null.
        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.