Package oracle.spatial.network
Class NetworkFactory
- java.lang.Object
-
- oracle.spatial.network.NetworkFactory
-
public class NetworkFactory extends java.lang.Object
This class handles network element creation for Oracle Spatial Network Data Model.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
addBidirectedLinkColumn(java.sql.Connection conn, Network network)
add a bidirected column to the network link tablestatic void
addColumn(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnName, java.lang.String columnDataType)
Add a column in a database tablestatic void
addUserDataSchema(java.sql.Connection conn, NetworkMetadata metadata)
static Path
createComplexPath(int id, Node startNode, Node endNode, Link[] links)
Creates a complex path with the specified start node and end nodestatic MDPoint[]
createConvexHull(JGeometry geom)
Creates a convex hull as an array of MDpoint for the specified geometry.static MDPoint[]
createConvexHull(MDPoint[] points)
Creates the convex hull as an array of MDpoint for the specified array of MDPoints.static MDPoint[]
createConvexHull(Network network)
Creates the convex hull as an array of MDpoint for the specified network.static Network
createDirectedNetwork()
static GeometryMetadata
createGeometryMetadata(java.lang.String tableName)
Deprecated.static GeometryMetadata
createGeometryMetadata(java.lang.String owner, java.lang.String tableName)
Creates a geometry metadata.static GeometryMetadata
createGeometryMetadata(java.lang.String tableName, java.lang.String geomColumnName, int srid, int noOfDims)
Deprecated.static GeometryMetadata
createGeometryMetadata(java.lang.String owner, java.lang.String tableName, java.lang.String geomColumnName, int srid, int noOfDims)
Creates a spatial geometry metadata.static Link
createLink(int id, java.lang.String name, Node startNode, Node endNode, double cost)
Creates a logical network link.static Link
createLink(int id, Network network, int startNodeID, int endNodeID, double cost)
Creates a logical network link.static Link
createLink(int id, Node startNode, Node endNode, double cost)
Creates a logical network link.JGeometry
createLinkGeometry(int srid, int noOfDims, double[] ordArray)
Returns a link geometry (a linestring JGeometry).static void
createLinkTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomType, java.lang.String geomColumnName, java.lang.String costColumnName, int noOfHierarchyLevels)
Creates an empty network link table in the database.static Link
createLogicalLink(int linkID, java.lang.String linkName, Node startNode, Node endNode, double cost)
Creates a logical link.static Network
createLogicalNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected)
Creates an empty logical network with the default naming convension: node table name = network_name + "_NODE$", link table name = network_name + "_LINK$, path table name = network_name + "_PATH$", path-link table name = network_name + "PLINK$", subPath table name = network_name + "SPATH$", all cost column name="COST".static Network
createLogicalNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, java.lang.String nodeTableName, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkCostColumn, java.lang.String pathTableName, java.lang.String pathLinkTableName)
Creates an empty logical network.static Network
createLogicalNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, java.lang.String nodeTableName, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkCostColumn, java.lang.String pathTableName, java.lang.String pathLinkTableName, java.lang.String subPathTableName)
Creates an empty logical network.static Node
createLogicalNode(int nodeID, java.lang.String nodeName)
Creates a logical node.static Link
createLRSLink(int linkID, java.lang.String linkName, Node startNode, Node endNode, double cost, int geomID, double startMeasure, double endMeasure, JGeometry geom)
Creates an LRS geometry link.static Network
createLRSNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String lrsTableName, java.lang.String lrsGeomColumn)
Creates an empty spatial LRS_GEOMETRY network.static Network
createLRSNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String nodeTableName, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkCostColumn, java.lang.String lrsTableName, java.lang.String lrsGeomColumn, java.lang.String pathTableName, java.lang.String pathGeomColumn, java.lang.String pathLinkTableName)
Creates an empty spatial LRS_GEOMETRY network.static Network
createLRSNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String nodeTableName, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkCostColumn, java.lang.String lrsTableName, java.lang.String lrsGeomColumn, java.lang.String pathTableName, java.lang.String pathGeomColumn, java.lang.String pathLinkTableName, java.lang.String subPathTableName, java.lang.String subPathGeomColumn)
Creates an empty spatial LRS_GEOMETRY network.static Node
createLRSNode(int nodeID, java.lang.String nodeName, int geomID, double measure, JGeometry geom)
Creates an LRS geometry node.static void
createLRSTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName)
Creates an empty network LRS table in the database.static MBR
createMBR(double[] min, double[] max)
Creates an MBR.static MBR
createMBR(JGeometry geom)
Creates an MBR of the specified geometry.static MDPoint
createMDPoint(double x)
Creates a 1D MDPoint.static MDPoint
createMDPoint(double[] pt)
Creates an MDPoint.static MDPoint
createMDPoint(double x, double y)
Creates a 2D MDPoint.static MDPoint
createMDPoint(double x, double y, double z)
Creates a 3D MDPoint.static Network
createNetwork(Network network)
Creates an empty network from the specified network (metadata).static void
createNetworkTables(java.sql.Connection conn, Network network)
Creates the network tables based on the specified network metadata.static Node
createNode(int id)
Creates a logical network node.static Node
createNode(int id, double x, double y)
Creates a spatial network node.static Node
createNode(int id, java.lang.String name)
Creates a logical network node.JGeometry
createNodeGeometry(int srid, int noOfDims, double[] ordArray)
Returns a node point geometry (JGeometry).static void
createNodeTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomType, java.lang.String geomColumnName, java.lang.String costColumnName, int noOfHierarchyLevels)
Creates an empty network node table in the database.static void
createNodeTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomType, java.lang.String geomColumnName, java.lang.String costColumnName, java.lang.String partitionColumnName, int noOfHierarchyLevels)
Creates an empty network node table in the database.static Network
createPartitionNetwork(java.sql.Connection conn, java.lang.String networkName, java.lang.String partitionNetworkName)
Returns the partition network with the partitions as nodes and the connections between partitions as links.static Network
createPartitionNetwork(Network network, java.lang.String partitionNetworkName)
Returns the partition network with the partitions as nodes and the connections between partitions as links.static void
createPartitionTable(java.sql.Connection conn, java.lang.String tableName)
Creates an empty network partition table in the database.static Path
createPath(int id, Node startNode, Node endNode, Link[] links)
Creates a path with the specified start node and the specified end node.static Path
createPath(Node startNode, Node endNode)
Creates an empty path with the specified start node and end node.static Path
createPath(Node startNode, Node endNode, Link[] links)
Creates a path with the specified start node and the specified end node.static void
createPathLinkTable(java.sql.Connection conn, java.lang.String tableName)
Creates an empty network path-link table in the database.static void
createPathTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName)
Creates an empty network path table in the database.static SDODimArray
createSDODimArray(boolean isGeodetic, double lowerBound, double upperBound, double tolerance)
Creates a java 2D SDO_DIM_ARRAY.static SDODimArray
createSDODimArray(java.lang.String[] dimNames, double[] lowerBounds, double[] upperBounds, double[] tolerances)
Creates a java SDO_DIM_ARRAY.static Link
createSDOLink(int linkID, java.lang.String linkName, Node startNode, Node endNode, double cost, double[] ords, int dimNo, int srid)
Creates an SDO geometry link.static Link
createSDOLink(int linkID, java.lang.String linkName, Node startNode, Node endNode, double cost, JGeometry geom)
Creates an SDO geometry link.static Network
createSDONetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims)
Creates an empty spatial SDO_GEOMETRY network with the default naming convension: node table name = network_name + "_NODE$", link table name = network_name + "_LINK$, path table name = network_name + "_PATH$", path-link table name = network_name + "PLINK$", subpath table name = network_name + "_SPATH$", all geometry columnstatic Network
createSDONetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String nodeTableName, java.lang.String nodeGeomColumn, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkGeomColumn, java.lang.String linkCostColumn, java.lang.String pathTableName, java.lang.String pathGeomColumn, java.lang.String pathLinkTableName)
Creates an empty spatial SDO_GEOMETRY network.static Network
createSDONetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String nodeTableName, java.lang.String nodeGeomColumn, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkGeomColumn, java.lang.String linkCostColumn, java.lang.String pathTableName, java.lang.String pathGeomColumn, java.lang.String pathLinkTableName, java.lang.String subPathTableName, java.lang.String subPathGeomColumn)
Creates an empty spatial SDO_GEOMETRY network.static Node
createSDONode(int nodeID, java.lang.String nodeName, double x, double y)
Creates a spatial node (SDO_GEOMETRY with SRID = 0).static Node
createSDONode(int nodeID, java.lang.String nodeName, double x, double y, int srid)
Creates a spatial node (SDO_GEOMETRY).static Path
createSimplePath(int id, Node startNode, Node endNode, Link[] links)
Creates a simple path with the specified start node and end node.static SubPath
createSubPath(int id, Path referencePath, int startLinkIndex, double startPercentage, int endLinkIndex, double endPercentage)
Creates a sub pathstatic SubPath
createSubPath(Path referencePath, int startLinkIndex, double startPercentage, int endLinkIndex, double endPercentage)
Creates a sub pathstatic void
createSubPathTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName)
Creates an empty network subpath table in the database.static Tree
createTree(TreeNode root)
Creates a tree.static Tree
createTree(TreeNode root, boolean forward)
Creates a tree.static TreeLink
createTreeLink(Link link)
Creates a tree link containing a regular network linkstatic TreeLink
createTreeLink(Link link, double startPercentage, double endPercentage)
Creates a tree link containing a partial linkstatic TreeNode
createTreeNode(Link link, double percentage)
Creates a tree node containg a node on a linkstatic TreeNode
createTreeNode(Node node)
Creates a tree node containing a regular node
-
-
-
Method Detail
-
createDirectedNetwork
public static Network createDirectedNetwork()
-
createNetwork
public static Network createNetwork(Network network)
Creates an empty network from the specified network (metadata).- Parameters:
network
- the specified network
-
createNode
public static Node createNode(int id)
Creates a logical network node.- Parameters:
id
- the node ID
-
createNode
public static Node createNode(int id, java.lang.String name)
Creates a logical network node.- Parameters:
id
- the node IDname
- node Name
-
createNode
public static Node createNode(int id, double x, double y)
Creates a spatial network node.- Parameters:
id
- the node IDx
- the x ordinatey
- the y ordinate
-
createLink
public static Link createLink(int id, java.lang.String name, Node startNode, Node endNode, double cost)
Creates a logical network link.- Parameters:
id
- the link IDname
- the link namestartNode
- the start nodeendNode
- the end nodecost
- the link cost
-
createLink
public static Link createLink(int id, Node startNode, Node endNode, double cost)
Creates a logical network link.- Parameters:
id
- the link IDstartNode
- the start nodeendNode
- the end nodecost
- the link cost
-
createLink
public static Link createLink(int id, Network network, int startNodeID, int endNodeID, double cost) throws NetworkDataException
Creates a logical network link.- Parameters:
id
- the link IDnetwork
- the specified networkstartNodeID
- the start node IDendNodeID
- the end node IDcost
- the link cost- Throws:
NetworkDataException
-
createPath
public static Path createPath(Node startNode, Node endNode)
Creates an empty path with the specified start node and end node.- Parameters:
startNode
- the start nodeendNode
- the end node
-
createSimplePath
public static Path createSimplePath(int id, Node startNode, Node endNode, Link[] links) throws NetworkDataException
Creates a simple path with the specified start node and end node.- Parameters:
id
- the path IDstartNode
- the start nodeendNode
- the end nodelinks
- the array of the path links- Throws:
NetworkDataException
-
createComplexPath
public static Path createComplexPath(int id, Node startNode, Node endNode, Link[] links) throws NetworkDataException
Creates a complex path with the specified start node and end node- Parameters:
id
- the path IDstartNode
- the start nodeendNode
- the end nodelinks
- the array of the path links- Throws:
NetworkDataException
-
createPath
public static Path createPath(Node startNode, Node endNode, Link[] links)
Creates a path with the specified start node and the specified end node.- Parameters:
startNode
- the start nodeendNode
- the end nodelinks
- the array of the path links
-
createPath
public static Path createPath(int id, Node startNode, Node endNode, Link[] links)
Creates a path with the specified start node and the specified end node.- Parameters:
id
- the path IDstartNode
- the start nodeendNode
- the end nodelinks
- the array of the path links
-
createMBR
public static MBR createMBR(double[] min, double[] max)
Creates an MBR.- Parameters:
min
- the ordinates of low pointmax
- the ordinates of high point
-
createMBR
public static MBR createMBR(JGeometry geom)
Creates an MBR of the specified geometry.- Parameters:
geom
- the specified geometry
-
createMDPoint
public static MDPoint createMDPoint(double[] pt)
Creates an MDPoint.- Parameters:
pt
- the point ordinates
-
createMDPoint
public static MDPoint createMDPoint(double x)
Creates a 1D MDPoint.- Parameters:
x
- the x ordinate
-
createMDPoint
public static MDPoint createMDPoint(double x, double y)
Creates a 2D MDPoint.- Parameters:
x
- the x ordinatey
- the y ordinate
-
createMDPoint
public static MDPoint createMDPoint(double x, double y, double z)
Creates a 3D MDPoint.- Parameters:
x
- the x ordinatey
- the y ordinatez
- the z ordinate
-
createConvexHull
public static MDPoint[] createConvexHull(JGeometry geom)
Creates a convex hull as an array of MDpoint for the specified geometry.- Parameters:
geom
- the specified geometry
-
createConvexHull
public static MDPoint[] createConvexHull(MDPoint[] points)
Creates the convex hull as an array of MDpoint for the specified array of MDPoints.- Parameters:
points
-
-
createConvexHull
public static MDPoint[] createConvexHull(Network network)
Creates the convex hull as an array of MDpoint for the specified network.- Parameters:
network
- network from which the convex hull is to be created
-
createGeometryMetadata
public static GeometryMetadata createGeometryMetadata(java.lang.String tableName)
Deprecated.Creates a geometry metadata.
-
createGeometryMetadata
public static GeometryMetadata createGeometryMetadata(java.lang.String owner, java.lang.String tableName)
Creates a geometry metadata.
-
createGeometryMetadata
public static GeometryMetadata createGeometryMetadata(java.lang.String tableName, java.lang.String geomColumnName, int srid, int noOfDims)
Deprecated.Creates a spatial geometry metadata.- Parameters:
tableName
- the geometry table NamegeomColumnName
- the geometry column namesrid
- the SRIDnoOfDims
- the number of dimensions
-
createGeometryMetadata
public static GeometryMetadata createGeometryMetadata(java.lang.String owner, java.lang.String tableName, java.lang.String geomColumnName, int srid, int noOfDims)
Creates a spatial geometry metadata.- Parameters:
tableName
- the geometry table NamegeomColumnName
- the geometry column namesrid
- the SRIDnoOfDims
- the number of dimensions
-
createLogicalNetwork
public static Network createLogicalNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, java.lang.String nodeTableName, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkCostColumn, java.lang.String pathTableName, java.lang.String pathLinkTableName)
Creates an empty logical network.- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?nodeTableName
- the node table name namenodeCostColumn
- the node cost columnlinkTableName
- the link table namelinkCostColumn
- the link cost column namepathTableName
- the path table namepathLinkTableName
- the path-link table name
-
createLogicalNetwork
public static Network createLogicalNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, java.lang.String nodeTableName, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkCostColumn, java.lang.String pathTableName, java.lang.String pathLinkTableName, java.lang.String subPathTableName)
Creates an empty logical network.- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?nodeTableName
- the node table name namenodeCostColumn
- the node cost columnlinkTableName
- the link table namelinkCostColumn
- the link cost column namepathTableName
- the path table namepathLinkTableName
- the path-link table nameisComplex
- is this network a complex network that referes to other networks
-
createLogicalNetwork
public static Network createLogicalNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected)
Creates an empty logical network with the default naming convension: node table name = network_name + "_NODE$", link table name = network_name + "_LINK$, path table name = network_name + "_PATH$", path-link table name = network_name + "PLINK$", subPath table name = network_name + "SPATH$", all cost column name="COST".- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?
-
createSDONetwork
public static Network createSDONetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String nodeTableName, java.lang.String nodeGeomColumn, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkGeomColumn, java.lang.String linkCostColumn, java.lang.String pathTableName, java.lang.String pathGeomColumn, java.lang.String pathLinkTableName)
Creates an empty spatial SDO_GEOMETRY network.- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?srid
- the SRIDnoOfDims
- the number of dimensionsnodeTableName
- the node table namenodeGeomColumn
- the node geometry column namenodeCostColumn
- the node cost column namelinkTableName
- the link table namelinkGeomColumn
- the link geometry column namelinkCostColumn
- the link cost column namepathTableName
- the path table namepathGeomColumn
- the path geometry column namepathLinkTableName
- the path link table name
-
createSDONetwork
public static Network createSDONetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String nodeTableName, java.lang.String nodeGeomColumn, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkGeomColumn, java.lang.String linkCostColumn, java.lang.String pathTableName, java.lang.String pathGeomColumn, java.lang.String pathLinkTableName, java.lang.String subPathTableName, java.lang.String subPathGeomColumn)
Creates an empty spatial SDO_GEOMETRY network.- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?srid
- the SRIDnoOfDims
- the number of dimensionsnodeTableName
- the node table namenodeGeomColumn
- the node geometry column namenodeCostColumn
- the node cost column namelinkTableName
- the link table namelinkGeomColumn
- the link geometry column namelinkCostColumn
- the link cost column namepathTableName
- the path table namepathGeomColumn
- the path geometry column namepathLinkTableName
- the path link table namesubPathTableName
- the subpath table namesubPathGeomColumn
- the subpath geometry column name
-
createSDONetwork
public static Network createSDONetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims)
Creates an empty spatial SDO_GEOMETRY network with the default naming convension: node table name = network_name + "_NODE$", link table name = network_name + "_LINK$, path table name = network_name + "_PATH$", path-link table name = network_name + "PLINK$", subpath table name = network_name + "_SPATH$", all geometry column name="GEOMETRY" and all cost column- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?srid
- the SRIDnoOfDims
- the number of dimensions
-
createLRSNetwork
public static Network createLRSNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String nodeTableName, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkCostColumn, java.lang.String lrsTableName, java.lang.String lrsGeomColumn, java.lang.String pathTableName, java.lang.String pathGeomColumn, java.lang.String pathLinkTableName, java.lang.String subPathTableName, java.lang.String subPathGeomColumn)
Creates an empty spatial LRS_GEOMETRY network.- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?srid
- the SRIDnoOfDims
- the number of dimensionsnodeTableName
- the node table namenodeCostColumn
- the node cost column namelinkTableName
- the link table namelinkCostColumn
- the link cost column namelrsTableName
- the LRS table namelrsGeomColumn
- the LRS geometry column namepathTableName
- the path table namepathGeomColumn
- the path geometry columnpathLinkTableName
- the path link table namesubPathTableName
- the path table namesubPathGeomColumn
- the path geometry column networks
-
createLRSNetwork
public static Network createLRSNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String nodeTableName, java.lang.String nodeCostColumn, java.lang.String linkTableName, java.lang.String linkCostColumn, java.lang.String lrsTableName, java.lang.String lrsGeomColumn, java.lang.String pathTableName, java.lang.String pathGeomColumn, java.lang.String pathLinkTableName)
Creates an empty spatial LRS_GEOMETRY network.- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?srid
- the SRIDnoOfDims
- the number of dimensionsnodeTableName
- the node table namenodeCostColumn
- the node cost column namelinkTableName
- the link table namelinkCostColumn
- the link cost column namelrsTableName
- the LRS table namelrsGeomColumn
- the LRS geometry column namepathTableName
- the path table namepathGeomColumn
- the path geometry columnpathLinkTableName
- the path link table name
-
createLRSNetwork
public static Network createLRSNetwork(java.lang.String networkName, int noOfHierarchyLevels, boolean isDirected, int srid, int noOfDims, java.lang.String lrsTableName, java.lang.String lrsGeomColumn)
Creates an empty spatial LRS_GEOMETRY network.- Parameters:
networkName
- the network namenoOfHierarchyLevels
- the number of hierarchy levelsisDirected
- is the network directed?srid
- the SRIDnoOfDims
- the number of dimensionslrsTableName
- the LRS table namelrsGeomColumn
- the LRS geometry column name
-
createNodeTable
public static void createNodeTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomType, java.lang.String geomColumnName, java.lang.String costColumnName, java.lang.String partitionColumnName, int noOfHierarchyLevels) throws java.sql.SQLException
Creates an empty network node table in the database.- Parameters:
conn
- the database connectiontableName
- the node table namegeomType
- the geometry type: (null | "SDO_GEOMETRY" |"LRS_GEOMETRY" | "TOPO_GEOMETRY"geomColumnName
- the geometry column namecostColumnName
- the node cost columnpartitionColumnName
- the node partition column namenoOfHierarchyLevels
- the number of hierarchy levels- Throws:
java.sql.SQLException
-
createNodeTable
public static void createNodeTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomType, java.lang.String geomColumnName, java.lang.String costColumnName, int noOfHierarchyLevels) throws java.sql.SQLException
Creates an empty network node table in the database.- Parameters:
conn
- the database connectiontableName
- the node table namegeomType
- the geometry type: (null | "SDO_GEOMETRY" |"LRS_GEOMETRY" | "TOPO_GEOMETRY"geomColumnName
- the geometry column namecostColumnName
- the node cost columnnoOfHierarchyLevels
- the number of hierarchy levels- Throws:
java.sql.SQLException
-
createLinkTable
public static void createLinkTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomType, java.lang.String geomColumnName, java.lang.String costColumnName, int noOfHierarchyLevels) throws java.sql.SQLException
Creates an empty network link table in the database.- Parameters:
conn
- the database connectiontableName
- the link table namegeomType
- geometry type: (null | "SDO_GEOMETRY" |"LRS_GEOMETRY" | "TOPO_GEOMETRY"geomColumnName
- the geometry column namecostColumnName
- the link cost column namenoOfHierarchyLevels
- the number of hierarchy levels- Throws:
java.sql.SQLException
-
createLRSTable
public static void createLRSTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName) throws java.sql.SQLException
Creates an empty network LRS table in the database.- Parameters:
conn
- the database connectiontableName
- the LRS table namegeomColumnName
- the LRS geometry column name- Throws:
java.sql.SQLException
-
createPathTable
public static void createPathTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName) throws java.sql.SQLException
Creates an empty network path table in the database.- Parameters:
conn
- the database connectiontableName
- the path table namegeomColumnName
- the path geometry column name- Throws:
java.sql.SQLException
-
createSubPathTable
public static void createSubPathTable(java.sql.Connection conn, java.lang.String tableName, java.lang.String geomColumnName) throws java.sql.SQLException
Creates an empty network subpath table in the database.- Parameters:
conn
- the database connectiontableName
- the subpath table namegeomColumnName
- the subpath geometry column name- Throws:
java.sql.SQLException
-
createPathLinkTable
public static void createPathLinkTable(java.sql.Connection conn, java.lang.String tableName) throws java.sql.SQLException
Creates an empty network path-link table in the database.- Parameters:
conn
- the database connectiontableName
- the path-link table name- Throws:
java.sql.SQLException
-
createPartitionTable
public static void createPartitionTable(java.sql.Connection conn, java.lang.String tableName) throws java.sql.SQLException
Creates an empty network partition table in the database.- Parameters:
conn
- the database connectiontableName
- the partition table name- Throws:
java.sql.SQLException
-
createLogicalNode
public static Node createLogicalNode(int nodeID, java.lang.String nodeName)
Creates a logical node.- Parameters:
nodeID
- the node IDnodeName
- the node name
-
createSDONode
public static Node createSDONode(int nodeID, java.lang.String nodeName, double x, double y, int srid)
Creates a spatial node (SDO_GEOMETRY).- Parameters:
nodeID
- the node IDnodeName
- the node namex
- the x ordiaatey
- the y ordinatesrid
- SRID for the node geometry
-
createSDONode
public static Node createSDONode(int nodeID, java.lang.String nodeName, double x, double y)
Creates a spatial node (SDO_GEOMETRY with SRID = 0).- Parameters:
nodeID
- the node IDnodeName
- the node namex
- the x ordiaatey
- the y ordinate
-
createLRSNode
public static Node createLRSNode(int nodeID, java.lang.String nodeName, int geomID, double measure, JGeometry geom)
Creates an LRS geometry node.- Parameters:
nodeID
- the node IDnodeName
- the node namegeomID
- the LRS geometry IDmeasure
- the LRS node measuregeom
- the node geometry
-
createLogicalLink
public static Link createLogicalLink(int linkID, java.lang.String linkName, Node startNode, Node endNode, double cost)
Creates a logical link.- Parameters:
linkID
- the link IDlinkName
- the link namestartNode
- the start nodeendNode
- the end nodecost
- the link cost
-
createSDOLink
public static Link createSDOLink(int linkID, java.lang.String linkName, Node startNode, Node endNode, double cost, double[] ords, int dimNo, int srid)
Creates an SDO geometry link.- Parameters:
linkID
- the link IDlinkName
- the link namestartNode
- the start nodeendNode
- the end nodecost
- the link costords
- the geometry odrinatesdimNo
- the number of dimensionssrid
- the SRID
-
createSDOLink
public static Link createSDOLink(int linkID, java.lang.String linkName, Node startNode, Node endNode, double cost, JGeometry geom)
Creates an SDO geometry link.- Parameters:
linkID
- the link IDlinkName
- the link namestartNode
- the start nodeendNode
- the end nodecost
- the link costgeom
- the link geometry
-
createLRSLink
public static Link createLRSLink(int linkID, java.lang.String linkName, Node startNode, Node endNode, double cost, int geomID, double startMeasure, double endMeasure, JGeometry geom)
Creates an LRS geometry link.- Parameters:
linkID
- the link IDlinkName
- the link namestartNode
- the start nodeendNode
- the end nodecost
- the link costgeom
- the link geometrygeomID
- the LRS geometry IDstartMeasure
- the LRS start measureendMeasure
- the LRS end measure
-
createNetworkTables
public static void createNetworkTables(java.sql.Connection conn, Network network) throws java.sql.SQLException, NetworkDataException
Creates the network tables based on the specified network metadata. The following tables will be created: node table, link table, path table and path-link table (if specified)- Parameters:
conn
- the database connectionnetwork
- the specified network- Throws:
java.sql.SQLException
NetworkDataException
-
createSDODimArray
public static SDODimArray createSDODimArray(java.lang.String[] dimNames, double[] lowerBounds, double[] upperBounds, double[] tolerances)
Creates a java SDO_DIM_ARRAY.- Parameters:
dimNames
- the dimension nameslowerBounds
- the lower boundsupperBounds
- the upper boundstolerances
- the tolerances
-
createSDODimArray
public static SDODimArray createSDODimArray(boolean isGeodetic, double lowerBound, double upperBound, double tolerance)
Creates a java 2D SDO_DIM_ARRAY.- Parameters:
isGeodetic
- is it in a geodetic coordinate (lat., lon.)?lowerBound
- the lower boundupperBound
- the upper boundtolerance
- the tolerance
-
createNodeGeometry
public JGeometry createNodeGeometry(int srid, int noOfDims, double[] ordArray)
Returns a node point geometry (JGeometry).- Parameters:
srid
- the SRIDnoOfDims
- the number of dimensionsordArray
- the ordinate array of the point geometry
-
createLinkGeometry
public JGeometry createLinkGeometry(int srid, int noOfDims, double[] ordArray)
Returns a link geometry (a linestring JGeometry).- Parameters:
srid
- the SRIDnoOfDims
- the number of the dimensionsordArray
- the ordinate array of the link geometry(x1,y1,....xn,yn)
-
createPartitionNetwork
public static Network createPartitionNetwork(java.sql.Connection conn, java.lang.String networkName, java.lang.String partitionNetworkName) throws java.sql.SQLException, NetworkDataException
Returns the partition network with the partitions as nodes and the connections between partitions as links. The partition network represents the connection relationship between the partitions of the specified partitioned network- Parameters:
conn
- the database connectionnetworkName
- the network namepartitionNetworkName
- the resulting partition network name- Throws:
java.sql.SQLException
NetworkDataException
-
createPartitionNetwork
public static Network createPartitionNetwork(Network network, java.lang.String partitionNetworkName) throws NetworkDataException
Returns the partition network with the partitions as nodes and the connections between partitions as links. The partition network represents the connection relationship between the partitions of the specified partitioned network- Parameters:
network
- the network namepartitionNetworkName
- the resulting partition network name- Throws:
NetworkDataException
-
addColumn
public static void addColumn(java.sql.Connection conn, java.lang.String tableName, java.lang.String columnName, java.lang.String columnDataType) throws java.sql.SQLException, NetworkDataException
Add a column in a database table- Parameters:
conn
- database connectiontableName
- table namecolumnName
- column name to be addedcolumnDataType
- data type for the column- Throws:
java.sql.SQLException
NetworkDataException
-
addBidirectedLinkColumn
public static void addBidirectedLinkColumn(java.sql.Connection conn, Network network) throws java.sql.SQLException, NetworkDataException
add a bidirected column to the network link table- Parameters:
conn
- database connectionnetwork
- network object- Throws:
java.sql.SQLException
NetworkDataException
-
addUserDataSchema
public static void addUserDataSchema(java.sql.Connection conn, NetworkMetadata metadata) throws java.sql.SQLException, NetworkDataException
- Throws:
java.sql.SQLException
NetworkDataException
-
createSubPath
public static SubPath createSubPath(Path referencePath, int startLinkIndex, double startPercentage, int endLinkIndex, double endPercentage) throws NetworkDataException
Creates a sub path- Parameters:
referencePath
- reference path for the sub pathstartLinkIndex
- start link index of the sub path [0,noOfLinks-1]startPercentage
- end link index of the sub path [0,noOfLinks-1]endLinkIndex
- start percentage of the sub path [0,1]endPercentage
- end percentage of the sub path [0,1]- Returns:
- SubPath
- Throws:
NetworkDataException
-
createSubPath
public static SubPath createSubPath(int id, Path referencePath, int startLinkIndex, double startPercentage, int endLinkIndex, double endPercentage) throws NetworkDataException
Creates a sub path- Parameters:
id
- subpath IDreferencePath
- reference path for the sub pathstartLinkIndex
- start link index of the sub path [0,noOfLinks-1]startPercentage
- end link index of the sub path [0,noOfLinks-1]endLinkIndex
- start percentage of the sub path [0,1]endPercentage
- end percentage of the sub path [0,1]- Returns:
- SubPath
- Throws:
NetworkDataException
-
createTree
public static Tree createTree(TreeNode root, boolean forward)
Creates a tree. The tree nodes of a tree can either contain a regular node or a node on a link. The tree links of a tree can contain either a regular link or a partial link. A node on a link is defined by a link and a percentage information. A partial link is defined by a link , a start percentage and an end percentage.- Parameters:
root
- root node of the treeforward
- true if the traverse direction is forward (starting from root), false backward- Returns:
- Tree
-
createTree
public static Tree createTree(TreeNode root)
Creates a tree. The tree nodes of a tree can either contain a regular node or a node on a link. The tree links of a tree can contain either a regular link or a partial link. A node on a link is defined by a link and a percentage information. A partial link is defined by a link , a start percentage and an end percentage. The traverse direction is forward.- Parameters:
root
- root node of the tree- Returns:
- Tree
-
createTreeNode
public static TreeNode createTreeNode(Node node)
Creates a tree node containing a regular node- Parameters:
node
- a network node- Returns:
- TREENode
-
createTreeNode
public static TreeNode createTreeNode(Link link, double percentage) throws NetworkDataException
Creates a tree node containg a node on a link- Parameters:
link
- given network linkpercentage
- percentage information (between 0 and 1)- Returns:
- TreeNode
- Throws:
NetworkDataException
-
createTreeLink
public static TreeLink createTreeLink(Link link)
Creates a tree link containing a regular network link- Parameters:
link
- network link- Returns:
- TreeLink
-
createTreeLink
public static TreeLink createTreeLink(Link link, double startPercentage, double endPercentage) throws NetworkDataException
Creates a tree link containing a partial link- Parameters:
link
- the given network linkstartPercentage
- start percentage of the partial linkendPercentage
- end percentage of the partial link- Returns:
- TreeLink
- Throws:
NetworkDataException
-
-