private static Set<VAccess> prepareDestSet(Connection connection, KeyedGraph<VAccess, Edge> graph, String destTable) throws SQLException { final Statement st = connection.createStatement(); Set<VAccess> destinations = new HashSet<VAccess>(); try { final TableLocation destinationTable = TableUtilities.parseInputTable(connection, destTable); final ResultSet rs = st.executeQuery( "SELECT " + DESTINATION + " FROM " + destinationTable); while (rs.next()) { destinations.add(graph.getVertex(rs.getInt(1))); } } finally { st.close(); } return destinations; }
private static Set<VAccess> prepareDestSet(Connection connection, KeyedGraph<VAccess, Edge> graph, String destTable) throws SQLException { final Statement st = connection.createStatement(); Set<VAccess> destinations = new HashSet<VAccess>(); try { final TableLocation destinationTable = TableUtilities.parseInputTable(connection, destTable); final ResultSet rs = st.executeQuery( "SELECT " + DESTINATION + " FROM " + destinationTable); while (rs.next()) { destinations.add(graph.getVertex(rs.getInt(1))); } } finally { st.close(); } return destinations; }
throws SQLException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final TableLocation nodesName = TableUtilities.suffixTableLocation(tableName, NODE_CENT_SUFFIX); final TableLocation edgesName = TableUtilities.suffixTableLocation(tableName, EDGE_CENT_SUFFIX);
throws SQLException, InvocationTargetException, NoSuchMethodException, InstantiationException, IllegalAccessException { final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final TableLocation nodesName = TableUtilities.suffixTableLocation(tableName, NODE_CENT_SUFFIX); final TableLocation edgesName = TableUtilities.suffixTableLocation(tableName, EDGE_CENT_SUFFIX);
TableUtilities.parseInputTable(connection, inputTable));
TableUtilities.parseInputTable(connection, inputTable));
throw new IllegalArgumentException("Only positive tolerances are allowed."); final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final TableLocation nodesName = TableUtilities.suffixTableLocation(tableName, NODES_SUFFIX); final TableLocation edgesName = TableUtilities.suffixTableLocation(tableName, EDGES_SUFFIX);
throw new IllegalArgumentException("Only positive tolerances are allowed."); final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final TableLocation nodesName = TableUtilities.suffixTableLocation(tableName, NODES_SUFFIX); final TableLocation edgesName = TableUtilities.suffixTableLocation(tableName, EDGES_SUFFIX);
throw new IllegalArgumentException("Only positive tolerances are allowed."); final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final TableLocation nodesName = TableUtilities.suffixTableLocation(tableName, NODES_SUFFIX); final TableLocation edgesName = TableUtilities.suffixTableLocation(tableName, EDGES_SUFFIX);
/** * Calculate the node and edge connected component tables. * * @param connection Connection * @param inputTable Edges table produced by ST_Graph * @param orientation Orientation string * @return True if the calculation was successful * @throws SQLException */ public static boolean getConnectedComponents(Connection connection, String inputTable, String orientation) throws SQLException { KeyedGraph graph = prepareGraph(connection, inputTable, orientation, null, VUCent.class, Edge.class); if (graph == null) { return false; } final List<Set<VUCent>> componentsList = getConnectedComponents(graph, orientation); final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final TableLocation nodesName = TableUtilities.suffixTableLocation(tableName, NODE_COMP_SUFFIX); final TableLocation edgesName = TableUtilities.suffixTableLocation(tableName, EDGE_COMP_SUFFIX); if (storeNodeConnectedComponents(connection, nodesName, edgesName, componentsList)) { if (storeEdgeConnectedComponents(connection, tableName, nodesName, edgesName)) { return true; } } return false; }
/** * Calculate the node and edge connected component tables. * * @param connection Connection * @param inputTable Edges table produced by ST_Graph * @param orientation Orientation string * @return True if the calculation was successful * @throws SQLException */ public static boolean getConnectedComponents(Connection connection, String inputTable, String orientation) throws SQLException { KeyedGraph graph = prepareGraph(connection, inputTable, orientation, null, VUCent.class, Edge.class); if (graph == null) { return false; } final List<Set<VUCent>> componentsList = getConnectedComponents(graph, orientation); final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final TableLocation nodesName = TableUtilities.suffixTableLocation(tableName, NODE_COMP_SUFFIX); final TableLocation edgesName = TableUtilities.suffixTableLocation(tableName, EDGE_COMP_SUFFIX); if (storeNodeConnectedComponents(connection, nodesName, edgesName, componentsList)) { if (storeEdgeConnectedComponents(connection, tableName, nodesName, edgesName)) { return true; } } return false; }
int source, int destination) throws SQLException { final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final String firstGeometryField = getFirstGeometryField(connection, tableName);
int source, int destination) throws SQLException { final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final String firstGeometryField = getFirstGeometryField(connection, tableName);
int source, double radius) throws SQLException { final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final String firstGeometryField = ST_ShortestPath.getFirstGeometryField(connection, tableName);
int source, double radius) throws SQLException { final TableLocation tableName = TableUtilities.parseInputTable(connection, inputTable); final String firstGeometryField = ST_ShortestPath.getFirstGeometryField(connection, tableName);