de.cm.osm2po.sd.routing
Class SdTouchPoint

java.lang.Object
  extended by de.cm.osm2po.sd.routing.SdTouchPoint

public class SdTouchPoint
extends java.lang.Object

This class represents a geographic point on the graph. It can be both, a Vertex or an arbitray virtual point on edge.

Author:
(c) 2012 - Carsten Moeller - info@osm2po.de

Method Summary
static SdTouchPoint create(SdGraph sdGraph, double lat, double lon, int[] edgeIdxs, int edgeFlags)
          Finds the closest edge for a coordinate.
static SdTouchPoint create(SdGraph sdGraph, double lat, double lon, int edgeIdx, int pointIdx, boolean isPoint)
          Creates a TouchPoint from already known attributes.
static SdTouchPoint create(SdGraph sdGraph, float lat, float lon)
          Finds the closest point and creates an SdTouchPoint.
static SdTouchPoint create(SdGraph sdGraph, float lat, float lon, boolean carMode)
          Convenience method which calls create(SdGraph, float, float, int) with either SdEdge.FLAG_CAR or SdEdge.FLAG_BIKE|SdEdge.FLAG_FOOT
static SdTouchPoint create(SdGraph sdGraph, float lat, float lon, int edgeFlags)
          Finds the closest point and creates an SdTouchPoint.
static SdTouchPoint create(SdGraph sdGraph, java.lang.String key)
          Reconstructs a TouchPoint from a String created by getKey().
 SdSection[] createIncomingSections(SdGraph sdGraph)
          Returns the outgoing edges of a TouchPoint.
 SdSection[] createOutgoingSections(SdGraph sdGraph)
          Returns the outgoing edges of a TouchPoint.
 boolean equals(java.lang.Object obj)
           
 int getEdgeIdx()
           
 int getEdgePointIdx()
           
 long[] getGeometryIn()
           
 long[] getGeometryOut()
           
 java.lang.String getKey()
          Returns a unique key for a TouchPoint.
 double getLat()
           
 double getLon()
           
 double getRatio()
           
 boolean isPoint()
           
static SdTouchPoint load(java.io.DataInput dis)
          Reconstructs a TouchPoint from a Stream created by save(DataOutput).
 boolean save(java.io.DataOutput dos)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getEdgeIdx

public int getEdgeIdx()

getEdgePointIdx

public int getEdgePointIdx()

isPoint

public boolean isPoint()

getLat

public double getLat()

getLon

public double getLon()

getRatio

public double getRatio()

getGeometryIn

public long[] getGeometryIn()

getGeometryOut

public long[] getGeometryOut()

create

public static SdTouchPoint create(SdGraph sdGraph,
                                  float lat,
                                  float lon,
                                  boolean carMode)
Convenience method which calls create(SdGraph, float, float, int) with either SdEdge.FLAG_CAR or SdEdge.FLAG_BIKE|SdEdge.FLAG_FOOT

Parameters:
sdGraph - SdGraph
lat - float Latitude
lon - float Longitude
carMode - true: optimize for carMode, foot/bike otherwise
Returns:
SdTouchPoint or null if not found

create

public static SdTouchPoint create(SdGraph sdGraph,
                                  float lat,
                                  float lon)
Finds the closest point and creates an SdTouchPoint. Calls create(SdGraph, float, float, int) with SdEdge.FLAG_NULL as last parameter.

Parameters:
sdGraph - SdGraph
lat - float Latitude
lon - float Longitude
Returns:
SdTouchPoint or null if not found

create

public static SdTouchPoint create(SdGraph sdGraph,
                                  float lat,
                                  float lon,
                                  int edgeFlags)
Finds the closest point and creates an SdTouchPoint. Calls SdGraph.findCloseEdgeIdxs(float, float) internally.

Parameters:
sdGraph - SdGraph
lat - float Latitude
lon - float Longitude
edgeFlags - int mask for allowed way-types or SdEdge.FLAG_NULL
Returns:
new SdTouchPoint, if found or null.

create

public static SdTouchPoint create(SdGraph sdGraph,
                                  double lat,
                                  double lon,
                                  int edgeIdx,
                                  int pointIdx,
                                  boolean isPoint)
Creates a TouchPoint from already known attributes.

Parameters:
sdGraph - SdGraph
lat - double Latitude
lon - double Longitude
edgeIdx - int Index of Edge (only forward edges accepted)
pointIdx - int Index of geometry-point of edge
isPoint - boolean true: coordinate is given by point
Returns:
SdTouchPoint or null if error.

load

public static SdTouchPoint load(java.io.DataInput dis)
Reconstructs a TouchPoint from a Stream created by save(DataOutput).

Parameters:
dis - DataInput Serialized Touchpoint
Returns:
SdTouchPoint or null if error

create

public static SdTouchPoint create(SdGraph sdGraph,
                                  java.lang.String key)
Reconstructs a TouchPoint from a String created by getKey(). Calls create(SdGraph, double, double, int, int, boolean).

Parameters:
sdGraph - SdGraph
key - String Unique key.
Returns:
SdTouchPoint or null.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getKey

public java.lang.String getKey()
Returns a unique key for a TouchPoint.

Returns:
String key
See Also:
create(SdGraph, String)

save

public boolean save(java.io.DataOutput dos)

create

public static SdTouchPoint create(SdGraph sdGraph,
                                  double lat,
                                  double lon,
                                  int[] edgeIdxs,
                                  int edgeFlags)
Finds the closest edge for a coordinate.

Parameters:
sdGraph - SdGraph
lat - double Latitude
lon - double Longitude
edgeIdxs - int[] EdgeIdx-Array, Set of edges to be analyzed.
edgeFlags - int mask for allowed way-types or SdEdge.FLAG_NULL
Returns:
SdTouchPoint, null if not found.

createOutgoingSections

public SdSection[] createOutgoingSections(SdGraph sdGraph)
Returns the outgoing edges of a TouchPoint.

Parameters:
sdGraph - SdGraph
Returns:
Array of SdSection

createIncomingSections

public SdSection[] createIncomingSections(SdGraph sdGraph)
Returns the outgoing edges of a TouchPoint.

Parameters:
sdGraph - SdGraph
Returns:
Array of SdSection

osm2po-sd-5.0.0 (c) December 24 2014 Carsten Moeller - info@osm2po.de