public abstract class TopologicalSchema
extends com.supermap.data.InternalHandleDisposable
限定符和类型 | 方法和说明 |
---|---|
void |
addSteppedListener(SteppedListener l)
添加一个用于接收进度条事件(
SteppedEvent )的监听器。 |
DatasetVector |
build(DatasetVector networkDataset)
根据二维网络数据集构建拓扑逻辑图。
|
DatasetVector |
build(NetworkEdge[] networkEdges,
NetworkNode[] networkNodes,
boolean isMerge,
double tolerance)
根据网络弧段和网络结点表示的网络关系,构建拓扑逻辑图。
|
DatasetVector |
build(NetworkEdgeID[] networkEdgeIDs)
根据网络弧段标识表示的网络关系,构建拓扑逻辑图。
|
void |
dispose()
释放所占有的本地资源。
|
String |
getOutputDatasetName()
获取结果数据集的名称。
|
Datasource |
getOutputDatasource()
获取结果数据集所在的数据源。
|
void |
removeSteppedListener(SteppedListener l)
移除一个进度条事件(
SteppedEvent )的监听器。 |
void |
setOutputDatasetName(String value)
设置结果数据集的名称。
|
void |
setOutputDatasource(Datasource value)
设置结果数据集所在的数据源。
|
public void dispose()
public Datasource getOutputDatasource()
public void setOutputDatasource(Datasource value)
value
- 结果数据源对象。public String getOutputDatasetName()
public void setOutputDatasetName(String value)
value
- 结果数据集的名称。public DatasetVector build(NetworkEdgeID[] networkEdgeIDs)
networkEdgeIDs
- 表示网络关系的弧段标识对象集合。public boolean TestHierarchicalSchema(Datasource datasource) { if (datasource == null) { System.out.println("数据源为空"); return false; } String datasetName = "SrcNet"; DatasetVector datasetNet = (DatasetVector) datasource.getDatasets() .get(datasetName); if (datasetNet == null) { System.out.println("获取网络数据集失败"); return false; } datasetNet.open(); Recordset recordset = datasetNet.getRecordset(false, CursorType.STATIC); if (recordset == null) { System.out.println("查询记录集失败"); return false; } // 获取网络弧段标识信息 String edgeIDField = datasetNet.getFieldNameBySign(FieldSign.EDGEID); String fromNodeIDField = datasetNet.getFieldNameBySign(FieldSign.FNODE); String toNodeIDField = datasetNet.getFieldNameBySign(FieldSign.TNODE); NetworkEdgeID[] networkEdgeIDs = new NetworkEdgeID[recordset .getRecordCount()]; int i = 0; while (!recordset.isEOF()) { NetworkEdgeID networkEdgeID = new NetworkEdgeID(); networkEdgeID.setEdgeID(recordset.getInt32(edgeIDField)); networkEdgeID.setFromNodeID(recordset.getInt32(fromNodeIDField)); networkEdgeID.setToNodeID(recordset.getInt32(toNodeIDField)); networkEdgeIDs[i++] = networkEdgeID; recordset.moveNext(); } recordset.dispose(); TopologicalHierarchicalSchema hierarchicalSchema = new TopologicalHierarchicalSchema(); hierarchicalSchema.setOutputDatasetName(datasource.getDatasets() .getAvailableDatasetName("ResultSchema")); hierarchicalSchema.setOutputDatasource(datasource); DatasetVector resultDt = hierarchicalSchema.build(networkEdgeIDs); // 等级拓扑图对象释放 hierarchicalSchema.dispose(); return resultDt != null; }
public DatasetVector build(DatasetVector networkDataset)
networkDataset
- 指定的二维网络数据集。public boolean testTreeSchema(Datasource datasource) { if (datasource == null) { System.out.println("数据源为空"); return false; } String datasetName = "SrcNet"; DatasetVector datasetNet = (DatasetVector) datasource.getDatasets() .get(datasetName); if (datasetNet == null) { System.out.println("获取网络数据集失败"); return false; } TopologicalTreeSchema treeSchema = new TopologicalTreeSchema(); treeSchema.setNodeSpacing(20); treeSchema.setLevelSpacing(50); treeSchema.setOutputDatasetName(datasource.getDatasets() .getAvailableDatasetName("ResultSchema")); treeSchema.setOutputDatasource(datasource); DatasetVector resultDt = treeSchema.build(datasetNet); treeSchema.dispose(); return resultDt != null; }
public DatasetVector build(NetworkEdge[] networkEdges, NetworkNode[] networkNodes, boolean isMerge, double tolerance)
networkEdges
- 表示网络关系的网络弧段对象集合。networkNodes
- 表示网络关系的网络结点对象集合。isMerge
- 是否设置合并空间位置上重复的网络弧段和网络结点对象。网络关系中,如果存在空间位置上的重复弧段和重复结点,
如果设置此参数为true
,则会提取一份公共的弧段关系构建逻辑图,在构建的拓扑逻辑图也含有空间位置上的重复弧段和结点。如果设置此参数为false
,则计算拓扑逻辑图时对每条正确的网络拓扑关系都正常处理。tolerance
- 节点容限,用于空间计算中节点对象比较。如果isMerge参数为true,则此参数有效,否则此参数无效。public boolean testOrthogonalSchema(Datasource datasource) { if (datasource == null) { System.out.println("数据源为空"); return false; } String datasetName = "SrcNet"; DatasetVector datasetNet = (DatasetVector) datasource.getDatasets() .get(datasetName); if (datasetNet == null) { System.out.println("获取网络数据集失败"); return false; } DatasetVector datasetNetNode = datasetNet.getChildDataset(); if (datasetNetNode == null) { System.out.println("获取网络数据集结点数据集失败"); return false; } datasetNet.open(); datasetNetNode.open(); Recordset recordset = datasetNet.getRecordset(false, CursorType.STATIC); if (recordset == null) { System.out.println("查询记录集失败"); return false; } Recordset recordsetNode = datasetNetNode.getRecordset(false, CursorType.STATIC); if (recordsetNode == null) { recordset.dispose(); System.out.println("查询记录集失败"); return false; } String edgeIDField = datasetNet.getFieldNameBySign(FieldSign.EDGEID); String fromNodeIDField = datasetNet.getFieldNameBySign(FieldSign.FNODE); String toNodeIDField = datasetNet.getFieldNameBySign(FieldSign.TNODE); NetworkEdge[] networkEdges = new NetworkEdge[recordset.getRecordCount()]; int i = 0; while (!recordset.isEOF()) { NetworkEdge networkEdge = new NetworkEdge(); NetworkEdgeID networkEdgeID = new NetworkEdgeID(); networkEdgeID.setEdgeID(recordset.getInt32(edgeIDField)); networkEdgeID.setFromNodeID(recordset.getInt32(fromNodeIDField)); networkEdgeID.setToNodeID(recordset.getInt32(toNodeIDField)); networkEdge.setNetworkEdgeID(networkEdgeID); networkEdge.setEdge(recordset.getGeometry()); networkEdges[i++] = networkEdge; recordset.moveNext(); } recordset.dispose(); String nodeIDField = datasetNet.getFieldNameBySign(FieldSign.NODEID); NetworkNode[] networkNodes = new NetworkNode[recordsetNode .getRecordCount()]; i = 0; while (!recordsetNode.isEOF()) { networkNodes[i] = new NetworkNode(); networkNodes[i].setNodeID(recordsetNode.getInt32(nodeIDField)); networkNodes[i].setNode(recordsetNode.getGeometry()); i++; recordsetNode.moveNext(); } recordsetNode.dispose(); boolean isMerge = false; double tolerance = 1e-8; TopologicalOrthogonalSchema orthogonalSchema = new TopologicalOrthogonalSchema(); orthogonalSchema.setOutputDatasetName(datasource.getDatasets() .getAvailableDatasetName("ResultSchema")); orthogonalSchema.setOutputDatasource(datasource); DatasetVector resultDt = orthogonalSchema.build(networkEdges, networkNodes, isMerge, tolerance); orthogonalSchema.dispose(); for (NetworkEdge networkEdge : networkEdges) { networkEdge.getEdge().dispose(); } for (NetworkNode networkNode : networkNodes) { networkNode.getNode().dispose(); } return resultDt != null; }
public void addSteppedListener(SteppedListener l)
SteppedEvent
)的监听器。l
- 一个用于接收进度条事件的监听器。public void removeSteppedListener(SteppedListener l)
SteppedEvent
)的监听器。l
- 一个用于接收进度条事件的监听器。Copyright © 2021–2024 SuperMap. All rights reserved.