org.h2gis.network.graph_creator
Class ST_ShortestPath

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_ShortestPath
All Implemented Interfaces:
Function, ScalarFunction

public class ST_ShortestPath
extends GraphFunction
implements ScalarFunction

Calculates the 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 String NO_GEOM_FIELD_ERROR
           
static String REMARKS
           
 
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_ShortestPath()
          Constructor
 
Method Summary
protected static Map<Integer,com.vividsolutions.jts.geom.Geometry> getEdgeGeometryMap(Connection connection, TableLocation tableName, String firstGeometryField)
          Return a map of edge ids to edge geometries, or null if the input table contains no geometry fields.
protected static String getFirstGeometryField(Connection connection, TableLocation tableName)
          Return the first geometry field of tableName or null if it contains none.
 String getJavaStaticMethod()
           
static ResultSet getShortestPath(Connection connection, String inputTable, String orientation, int source, int destination)
           
static ResultSet getShortestPath(Connection connection, String inputTable, String orientation, String weight, int source, int destination)
           
 
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

NO_GEOM_FIELD_ERROR

public static final String NO_GEOM_FIELD_ERROR
See Also:
Constant Field Values

REMARKS

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

ST_ShortestPath

public ST_ShortestPath()
Constructor

Method Detail

getJavaStaticMethod

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

getShortestPath

public static ResultSet getShortestPath(Connection connection,
                                        String inputTable,
                                        String orientation,
                                        int source,
                                        int destination)
                                 throws SQLException
Parameters:
connection - connection
inputTable - Edges table produced by ST_Graph
orientation - Orientation string
source - Source vertex id
destination - Destination vertex id
Returns:
Shortest path
Throws:
SQLException

getShortestPath

public static ResultSet getShortestPath(Connection connection,
                                        String inputTable,
                                        String orientation,
                                        String weight,
                                        int source,
                                        int destination)
                                 throws SQLException
Parameters:
connection - connection
inputTable - Edges table produced by ST_Graph
orientation - Orientation string
weight - Weight
source - Source vertex id
destination - Destination vertex id
Returns:
Shortest path
Throws:
SQLException

getFirstGeometryField

protected static String getFirstGeometryField(Connection connection,
                                              TableLocation tableName)
                                       throws SQLException
Return the first geometry field of tableName or null if it contains none.

Parameters:
connection - Connection
tableName - TableLocation
Returns:
The first geometry field of tableName or null if it contains none
Throws:
SQLException

getEdgeGeometryMap

protected static Map<Integer,com.vividsolutions.jts.geom.Geometry> getEdgeGeometryMap(Connection connection,
                                                                                      TableLocation tableName,
                                                                                      String firstGeometryField)
                                                                               throws SQLException
Return a map of edge ids to edge geometries, or null if the input table contains no geometry fields.

Parameters:
connection - Connection
tableName - TableLocation
Returns:
A map of edge ids to edge geometries, or null if the input table contains no geometry fields
Throws:
SQLException


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