通过TransportationAnalystSetting类来设置,参考代码:
TransportationAnalystSetting transportationAnalystSetting = new TransportationAnalystSetting(); DatasetVector datasetVector1 = (DatasetVector)m_Workspace.getDatasources().get(0).getDatasets().get(networkDatasetName); transportationAnalystSetting.setNetworkDataset (datasetVector1); WeightFieldInfo weightInfo = new WeightFieldInfo(); weightInfo.setFTWeightField ( "SmLength"); weightInfo.setTFWeightField ( "SmLength"); transportationAnalystSetting.getWeightFieldInfos().add(weightInfo); transportationAnalystSetting.setNodeIDField ( "SmNodeID"); transportationAnalystSetting.setEdgeNameField("SmID"); transportationAnalystSetting.setEdgeIDField ( "SmEdgeID"); transportationAnalystSetting.setFNodeIDField ("SmFNode"); transportationAnalystSetting.setTNodeIDField ( "SmTNode"); //创建交通网络分析对象并进行相应设置 TransportationAnalyst transportationAnalyst = new TransportationAnalyst(); transportationAnalyst.setAnalystSetting(transportationAnalystSetting); transportationAnalyst.load(); transportationAnalyst.createModel(MyApplication.SDCARD + "SuperMap/data/NetworkModel45.snm");