public class Graph extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
Map<TraverseMode,Integer> |
alightTimes
Has information how much time alighting a vehicle takes.
|
Map<TraverseMode,Integer> |
boardTimes
Has information how much time boarding a vehicle takes.
|
String |
builderConfig
The config JSON used to build this graph.
|
Date |
buildTime |
org.joda.time.DateTime |
buildTimeJoda |
Deduplicator |
deduplicator |
Double |
ellipsoidToGeoidDifference
The difference in meters between the WGS84 ellipsoid height and geoid height at the graph's center
|
Map<FeedScopedId,org.locationtech.jts.geom.Geometry> |
flexAreasById
Areas for flex service
|
FlexIndex |
flexIndex |
boolean |
hasBikeRide |
boolean |
hasBikeSharing |
boolean |
hasDirectTransfers
True if direct single-edge transfers were generated between transit stops in this Graph.
|
boolean |
hasFrequencyService
True if frequency-based services exist in this Graph (GTFS frequencies with exact_times = 0).
|
boolean |
hasParkRide |
boolean |
hasScheduledService
True if schedule-based services exist in this Graph (including GTFS frequencies with exact_times = 1).
|
boolean |
hasStreets
True if OSM data was loaded into this Graph.
|
boolean |
hasTransit
True if GTFS data was loaded into this Graph.
|
GraphIndex |
index |
Map<FeedScopedId,Stop> |
parentStopById
Parent stops
|
Preferences |
preferences |
String |
routerConfig
Embed a router configuration inside the graph, for starting up with a single file.
|
String |
routerId |
Map<FeedScopedId,Integer> |
serviceCodes
Map from GTFS ServiceIds to integers close to 0.
|
StopClusterMode |
stopClusterMode
How should we cluster stops? By 'proximity' or 'ParentStation'
|
StreetVertexIndexService |
streetIndex |
StreetNotesService |
streetNotesService |
TimetableSnapshotSource |
timetableSnapshotSource |
GraphUpdaterManager |
updaterManager
Manages all updaters of this graph.
|
boolean |
useFlexService
Whether to use flex modes
|
Modifier and Type | Method and Description |
---|---|
void |
addAgency(String feedId,
Agency agency) |
void |
addAlertPatch(Edge edge,
AlertPatch alertPatch)
|
String |
addBuilderAnnotation(GraphBuilderAnnotation gba)
Add a graph builder annotation to this graph's list of graph builder annotations.
|
void |
addFeedInfo(FeedInfo info) |
void |
addFlexArea(String feedId,
String areaId,
org.locationtech.jts.geom.Polygon flexArea) |
void |
addTransitMode(TraverseMode mode)
Adds mode of transport to transit modes in graph
|
void |
addTurnRestriction(Edge edge,
TurnRestriction turnRestriction)
|
void |
addVertex(Vertex v)
Add the given vertex to the graph.
|
void |
calculateConvexHull()
Calculates convexHull of all the vertices during build time
|
void |
calculateEnvelope()
Calculates envelope out of all OSM coordinates
Transit stops are added to the envelope as they are added to the graph
|
void |
calculateTransitCenter()
Calculates Transit center from median of coordinates of all transitStops if graph
has transit.
|
void |
clearTimeZone()
The timezone is cached by the graph.
|
boolean |
containsVertex(Vertex v) |
int |
countEdges()
Find the total number of edges in this Graph.
|
int |
countVertices() |
void |
expandToInclude(double x,
double y)
Expands envelope to include given point
If envelope is empty it creates it (This can happen with a graph without OSM data)
Used when adding stops to OSM envelope
|
Collection<Agency> |
getAgencies(String feedId) |
AlertPatch[] |
getAlertPatches(Edge edge)
|
Collection<TimeZone> |
getAllTimeZones()
Return all TimeZones for all agencies in the graph
|
List<GraphBuilderAnnotation> |
getBuilderAnnotations() |
GraphBundle |
getBundle() |
CalendarService |
getCalendarService() |
Optional<org.locationtech.jts.geom.Coordinate> |
getCenter() |
org.locationtech.jts.geom.Geometry |
getConvexHull() |
Edge |
getEdgeById(int id)
Returns the edge with the given ID or null if none is present.
|
Collection<Edge> |
getEdges()
Return all the edges in the graph.
|
WorldEnvelope |
getEnvelope() |
org.locationtech.jts.geom.Envelope |
getExtent() |
Collection<String> |
getFeedIds() |
FeedInfo |
getFeedInfo(String feedId) |
GeometryIndex |
getGeomIndex() |
Integer |
getIdForEdge(Edge edge) |
SampleFactory |
getSampleFactory() |
<T> T |
getService(Class<T> serviceType) |
<T> T |
getService(Class<T> serviceType,
boolean autoCreate) |
Collection<StreetEdge> |
getStreetEdges()
Return only the StreetEdges in the graph.
|
TimeZone |
getTimeZone()
Returns the time zone for the first agency in this graph.
|
TransferTable |
getTransferTable() |
HashSet<TraverseMode> |
getTransitModes() |
long |
getTransitServiceEnds() |
long |
getTransitServiceStarts() |
List<TurnRestriction> |
getTurnRestrictions(Edge edge)
|
Vertex |
getVertex(String label) |
Vertex |
getVertexById(int id)
Returns the vertex with the given ID or null if none is present.
|
Collection<Vertex> |
getVertices()
Get all the vertices in the graph.
|
boolean |
hasService(Class<?> serviceType) |
void |
index(StreetVertexIndexFactory indexFactory)
Perform indexing on vertices, edges, and timetables, and create transient data structures.
|
static Graph |
load(File file) |
static Graph |
load(InputStream in) |
static com.esotericsoftware.kryo.Kryo |
makeKryo()
This method allows reproducibly creating Kryo (de)serializer instances with exactly the same configuration.
|
<T> T |
putService(Class<T> serviceType,
T service) |
void |
rebuildVertexAndEdgeIndices()
Rebuilds any indices on the basis of current vertex and edge IDs.
|
void |
remove(Vertex vertex) |
void |
removeAlertPatch(Edge edge,
AlertPatch alertPatch)
|
void |
removeEdge(Edge e)
Removes an edge from the graph.
|
int |
removeEdgelessVertices() |
void |
removeTurnRestriction(Edge edge,
TurnRestriction turnRestriction)
|
void |
removeVertex(Vertex v)
Removes a vertex from the graph.
|
void |
removeVertexAndEdges(Vertex vertex) |
void |
save(File file) |
void |
save(OutputStream outputStream) |
void |
setBundle(GraphBundle bundle) |
void |
setUseFlexService(boolean useFlexService) |
void |
summarizeBuilderAnnotations() |
boolean |
transitFeedCovers(long t) |
void |
updateTransitFeedValidity(CalendarServiceData data) |
public String routerId
public final StreetNotesService streetNotesService
public transient StreetVertexIndexService streetIndex
public transient GraphIndex index
public transient FlexIndex flexIndex
public final transient Deduplicator deduplicator
public final Map<FeedScopedId,Integer> serviceCodes
public transient TimetableSnapshotSource timetableSnapshotSource
public String builderConfig
public String routerConfig
public Preferences preferences
public org.joda.time.DateTime buildTimeJoda
public boolean hasBikeSharing
public boolean hasParkRide
public boolean hasBikeRide
public transient GraphUpdaterManager updaterManager
GraphUpdaterConfigurator
public final Date buildTime
public boolean hasStreets
public boolean hasTransit
public boolean hasDirectTransfers
public boolean hasFrequencyService
public boolean hasScheduledService
public Map<TraverseMode,Integer> boardTimes
public Map<TraverseMode,Integer> alightTimes
public StopClusterMode stopClusterMode
public Double ellipsoidToGeoidDifference
public Map<FeedScopedId,Stop> parentStopById
public boolean useFlexService
public Map<FeedScopedId,org.locationtech.jts.geom.Geometry> flexAreasById
public Graph(Graph basedOn)
public Graph()
public void addVertex(Vertex v)
public void removeVertex(Vertex v)
v
- public void removeEdge(Edge e)
e
- The edge to be removedpublic Vertex getVertexById(int id)
id
- public Collection<Vertex> getVertices()
public Edge getEdgeById(int id)
id
- public Collection<Edge> getEdges()
public void addAlertPatch(Edge edge, AlertPatch alertPatch)
edge
- alertPatch
- public void removeAlertPatch(Edge edge, AlertPatch alertPatch)
edge
- alertPatch
- public AlertPatch[] getAlertPatches(Edge edge)
edge
- AlertPatch
array that belongs to the Edge
public void addTurnRestriction(Edge edge, TurnRestriction turnRestriction)
TurnRestriction
to the TurnRestriction
List
belonging to an
Edge
. This method is not thread-safe.edge
- turnRestriction
- public void removeTurnRestriction(Edge edge, TurnRestriction turnRestriction)
TurnRestriction
from the TurnRestriction
List
belonging to
an Edge
. This method is not thread-safe.edge
- turnRestriction
- public List<TurnRestriction> getTurnRestrictions(Edge edge)
TurnRestriction
List
that belongs to an Edge
and return an
immutable copy. This method is thread-safe when used by itself, but not if addTurnRestriction
or removeTurnRestriction is called concurrently.edge
- TurnRestriction
List
that belongs to the Edge
public Collection<StreetEdge> getStreetEdges()
public boolean containsVertex(Vertex v)
public <T> T putService(Class<T> serviceType, T service)
public boolean hasService(Class<?> serviceType)
public <T> T getService(Class<T> serviceType)
public <T> T getService(Class<T> serviceType, boolean autoCreate)
public void remove(Vertex vertex)
public void removeVertexAndEdges(Vertex vertex)
public org.locationtech.jts.geom.Envelope getExtent()
public TransferTable getTransferTable()
public void updateTransitFeedValidity(CalendarServiceData data)
public boolean transitFeedCovers(long t)
public GraphBundle getBundle()
public void setBundle(GraphBundle bundle)
public int countVertices()
public int countEdges()
public void rebuildVertexAndEdgeIndices()
public String addBuilderAnnotation(GraphBuilderAnnotation gba)
public List<GraphBuilderAnnotation> getBuilderAnnotations()
public void addTransitMode(TraverseMode mode)
mode
- public HashSet<TraverseMode> getTransitModes()
public static Graph load(File file) throws IOException
IOException
public void index(StreetVertexIndexFactory indexFactory)
public static Graph load(InputStream in)
public static com.esotericsoftware.kryo.Kryo makeKryo()
public void save(File file) throws IOException
IOException
public void save(OutputStream outputStream)
public CalendarService getCalendarService()
public int removeEdgelessVertices()
public Collection<String> getFeedIds()
public Collection<Agency> getAgencies(String feedId)
public void addFeedInfo(FeedInfo info)
public void addFlexArea(String feedId, String areaId, org.locationtech.jts.geom.Polygon flexArea)
public TimeZone getTimeZone()
public Collection<TimeZone> getAllTimeZones()
public void clearTimeZone()
public void summarizeBuilderAnnotations()
public void calculateEnvelope()
public void calculateConvexHull()
public org.locationtech.jts.geom.Geometry getConvexHull()
public void expandToInclude(double x, double y)
x
- the value to lower the minimum x to or to raise the maximum x toy
- the value to lower the minimum y to or to raise the maximum y topublic WorldEnvelope getEnvelope()
public GeometryIndex getGeomIndex()
public SampleFactory getSampleFactory()
public void calculateTransitCenter()
public Optional<org.locationtech.jts.geom.Coordinate> getCenter()
public long getTransitServiceStarts()
public long getTransitServiceEnds()
public void setUseFlexService(boolean useFlexService)
Copyright © 2019. All rights reserved.