com.supermap.analyst.networkanalyst

Class TransportationAnalystSetting

  • java.lang.Object
    • com.supermap.analyst.networkanalyst.TransportationAnalystSetting


  • public class TransportationAnalystSetting
    extends java.lang.Object

    The transportation analyst environment setting. This class provides all the parameter information in transportation analysis. The settings of the parameters will affect the analysis result.

    When the TransportationAnalyst(TransportationAnalyst) class is used to perform various transportation analysis, the environment for transportation analyst should be set at first. And the transportation analyst environment is set through the TransportationAnalyst method of the TransportationAnalyst class object.

    The setting for the TransportationAnalystSetting object will directly affects the results. The transportation analysis includes the path analysis, TSP, the service area analysis and the find closest facility. The network dataset is different from the ordinary line dataset. The network dataset contains a sub dataset for storing network nodes. Therefore, the network dataset has two attribute tables: one records the edge information and the other records the node information. In the TransportationAnalystSetting object, the followings can be set:

    1. The network dataset for transportation analysis;
    2. The field to identify node (NodeIDField). This field comes from the attribute table of network nodes;
    3. The edge field to identity edge (EdgeIDField). This field comes from the attribute table of edges.
    4. The filed to record a start node ID (FNodeIDField) or an end node ID (TNodeIDField). The field comes from the atrribute table of network nodes.
    5. The fields to record the WeightFieldInfos. They come from the attribute table of edges.
    6. The distance tolerance from a node to an edge.
    7. The attribute to represent the turn table, such as the TurnDataset, the TurnNodeIDField, the TurnFEdgeIDField (which means the field of the start edge ID of this turning), the TurnTEdgeIDField (which means the field of the end edge ID of this turning), and the TurnWeightFields. Please refer to iDesktop help document.
    8. A set of edges and nodes to be used as barriers (BarrierEdges, BarrierNodes).
    9. The name of the field which stores the node name and the edge name (NodeNameField, EdgeNameField).
    Example:
    The code shows how to find the optimal path by network dataset. The network dataset used by the function below is the dataset whose name is RoadNet in the datasource of changchun.udb under the directory of [Installation\SampleData\changchun\].
      public void FindPathExample(DatasetVector networkDataset)
        {
            //Constructs an network analysis environment setting instance 
            TransportationAnalystSetting transportationAnalystSetting = new TransportationAnalystSetting();
             transportationAnalystSetting.setNetworkDataset ( dataset);
            transportationAnalystSetting.setEdgeIDField ( "SmID");
            transportationAnalystSetting.setNodeIDField ( "SmNodeID");
            transportationAnalystSetting.setFNodeIDField ("SmFNode");
            transportationAnalystSetting.setTNodeIDField ( "SmTNode");
            WeightFieldInfo weightInfo = new WeightFieldInfo();
            weightInfo.setFTWeightField ( "smLength");
            weightInfo.setTFWeightField ( "smLength");
            transportationAnalystSetting.getWeightFieldInfos().add(weightInfo);
    
            //Creates a traffic network analysis object.
            TransportationAnalyst transportationAnalyst = new TransportationAnalyst();
            transportationAnalyst.setAnalystSetting (transportationAnalystSetting);
    
            //Loading network model
            transportationAnalyst.load();
    
            //Constructs an traffic network analysis parameter object
            TransportationAnalystParameter parameter = new TransportationAnalystParameter();
            parameter.setNodes ( new int[] { 2, 50 });
            parameter.setRoutesReturn ( true);
    
            //Performs network analysis, returns the best path
            TransportationAnalystResult result = transportationAnalyst.findPath(parameter, true);
        }
     
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int[] getBarrierEdges()
      Gets the ID list of the barrier edges.
      int[] getBarrierNodes()
      Gets the ID list of the barrier nodes.
      java.lang.String getEdgeFilter()
      Gets the edge filter expression in the transportation analysis.
      java.lang.String getEdgeIDField()
      Returns the field that identifies the edge ID in the network dataset.
      java.lang.String getEdgeNameField()
      Returns the field which stores the edge names.
      java.lang.String getFNodeIDField()
      Returns the field that identifies the edge start node ID in the network dataset.
      java.lang.String[] getFTSingleWayRuleValues()
      Returns the array of strings indicating the forward single way.
      DatasetVector getNetworkDataset()
      Returns the network dataset to be analyzed.
      java.lang.String getNodeIDField()
      Returns the field that identifies the node ID in the network dataset.
      java.lang.String getNodeNameField()
      Gets the name of the field which stores the node names.
      java.lang.String[] getProhibitedWayRuleValues()
      Returns the array of strings indicating the edge is prohibited way.
      java.lang.String getRuleField()
      Gets the field which represents the traffic rule of the corresponding edge in the network dataset.
      java.lang.String[] getTFSingleWayRuleValues()
      Returns the array of strings indicating the backward single way.
      java.lang.String getTNodeIDField()
      Returns the field that identifies the edge end node ID in the network dataset.
      double getTolerance()
      Returns the distance tolerance from the point to the edge.
      DatasetVector getTurnDataset()
      Gets the turn table dataset.
      java.lang.String getTurnFEdgeIDField()
      Gets the field of the start edge ID.
      java.lang.String getTurnNodeIDField()
      Gets the field of the turn node ID.
      java.lang.String getTurnTEdgeIDField()
      Gets the field of the end edge ID.
      java.lang.String[] getTurnWeightFields()
      Returns the turn weight filed set.
      java.lang.String[] getTwoWayRuleValues()
      Returns the array of strings indicating the two-way line.
      WeightFieldInfos getWeightFieldInfos()
      Returns the object of weight field information collection.
      void setBarrierEdges(int[] value)
      Sets the ID list of the barrier edges, and it is optional.
      void setBarrierNodes(int[] value)
      Sets the ID list of the barrier nodes, and it is optional.
      void setEdgeFilter(java.lang.String value)
      Sets the edge filter expression in the transportation analysis.
      void setEdgeIDField(java.lang.String value)
      Sets the field that identifies the edge ID in the network dataset.
      void setEdgeNameField(java.lang.String value)
      Sets the field of the edge name.
      void setFNodeIDField(java.lang.String value)
      Sets the field that identifies the start node ID in the network dataset.
      void setFTSingleWayRuleValues(java.lang.String[] value)
      Sets the string array which represents the from-to oneway line.
      void setNetworkDataset(DatasetVector value)
      Sets the network dataset to be analyzed.
      void setNodeIDField(java.lang.String value)
      Sets the field that identifies the node ID in the network dataset.
      void setNodeNameField(java.lang.String value)
      Sets or sets the name of the field which stores the node names.
      void setProhibitedWayRuleValues(java.lang.String[] value)
      Sets the string array which represents the forbidden line.
      void setRuleField(java.lang.String value)
      Sets the traffic rule field of the network edge in the network dataset.
      void setTFSingleWayRuleValues(java.lang.String[] value)
      Sets the string array which represents the to-from oneway line.
      void setTNodeIDField(java.lang.String value)
      Sets the field that identifies the end node ID in the network dataset.
      void setTolerance(double value)
      Sets the distance tolerance from the point to the edge.
      void setTurnDataset(DatasetVector value)
      Sets the turn table dataset.
      void setTurnFEdgeIDField(java.lang.String value)
      Sets the field of the start turn edge ID.
      void setTurnNodeIDField(java.lang.String value)
      Sets the field of the turn node ID.
      void setTurnTEdgeIDField(java.lang.String value)
      Sets the field of the end turn edge ID.
      void setTurnWeightFields(java.lang.String[] value)
      Sets the turn weight filed set.
      void setTwoWayRuleValues(java.lang.String[] value)
      Sets the string array which represents the two-way line.
      void setWeightFieldInfos(WeightFieldInfos value)
      The object of weight field information collection.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TransportationAnalystSetting

        public TransportationAnalystSetting()
        Initializes a new instance of the TransportationAnalystSetting class.
      • TransportationAnalystSetting

        public TransportationAnalystSetting(TransportationAnalystSetting networkAnalystSetting)
        Initializes a new instance of the TransportationAnalystSetting class which is identical with the specified TransportationAnalystSetting object.
        Parameters:
        networkAnalystSetting - The specified TransportationAnalystSetting object.
    • Method Detail

      • getNetworkDataset

        public DatasetVector getNetworkDataset()
        Returns the network dataset to be analyzed.
        Returns:
        The network dataset to be analyzed.
        Default:
        The default value is Null.
      • setNetworkDataset

        public void setNetworkDataset(DatasetVector value)
        Sets the network dataset to be analyzed. It is required.
        Parameters:
        value - The network dataset to be analyzed.
      • getNodeIDField

        public java.lang.String getNodeIDField()
        Returns the field that identifies the node ID in the network dataset.
        Returns:
        The field that identifies the node ID in the network dataset.
        Default:
        The default value is SmNodeID.
      • setNodeIDField

        public void setNodeIDField(java.lang.String value)
        Sets the field that identifies the node ID in the network dataset. The ID field identifying the network node must be set, and it supports 16-bit integer and 32-bit integer.
        Parameters:
        value - The field that identifies the node ID in the network dataset.
      • getEdgeIDField

        public java.lang.String getEdgeIDField()
        Returns the field that identifies the edge ID in the network dataset.
        Returns:
        The field that identifies the edge ID in the network dataset.
        Default:
        The default value is SmEdgeID.
      • setEdgeIDField

        public void setEdgeIDField(java.lang.String value)
        Sets the field that identifies the edge ID in the network dataset. The ID field identify the network edge must be set, and it supports 16-bit integer and 32-bit integer.
        Parameters:
        value - Returns the field that identifies the edge ID in the network dataset.
      • getFNodeIDField

        public java.lang.String getFNodeIDField()
        Returns the field that identifies the edge start node ID in the network dataset.
        Returns:
        The field that identifies the ID of the start node in the network dataset.
        Default:
        The default value is SmFNode.
      • setFNodeIDField

        public void setFNodeIDField(java.lang.String value)
        Sets the field that identifies the start node ID in the network dataset. The ID field identifying the start node must be correctly set, and it supports 16-bit integer and 32-bit integer.
        Parameters:
        value - The field that identifies the ID of the start node in the network dataset.
      • getTNodeIDField

        public java.lang.String getTNodeIDField()
        Returns the field that identifies the edge end node ID in the network dataset.
        Returns:
        The field that identifies the ID of the end node in the network dataset.
        Default:
        The default value is SmTNode.
      • setTNodeIDField

        public void setTNodeIDField(java.lang.String value)
        Sets the field that identifies the end node ID in the network dataset. The ID field identifying the end node must be correctly set, and it supports 16-bit integer and 32-bit integer.
        Parameters:
        value - The field that identifies the ID of the end node in the network dataset.
      • getWeightFieldInfos

        public WeightFieldInfos getWeightFieldInfos()
        Returns the object of weight field information collection.

        WeightFieldInfosis the set of WeightFieldInfo. You can set the from-to weight field and the to-from weight field in WeightFieldInfo, which represents the cost in the network analyst, in the WeightFieldInfo.

        Returns:
        The object of weight field information collection.
        Default:
        The default value contains the WeightFieldInfos object of an element. The element Name is Length. The FTWeightField and TFWeightField are SmLength.
      • setWeightFieldInfos

        public void setWeightFieldInfos(WeightFieldInfos value)
        The object of weight field information collection.

        WeightFieldInfosis the set of WeightFieldInfo. You can set the from-to weight field and the to-from weight field in WeightFieldInfo, which represents the cost in the network analyst, in the WeightFieldInfo.

        Parameters:
        value - The object of weight field information collection.
      • getTolerance

        public double getTolerance()
        Returns the distance tolerance from the point to the edge. The unit is meter. It has the same unit with the network dataset specified by the setNetworkDataset method.

        For the detailed information, see setTolerance method.

        Returns:
        The distance tolerance between the point and the edge.
        Default:
        The default value is 0.
      • setTolerance

        public void setTolerance(double value)
        Sets the distance tolerance from the point to the edge. The unit is meter. It has the same unit with the dataset specified by the setNetworkDataset property method. Note: When using the coordinate point mode (setPoints, i.e., the specified analysis point is the coordinate point ID, not the node ID) or the specified barrier coordinate point (setPoints) in the analysis, you need to set an appropriate distance tolerance to avoid the incorrect analysis result due to that the selected analysis points or barrier points can not be adjusted into the network.

        In principle, any point in the network can be specified as a stop or a barrier point in the path analysis, and it should be adjacent to the network. If the point is not in network (neither in edge nor in node), it would be adjusted into network in terms of the tolerance.

        The illustration below demonstrates the tolerance mentioned in this interface. Where, the orange is the network nodes, the blue is the edges, the gray is the stop, the red is the distance between the stop and the edge AB. If the distance is in the tolerance, this stop will adjust to the edge AB.

        In order to perform the transportation analyst correctly, you need to set the proper tolerance value. The recommended calculation method is as follows.

        1. Calculating the minimum bounding box of the network dataset.
        2. Calculating the height and the width of the minimum bounding box of the network dataset.
        3. Getting the smaller value and diving it by 40 to get the distance tolerance.
        Parameters:
        value - The distance tolerance between the point and the edge.
      • getBarrierNodes

        public int[] getBarrierNodes()
        Gets the ID list of the barrier nodes.

        The barrier node is similar to the barrier edge in definition except that the barriers are network nodes. Barrier nodes can be the destination in network, e.g. it can be the destinations of transportation or traveling.

        Returns:
        The ID list of the barrier nodes.
        Default:
        The default value is Null.
      • setBarrierNodes

        public void setBarrierNodes(int[] value)
        Sets the ID list of the barrier nodes, and it is optional.

        The barrier node is similar to the barrier edge in definition except that the barriers are network nodes. Barrier nodes can be the destination in network, e.g. it can be the destinations of transportation or traveling.

        Parameters:
        value - The ID list of the barrier nodes.
      • getBarrierEdges

        public int[] getBarrierEdges()
        Gets the ID list of the barrier edges.

        Once an edge is set as a barrier, it is forbidden to pass in analysis. Users can also set the barrier edges dynamically during analysis.

        Returns:
        The ID list of barrier edges.
        Default:
        The default value is Null.
      • setBarrierEdges

        public void setBarrierEdges(int[] value)
        Sets the ID list of the barrier edges, and it is optional.

        Once an edge is set as a barrier, it is forbidden to pass in analysis. Users can also set the barrier edges dynamically during analysis.

        Parameters:
        value - The ID list of the barrier edges.
      • getTurnDataset

        public DatasetVector getTurnDataset()
        Gets the turn table dataset.

        See the introduction of setTurnDataset method.

        Returns:
        The turn table dataset.
        Default:
        The default value is Null.
      • setTurnDataset

        public void setTurnDataset(DatasetVector value)
        Sets the turn table dataset. Optional.

        The turn table is used to store the cost of the turning. For details, please see the iDesktop Help.

        Parameters:
        value - The turn table dataset.
      • getTurnNodeIDField

        public java.lang.String getTurnNodeIDField()
        Gets the field of the turn node ID.
        Returns:
        The field of the turn node ID.
        Default:
        The default is a null string.
      • setTurnNodeIDField

        public void setTurnNodeIDField(java.lang.String value)
        Sets the field of the turn node ID. It supports 16-bit integer and 32-bit integer, and it is optional.
        Parameters:
        value - The field of the turn node ID.
      • getTurnFEdgeIDField

        public java.lang.String getTurnFEdgeIDField()
        Gets the field of the start edge ID.
        Returns:
        The field of the start edge ID.
        Default:
        The default is a null string.
      • setTurnFEdgeIDField

        public void setTurnFEdgeIDField(java.lang.String value)
        Sets the field of the start turn edge ID. It supports 16-bit integer and 32-bit integer, and it is optional.
        Parameters:
        value - The field of the start edge ID.
      • getTurnTEdgeIDField

        public java.lang.String getTurnTEdgeIDField()
        Gets the field of the end edge ID.
        Returns:
        The field of the end edge ID.
        Default:
        The default is a null string.
      • setTurnTEdgeIDField

        public void setTurnTEdgeIDField(java.lang.String value)
        Sets the field of the end turn edge ID. It supports 16-bit integer and 32-bit integer, and it is optional.
        Parameters:
        value - The field of the end edge ID.
      • getTurnWeightFields

        public java.lang.String[] getTurnWeightFields()
        Returns the turn weight filed set.

        See the introduction of setTurnWeightFields method.

        Returns:
        The turn weight fields.
        Default:
        The default value is Null.
      • setTurnWeightFields

        public void setTurnWeightFields(java.lang.String[] value)
        Sets the turn weight filed set. Optional.

        Turn weight is the turn cost, which is the cost from an edge, through the middle nodes, to the other adjacent edge.

        TurnWeightFields denotes the turn cost field. You can specify multiple turn weight fields by this property. When setting the parameters before analysis, you can select one of the fields as the turn weight information.

        For details about the turn table, please see the network analysis part in iDesktop Help.

        Parameters:
        value - The turn weight fields.
      • getNodeNameField

        public java.lang.String getNodeNameField()
        Gets the name of the field which stores the node names.
        Returns:
        The name of the field which stores the node names.
        Default:
        The default is a null string.
      • setNodeNameField

        public void setNodeNameField(java.lang.String value)
        Sets or sets the name of the field which stores the node names. Optional.
        Parameters:
        value - The name of the field which stores the node names.
      • getEdgeNameField

        public java.lang.String getEdgeNameField()
        Returns the field which stores the edge names.
        Returns:
        The field which stores the edge names.
        Default:
        The default is a null string.
      • setEdgeNameField

        public void setEdgeNameField(java.lang.String value)
        Sets the field of the edge name. It is optional. Note, if not set it, even you set the isPathGuidesReturn method as true, the analysis result will not return the path guide.
        Parameters:
        value - The field which stores the edge names.
      • getRuleField

        public java.lang.String getRuleField()
        Gets the field which represents the traffic rule of the corresponding edge in the network dataset.

        The field denotes the traffic rule in the network dataset, which stores the corresponding traffic rule of the edge, such as the from-to oneway line, to-from oneway line, forbidden line and two-way traffic line. The relationship between the field and the traffic rule is set up by setFTSingleWayRuleValues(), setTFSingleWayRuleValues(), setProhibitedWayRuleValues(), setTwoWayRuleValues(), etc.

        For example, the setFTSingleWayRuleValues() method can set the value to denote the from-to oneway line, and it allows to set multiple values to denote the from-to oneway lines. When the values of the traffic rule field are the specified values, all the corresponding edges will denote the from-to oneway lines.

        Returns:
        The field which represents the traffic rule of the corresponding edge in the network dataset.
        Default:
        The default is a null string.
      • getFTSingleWayRuleValues

        public java.lang.String[] getFTSingleWayRuleValues()
        Returns the array of strings indicating the forward single way.

        About the forward oneway string array, please see the setFTSingleWayRuleValues method.

        Returns:
        The array of strings indicating the forward single way.
        Default:
        The default value is null.
      • setFTSingleWayRuleValues

        public void setFTSingleWayRuleValues(java.lang.String[] value)
        Sets the string array which represents the from-to oneway line. It is optional.

        When the value of the traffic rule field which is set up by the setRuleField method is any one of the string array specified by this property, the corresponding network edge is the from-to oneway line. For more information, see the setRuleField method.

        Parameters:
        value - The array of strings indicating the forward single way.
      • getTFSingleWayRuleValues

        public java.lang.String[] getTFSingleWayRuleValues()
        Returns the array of strings indicating the backward single way.

        About the backward oneway string array, please see the setTFSingleWayRuleValues method.

        Returns:
        The array of strings indicating the backward single way.
        Default:
        The default value is null.
      • setTFSingleWayRuleValues

        public void setTFSingleWayRuleValues(java.lang.String[] value)
        Sets the string array which represents the to-from oneway line. It is optional.

        When the value of the traffic rule field which is set up by the setRuleField method is any one of the string array specified by this property, the corresponding network edge is the to-from oneway line. For more information, see the setRuleField method.

        Parameters:
        value - The array of strings indicating the forward single way.
      • getProhibitedWayRuleValues

        public java.lang.String[] getProhibitedWayRuleValues()
        Returns the array of strings indicating the edge is prohibited way.

        About the forbidden oneway string array, please see the setTFSingleWayRuleValues method.

        Returns:
        The array of strings indicating the edge is prohibited way.
        Default:
        The default value is null.
      • setProhibitedWayRuleValues

        public void setProhibitedWayRuleValues(java.lang.String[] value)
        Sets the string array which represents the forbidden line. It is optional.

        When the value of the traffic rule field which is set up by the setRuleField method is any one of the string array specified by this property, the corresponding network edge is the prohibited way. For more information, see the setRuleField method.

        Parameters:
        value - The array of strings indicating the edge is prohibited way.
      • getTwoWayRuleValues

        public java.lang.String[] getTwoWayRuleValues()
        Returns the array of strings indicating the two-way line.

        About the twoway string array, please see the setTFSingleWayRuleValues method.

        Returns:
        The array of strings indicating the two ways.
        Default:
        The default value is null.
      • setTwoWayRuleValues

        public void setTwoWayRuleValues(java.lang.String[] value)
        Sets the string array which represents the two-way line. It is optional.

        When the value of the traffic rule field which is set up by the setRuleField method is any one of the string array specified by this property, the corresponding network edge is the two way. For more information, see the setRuleField method.

        Parameters:
        value - The array of strings indicating the two way.
      • getEdgeFilter

        public java.lang.String getEdgeFilter()
        Gets the edge filter expression in the transportation analysis.

        About the edge filter expression, please see setEdgeFilter method.

        Returns:
        The edge filter expression in the transportation analysis.
      • setEdgeFilter

        public void setEdgeFilter(java.lang.String value)
        Sets the edge filter expression in the transportation analysis. Optianal.

        The edges may be classified into several types based on some characteristics in network analysis. Not all of the edges are needed in the practical analysis, so this method can be used to filter the edges not needed in the analysis.

        Parameters:
        value - The edge filter expression in the transportation analysis.