de.cm.osm2po.sd.routing
Class SdPath

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

public class SdPath
extends java.lang.Object

This class holds the results after a successful route calculation.

Author:
(c) 2013/2014 - Carsten Moeller - info@osm2po

Constructor Summary
SdPath(double sourceIncomingRatio, int[] path, SdSection sourceSection, SdSection targetSection)
           
 
Method Summary
 SdPath enrichKms(SdGraph sdGraph)
          Iterates over the path and cumulates all lengths into an internal array.
 long[] fetchGeometry(SdGraph sdGraph, int idx)
           
 SdSection fetchSection(SdGraph sdGraph, int idx)
          Looks up SdEdge and its geometry but no name.
 java.lang.String fetchStreetname(SdGraph sdGraph, int idx)
           
 float[] getKms()
           
 int getNumberOfEdges()
           
 int[] getPath()
           
 double getSourceIncomingRatio()
           
 SdSection getSourceSection()
           
 SdSection getTargetSection()
           
static SdPath load(java.io.DataInput din)
          Reconstructs a Path from a serialized stream.
 boolean save(java.io.DataOutput dout)
          Serializes this path to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SdPath

public SdPath(double sourceIncomingRatio,
              int[] path,
              SdSection sourceSection,
              SdSection targetSection)
Method Detail

getPath

public int[] getPath()

getKms

public float[] getKms()

getSourceIncomingRatio

public double getSourceIncomingRatio()

getNumberOfEdges

public int getNumberOfEdges()

getSourceSection

public SdSection getSourceSection()

getTargetSection

public SdSection getTargetSection()

fetchGeometry

public long[] fetchGeometry(SdGraph sdGraph,
                            int idx)

fetchStreetname

public java.lang.String fetchStreetname(SdGraph sdGraph,
                                        int idx)

fetchSection

public SdSection fetchSection(SdGraph sdGraph,
                              int idx)
Looks up SdEdge and its geometry but no name.

Parameters:
sdGraph - SdGraph
idx - int Index of Edge
Returns:
SdSection

enrichKms

public SdPath enrichKms(SdGraph sdGraph)
Iterates over the path and cumulates all lengths into an internal array.

Parameters:
sdGraph - SdGraph
Returns:
this 4 chaining
See Also:
getKms()

save

public boolean save(java.io.DataOutput dout)
Serializes this path to an output stream.

Parameters:
dout - DataOutput
Returns:
boolean success

load

public static SdPath load(java.io.DataInput din)
Reconstructs a Path from a serialized stream.

Parameters:
din - DataInput
Returns:
SdPath or null if error.

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