org.h2gis.network.graph_creator
Class ST_ShortestPathLength

java.lang.Object
  extended by org.h2gis.h2spatialapi.AbstractFunction
      extended by org.h2gis.network.graph_creator.GraphFunction
          extended by org.h2gis.network.graph_creator.ST_ShortestPathLength
All Implemented Interfaces:
Function, ScalarFunction

public class ST_ShortestPathLength
extends GraphFunction
implements ScalarFunction

Calculates the length(s) of shortest path(s) between vertices in a JGraphT graph produced from the input_edges table produced by ST_Graph.

Author:
Adam Gouge

Field Summary
static int DESTINATION_INDEX
           
static int DISTANCE_INDEX
           
static String REMARKS
           
static int SOURCE_INDEX
           
 
Fields inherited from class org.h2gis.network.graph_creator.GraphFunction
ARG_ERROR
 
Fields inherited from interface org.h2gis.h2spatialapi.ScalarFunction
PROP_DETERMINISTIC, PROP_NOBUFFER
 
Fields inherited from interface org.h2gis.h2spatialapi.Function
PROP_NAME, PROP_REMARKS
 
Constructor Summary
ST_ShortestPathLength()
          Constructor
 
Method Summary
 String getJavaStaticMethod()
           
static ResultSet getShortestPathLength(Connection connection, String inputTable, String orientation, String weight, org.h2.value.Value arg4, org.h2.value.Value arg5)
          Calculate distances for One-to-One weighted: (arg4, arg5) = (w, d) , One-to-Several weighted: (arg4, arg5) = (w, ds).
static ResultSet getShortestPathLength(Connection connection, String inputTable, String orientation, org.h2.value.Value arg3)
          Calculate distances for One-to-All: arg3 = s, Many-to-Many: arg3 = sdt.
static ResultSet getShortestPathLength(Connection connection, String inputTable, String orientation, org.h2.value.Value arg3, org.h2.value.Value arg4)
          Calculate distances for One-to-One: (arg3, arg4) = (s, d), One-to-Several: (arg3, arg4) = (s, ds), One-to-All weighted: (arg3, arg4) = (w, s), Many-to-Many unweighted: (arg3, arg4) = (st, dt).
 
Methods inherited from class org.h2gis.network.graph_creator.GraphFunction
logTime, prepareGraph
 
Methods inherited from class org.h2gis.h2spatialapi.AbstractFunction
addProperty, getProperty, removeProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.h2gis.h2spatialapi.Function
getProperty
 

Field Detail

SOURCE_INDEX

public static final int SOURCE_INDEX
See Also:
Constant Field Values

DESTINATION_INDEX

public static final int DESTINATION_INDEX
See Also:
Constant Field Values

DISTANCE_INDEX

public static final int DISTANCE_INDEX
See Also:
Constant Field Values

REMARKS

public static final String REMARKS
See Also:
Constant Field Values
Constructor Detail

ST_ShortestPathLength

public ST_ShortestPathLength()
Constructor

Method Detail

getJavaStaticMethod

public String getJavaStaticMethod()
Specified by:
getJavaStaticMethod in interface ScalarFunction

getShortestPathLength

public static ResultSet getShortestPathLength(Connection connection,
                                              String inputTable,
                                              String orientation,
                                              org.h2.value.Value arg3)
                                       throws SQLException
Calculate distances for
  1. One-to-All: arg3 = s,
  2. Many-to-Many: arg3 = sdt.

The Source-Destination table must contain a column named SOURCE and a column named DESTINATION, both consisting of integer IDs.

Parameters:
connection - Connection
inputTable - Edges table produced by ST_Graph
orientation - Orientation string
arg3 - Source vertex id -OR- Source-Destination table
Returns:
Distances table
Throws:
SQLException

getShortestPathLength

public static ResultSet getShortestPathLength(Connection connection,
                                              String inputTable,
                                              String orientation,
                                              org.h2.value.Value arg3,
                                              org.h2.value.Value arg4)
                                       throws SQLException
Calculate distances for
  1. One-to-One: (arg3, arg4) = (s, d),
  2. One-to-Several: (arg3, arg4) = (s, ds),
  3. One-to-All weighted: (arg3, arg4) = (w, s),
  4. Many-to-Many unweighted: (arg3, arg4) = (st, dt).
  5. Many-to-Many weighted: (arg3, arg4) = (w, sdt).

The Source-Destination table must contain a column named SOURCE and a column named DESTINATION, both consisting of integer IDs.

Parameters:
connection - connection
inputTable - Edges table produced by ST_Graph
orientation - Orientation string
arg3 - Source vertex id -OR- Weight column name -OR- Source table
arg4 - Destination vertex id -OR- Destination string -OR- Source vertex id -OR- Source-Destination table -OR- Destination table
Returns:
Distances table
Throws:
SQLException

getShortestPathLength

public static ResultSet getShortestPathLength(Connection connection,
                                              String inputTable,
                                              String orientation,
                                              String weight,
                                              org.h2.value.Value arg4,
                                              org.h2.value.Value arg5)
                                       throws SQLException
Calculate distances for
  1. One-to-One weighted: (arg4, arg5) = (w, d) ,
  2. One-to-Several weighted: (arg4, arg5) = (w, ds).
  3. Many-to-Many weighted: (arg4, arg5) = (st, dt).

Parameters:
connection - Connection
inputTable - Edges table produced by ST_Graph
orientation - Orientation string
weight - Weight column name, null for unweighted graphs
arg4 - Source vertex id -OR- Source table
arg5 - Destination vertex id -OR- Destination string -OR- Destination table
Returns:
Distances table
Throws:
SQLException


Copyright © 2015 IRSTV CNRS-FR-2488. All Rights Reserved.