|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cm.osm2po.routing.Graph
public class Graph
Graph / Topologie fuer das osm2po-Routing. Liest eine *.gph und stellt diese fuer ein beliebiges Routing zur Verfuegung.
Field Summary | |
---|---|
static int |
SUPPORT_BARRIERS
Barriers werden in die TurnRestrictions gemergt |
static int |
SUPPORT_EDGEFLAGS
Unterstuetzung von EdgeFlags. |
static int |
SUPPORT_EXTENSIONS
Extensions werden gecacht |
static int |
SUPPORT_LATLON
Untestuetzung von Koordinaten. z.B. fuer AStar oder Vertex-Lookups. |
static int |
SUPPORT_NOTHING
Keine Unterstuetzung zusaetzlicher Features. |
static int |
SUPPORT_RASTER_EDGE
Dynamische Einsortierung von Segmenten in ein Raster. |
static int |
SUPPORT_RASTER_VERTEX
Dynamische Einsortierung von Vertices in ein Raster. |
static int |
SUPPORT_REVERSE
Dynamische Anreicherung des Graphen um Reverse-Routing-Infos. |
static int |
SUPPORT_SEGMENTS
Es wird versucht alle Segmente in den Speicher zu laden. |
Constructor Summary | |
---|---|
Graph(java.io.File graphFile)
CTOR Ruft Graph(File, Log, int, boolean, byte...) mit
new Log(), . |
|
Graph(java.io.File graphFile,
Log log,
int supports,
boolean async,
byte... excludedExtensionClazzes)
CTOR. |
|
Graph(java.io.InputStream graphInputStream)
CTOR Verpackt den InputStream in einen
InStreamAdapter und ruft Graph(InStream) . |
|
Graph(de.cm.osm2po.primitives.InStream graphInStream)
CTOR Ruft Graph(InStream, Log, int, boolean, byte...) mit
new Log(), . |
|
Graph(de.cm.osm2po.primitives.InStream graphInStream,
Log log,
int supports,
boolean async,
byte... excludedExtensionClazzes)
CTOR. |
Method Summary | |
---|---|
double |
calcPathLength(int[] path)
Berechnet die Laenge eines Pfades. |
double |
calcPathTime(int[] path)
Berechnet die Fahrzeit eines Pfades. |
protected java.lang.Object |
clone()
|
void |
close()
Schliesst den Graphen und raeumt den Speicher frei. |
boolean |
containsWrongWays()
|
int[] |
createTransformedEdgeIndex()
Erzeugt ein Index-Array fuer eine umgekehrte Zugriffssicht, naemlich von einer bekannten EdgeId zum EdgeIdx innerhalb der Adjazenz-Liste. |
int[] |
findCloseEdges(float lat,
float lon,
int minCount)
Findet nahe Edges zu einer Koordinate im Umkreis. |
int |
findClosestVertexId(float lat,
float lon)
Findet den naechsten Vertex zu einer Koordinate im Umkreis von etwa 5 km. |
int[] |
findClosestVertexIds(float lat,
float lon,
int zoneRadius,
int n)
Findet die naechsten Vertices (IDs) zu einer Koordinate im Umkreis und liefert diese sortiert nach Distanz (kuerzeste vorne) zurueck. |
int[] |
findIncomingEdges(int targetId)
Findet alle ankommenden Edges zu einem Vertex. |
int[] |
findOutgoingEdges(int sourceId)
Findet alle wegfuehrenden Edges zu einem Vertex. |
int |
findReverseEdge(int edgeIdx)
Findet die gespiegelte Rueckwaers-Kante, wenn vorhanden. |
int[] |
findVerticesByClazz(byte clazz)
Findet die Indizes aller Vertices einer bestimmten Klasse. |
float[] |
getEdgeCostsH()
|
float[] |
getEdgeCostsKm()
|
int[] |
getEdgeEntries()
|
int[] |
getEdgeEntriesR()
|
int[] |
getEdgeFlags()
|
int[] |
getEdgeIds()
|
int[] |
getEdgeIdxsR()
|
byte[] |
getEdgeNoTurnBits()
|
byte[] |
getEdgeNoTurnBitsR()
|
de.cm.osm2po.primitives.IntIntBag |
getEdgeRasterBag()
|
int[] |
getEdgeSourceIds()
|
int[] |
getEdgeTargetIds()
|
byte[] |
getExtension(byte id,
byte clazz)
|
GraphHeader.ExtensionEntry |
getExtensionEntry(byte id,
byte clazz)
|
float[] |
getLats()
|
float[] |
getLons()
|
float |
getMaxLat()
|
float |
getMaxLon()
|
float |
getMinLat()
|
float |
getMinLon()
|
byte[] |
getVertexClazzes()
|
de.cm.osm2po.primitives.IntIntBag |
getVertexRasterBag()
|
static boolean |
isGraphFile(java.io.File file)
|
boolean |
isInitializing()
|
static boolean |
isOneWay(int edgeId)
Ermittelt aus der EdgeId, ob es sich um eine Einbahnstrasse handelt. |
static boolean |
isReverse(int edgeId)
Ermittelt aus der EdgeId, ob dies eine Rueckwaerts-Kante ist, es sich hier also um die Spiegelung des Original-Segments handelt. |
boolean |
isSupported(int SUPPORT)
Prueft ob der Graph ein oder mehrere Zusatzfeatures unterstuetzt. |
int |
isTurnRestricted(int fromEdgeIdx,
int toEdgeIdx)
Ermittelt, ob zwischen zwei Edges einer Kreuzung eine NoTurn-Restriktion vorhanden ist. |
static boolean |
isWrongWay(int edgeId)
Ermittelt aus der EdgeId, ob es sich um eine Einbahnstrasse in Gegenrichung handelt. |
de.cm.osm2po.model.LatLons |
lookupGeometry(int edgeIdx)
Liefert alle Koordinaten zu einer Edge. |
de.cm.osm2po.primitives.VarString |
lookupName(int edgeIdx)
Liefert den Strassennamen zu einer Edge. |
RoutingResultSegment |
lookupSegment(int edgeIdx)
Rekonstruiert alle Segmentinformationen aus einer Edge. |
boolean |
sync()
Wartet bis der Konstruktor den Graphen im asynchronen Modus geladen hat. |
static int |
toEdgeId(int segmentId,
boolean reverse)
Ermittelt aus einer SegmentId die EdgeId ohne Beruecksichtigung der Information OneWay (Bit 32). |
static int |
toSementId(int edgeId)
Ermittelt aus der EdgeId die SegmentId. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SUPPORT_NOTHING
public static final int SUPPORT_LATLON
public static final int SUPPORT_EDGEFLAGS
public static final int SUPPORT_SEGMENTS
public static final int SUPPORT_REVERSE
public static final int SUPPORT_RASTER_EDGE
public static final int SUPPORT_RASTER_VERTEX
public static final int SUPPORT_BARRIERS
public static final int SUPPORT_EXTENSIONS
Constructor Detail |
---|
public Graph(java.io.File graphFile)
Graph(File, Log, int, boolean, byte...)
mit
new Log(), SUPPORT_LATLON
, false
.
graphFile
- File
Graph-Datei.public Graph(de.cm.osm2po.primitives.InStream graphInStream)
Graph(InStream, Log, int, boolean, byte...)
mit
new Log(), SUPPORT_LATLON
, false
.
graphInStream
- InStream
public Graph(java.io.InputStream graphInputStream)
InputStream
in einen
InStreamAdapter
und ruft Graph(InStream)
.
graphInputStream
- InputStream
public Graph(de.cm.osm2po.primitives.InStream graphInStream, Log log, int supports, boolean async, byte... excludedExtensionClazzes)
graphInStream
- InStream
Graph-als Stream NOT NULL.
Wird intern bereits gepuffert, daher ist ein Vorschalten
eines BufferedInputStream
nicht notwendig.log
- Log
NULLABLE.supports
- int Flags. z.B SUPPORT_LATLON
.async
- true: Der Graph wird asynchron geladen.excludedExtensionClazzes
- Extensions dieser Klasse nicht laden.public Graph(java.io.File graphFile, Log log, int supports, boolean async, byte... excludedExtensionClazzes)
graphFile
- File
Graph-Datei NOT NULL.log
- Log
NULLABLE.supports
- int Flags. z.B SUPPORT_LATLON
.async
- true: Der Graph wird asynchron geladen.excludedExtensionClazzes
- Extensions dieser Klasse nicht laden.Method Detail |
---|
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean sync()
public boolean isSupported(int SUPPORT)
SUPPORT
- int-Flags, z.B 1
public boolean containsWrongWays()
public int[] getEdgeEntries()
public int[] getEdgeIds()
public int[] getEdgeSourceIds()
public int[] getEdgeTargetIds()
public float[] getEdgeCostsKm()
public float[] getEdgeCostsH()
public byte[] getEdgeNoTurnBits()
public int[] getEdgeFlags()
public int[] getEdgeIdxsR()
public int[] getEdgeEntriesR()
public byte[] getEdgeNoTurnBitsR()
public float[] getLats()
public float[] getLons()
public float getMinLat()
public float getMinLon()
public float getMaxLat()
public float getMaxLon()
public byte[] getVertexClazzes()
public GraphHeader.ExtensionEntry getExtensionEntry(byte id, byte clazz)
public byte[] getExtension(byte id, byte clazz)
public de.cm.osm2po.primitives.IntIntBag getEdgeRasterBag()
public de.cm.osm2po.primitives.IntIntBag getVertexRasterBag()
public static int toSementId(int edgeId)
edgeId
- int
public static int toEdgeId(int segmentId, boolean reverse)
segmentId
- intreverse
- boolean in Rueckwaertsrichung
public static boolean isWrongWay(int edgeId)
edgeId
- int
public static boolean isOneWay(int edgeId)
edgeId
- int
public static boolean isReverse(int edgeId)
edgeId
- int
public boolean isInitializing()
public void close()
public static boolean isGraphFile(java.io.File file)
public int findClosestVertexId(float lat, float lon)
findClosestVertexIds(float, float, int, int)
auf.
lat
- float Latitude (Breitengrad)lon
- float Longitude (Laengengrad)
public int[] findClosestVertexIds(float lat, float lon, int zoneRadius, int n)
lat
- float Latitude (Breitengrad)lon
- float Longitude (Laengengrad)zoneRadius
- int. Grober Suchradius. 1 entspricht 0.01 Grad.n
- Maximale Anzahl zurueckzuliefernder Vertices.
public int[] findOutgoingEdges(int sourceId)
sourceId
- int Id des SourceVertex.
public int[] findIncomingEdges(int targetId)
SUPPORT_REVERSE
, so
wird das Ergebnis mittels findOutgoingEdges(int)
und
findReverseEdge(int)
ermittelt. Um hier korrekte
Ergebnisse zu liefern, muss der Graph auch WrongWays beinhalten,
also Einbahnstrassen in Gegenrichtung.
targetId
- int Id des TargetVertex
public de.cm.osm2po.model.LatLons lookupGeometry(int edgeIdx)
edgeIdx
- Index der Edge in der Adjazenzliste.
LatLons
Koordinaten des korrespondierenden Segments.
public de.cm.osm2po.primitives.VarString lookupName(int edgeIdx)
edgeIdx
- Index der Edge in der Adjazenzliste.
public int findReverseEdge(int edgeIdx)
edgeIdx
- int Index-Position in der Adjazenzliste.
public int isTurnRestricted(int fromEdgeIdx, int toEdgeIdx)
fromEdgeIdx
- Index der hinfuehrenden Edge.toEdgeIdx
- Index der wegfuehrenden Edge.
public int[] createTransformedEdgeIndex()
public RoutingResultSegment lookupSegment(int edgeIdx)
edgeIdx
- Index (Position) der Edge im Graphen.
RoutingResultSegment
Segment oder null, wenn nicht ermittelbar
oder edgeIdx <= 0.public double calcPathLength(int[] path)
path
- int[]-Arrray von EdgedIdx.
public double calcPathTime(int[] path)
path
- int[]-Arrray von EdgedIdx.
public int[] findVerticesByClazz(byte clazz)
clazz
- byte Klasse.
public int[] findCloseEdges(float lat, float lon, int minCount)
lat
- float Latitude (Breitengrad)lon
- float Longitude (Laengengrad)minCount
- grobe minimale Anzahl zurueckgelieferter Edges.
|
osm2po-core-4.8.8 (c) 2012 Carsten Moeller - info@osm2po.de | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |