de.cm.osm2po.sd.routing
Class SdSection

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

public class SdSection
extends java.lang.Object

Combines static and dynamic Edge data, such as modified geometries.

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

Constructor Summary
SdSection(int edgeIdx, SdEdge edge, long[] coords)
          Constructs a wrapper for an SdEdge with additional attributes like its corresponing position inside the SdGraph's adjacency list including the underlying edge itself and the geometry.
 
Method Summary
 void copyMembersFrom(SdSection sds)
           
 long[] getCoords()
           
 SdEdge getEdge()
           
 int getEdgeIdx()
           
 double getRatio()
           
static SdSection load(java.io.DataInput din)
          Reconstructs a Section from a serialized stream.
protected  SdSection reverseCoords()
           
 boolean save(java.io.DataOutput dout)
          Serializes this section to an output stream.
 SdSection setAndApplyRatio(double ratio)
          Sets a new Ratio and adjusts the underlying edge's members for speed and length.
protected  SdSection setEdgeIdx(int edgeIdx)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SdSection

public SdSection(int edgeIdx,
                 SdEdge edge,
                 long[] coords)
Constructs a wrapper for an SdEdge with additional attributes like its corresponing position inside the SdGraph's adjacency list including the underlying edge itself and the geometry. The internal ratio will be set to 1, assuming this SdSection represts an entire edge.

Parameters:
edgeIdx - index of edge in adjacency list of SdGraph
edge - SdEdge the corresponding Edge itself
coords - Array of long (nano-coded) geometry of edge
Method Detail

getEdgeIdx

public int getEdgeIdx()

getEdge

public SdEdge getEdge()

getCoords

public long[] getCoords()

getRatio

public double getRatio()

setAndApplyRatio

public SdSection setAndApplyRatio(double ratio)
Sets a new Ratio and adjusts the underlying edge's members for speed and length.

Parameters:
ratio - double the new ratio to set
Returns:
this 4Chainig

copyMembersFrom

public void copyMembersFrom(SdSection sds)

setEdgeIdx

protected SdSection setEdgeIdx(int edgeIdx)

reverseCoords

protected SdSection reverseCoords()

save

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

Parameters:
dout - DataOutput
Returns:
boolean success

load

public static SdSection load(java.io.DataInput din)
Reconstructs a Section from a serialized stream.

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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