public class GraphIndex extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GraphIndex.StopAndDistance |
Modifier and Type | Field and Description |
---|---|
Map<String,Map<String,org.onebusaway.gtfs.model.Agency>> |
agenciesForFeedId |
Map<String,org.onebusaway.gtfs.model.FeedInfo> |
feedInfoForId |
Graph |
graph |
graphql.GraphQL |
graphQL |
LuceneIndex |
luceneIndex |
static int |
MAX_WALK_METERS
maximum distance to walk after leaving transit in Analyst
|
int |
overnightBreak
Used for finding first/last trip of the day.
|
Map<String,TripPattern> |
patternForId |
Map<org.onebusaway.gtfs.model.Trip,TripPattern> |
patternForTrip |
com.google.common.collect.Multimap<String,TripPattern> |
patternsForFeedId |
com.google.common.collect.Multimap<org.onebusaway.gtfs.model.Route,TripPattern> |
patternsForRoute |
com.google.common.collect.Multimap<org.onebusaway.gtfs.model.Stop,TripPattern> |
patternsForStop |
Map<org.onebusaway.gtfs.model.AgencyAndId,org.onebusaway.gtfs.model.Route> |
routeForId |
Map<org.onebusaway.gtfs.model.AgencyAndId,String> |
serviceForId |
Map<String,StopCluster> |
stopClusterForId |
Map<org.onebusaway.gtfs.model.Stop,StopCluster> |
stopClusterForStop |
Map<org.onebusaway.gtfs.model.AgencyAndId,org.onebusaway.gtfs.model.Stop> |
stopForId |
com.google.common.collect.Multimap<String,org.onebusaway.gtfs.model.Stop> |
stopsForParentStation |
Map<org.onebusaway.gtfs.model.Stop,TransitStop> |
stopVertexForStop |
com.google.common.collect.Multimap<StopCluster,ProfileTransfer> |
transfersFromStopCluster |
Map<org.onebusaway.gtfs.model.AgencyAndId,org.onebusaway.gtfs.model.Trip> |
tripForId |
Map<String,Vertex> |
vertexForId |
Constructor and Description |
---|
GraphIndex(Graph graph) |
Modifier and Type | Method and Description |
---|---|
void |
clusterStopsAsNeeded()
Stop clustering is slow to perform and only used in profile routing for the moment.
|
Timetable |
currentUpdatedTimetableForTripPattern(TripPattern tripPattern)
Get the most up-to-date timetable for the given TripPattern, as of right now.
|
List<GraphIndex.StopAndDistance> |
findClosestStopsByWalking(double lat,
double lon,
int radius) |
Map<StopCluster,Double> |
findNearbyStopClusters(StopCluster sc,
double radius)
Find transfer candidates for profile routing.
|
org.onebusaway.gtfs.model.Agency |
getAgencyWithoutFeedId(String agencyId)
Fetch an agency by its string ID, ignoring the fact that this ID should be scoped by a feedId.
|
Set<org.onebusaway.gtfs.model.Agency> |
getAllAgencies()
Construct a set of all Agencies in this graph, spanning across all feed IDs.
|
javax.ws.rs.core.Response |
getGraphQLResponse(String query,
Map<String,Object> variables,
String operationName) |
List<StopTimesInPattern> |
getStopTimesForStop(org.onebusaway.gtfs.model.Stop stop,
org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate,
boolean omitNonPickups)
Get a list of all trips that pass through a stop during a single ServiceDate.
|
StopTreeCache |
getStopTreeCache()
Fetch a cache of nearby intersection distances for every transit stop in this graph, lazy-building as needed.
|
void |
initializeProfileTransfers()
Initialize transfer data needed for profile routing.
|
Set<org.onebusaway.gtfs.model.Route> |
routesForStop(org.onebusaway.gtfs.model.Stop stop)
Dynamically generate the set of Routes passing though a Stop on demand.
|
BitSet |
servicesRunning(org.joda.time.LocalDate date)
Wraps the other servicesRunning whose parameter is an OBA ServiceDate.
|
BitSet |
servicesRunning(org.onebusaway.gtfs.model.calendar.ServiceDate date)
An OBA Service Date is a local date without timezone, only year month and day.
|
Collection<StopTimesInPattern> |
stopTimesForStop(org.onebusaway.gtfs.model.Stop stop,
boolean omitNonPickups)
Fetch upcoming vehicle departures from a stop.
|
List<StopTimesInPattern> |
stopTimesForStop(org.onebusaway.gtfs.model.Stop stop,
long startTime,
int timeRange,
int numberOfDepartures,
boolean omitNonPickups)
Fetch upcoming vehicle departures from a stop.
|
public static final int MAX_WALK_METERS
public final Map<String,Map<String,org.onebusaway.gtfs.model.Agency>> agenciesForFeedId
public final Map<org.onebusaway.gtfs.model.AgencyAndId,org.onebusaway.gtfs.model.Stop> stopForId
public final Map<org.onebusaway.gtfs.model.AgencyAndId,org.onebusaway.gtfs.model.Trip> tripForId
public final Map<org.onebusaway.gtfs.model.AgencyAndId,org.onebusaway.gtfs.model.Route> routeForId
public final Map<String,TripPattern> patternForId
public final Map<org.onebusaway.gtfs.model.Stop,TransitStop> stopVertexForStop
public final Map<org.onebusaway.gtfs.model.Trip,TripPattern> patternForTrip
public final com.google.common.collect.Multimap<String,TripPattern> patternsForFeedId
public final com.google.common.collect.Multimap<org.onebusaway.gtfs.model.Route,TripPattern> patternsForRoute
public final com.google.common.collect.Multimap<org.onebusaway.gtfs.model.Stop,TripPattern> patternsForStop
public final com.google.common.collect.Multimap<String,org.onebusaway.gtfs.model.Stop> stopsForParentStation
public final Map<org.onebusaway.gtfs.model.Stop,StopCluster> stopClusterForStop
public final Map<String,StopCluster> stopClusterForId
public LuceneIndex luceneIndex
public com.google.common.collect.Multimap<StopCluster,ProfileTransfer> transfersFromStopCluster
public Graph graph
public final int overnightBreak
public graphql.GraphQL graphQL
public GraphIndex(Graph graph)
public void clusterStopsAsNeeded()
public void initializeProfileTransfers()
public Map<StopCluster,Double> findNearbyStopClusters(StopCluster sc, double radius)
public List<GraphIndex.StopAndDistance> findClosestStopsByWalking(double lat, double lon, int radius)
public BitSet servicesRunning(org.onebusaway.gtfs.model.calendar.ServiceDate date)
public BitSet servicesRunning(org.joda.time.LocalDate date)
public Set<org.onebusaway.gtfs.model.Route> routesForStop(org.onebusaway.gtfs.model.Stop stop)
public Collection<StopTimesInPattern> stopTimesForStop(org.onebusaway.gtfs.model.Stop stop, boolean omitNonPickups)
public List<StopTimesInPattern> stopTimesForStop(org.onebusaway.gtfs.model.Stop stop, long startTime, int timeRange, int numberOfDepartures, boolean omitNonPickups)
stop
- Stop object to perform the search forstartTime
- Start time for the search. Seconds from UNIX epochtimeRange
- Searches forward for timeRange seconds from startTimenumberOfDepartures
- Number of departures to fetch per patternomitNonPickups
- If true, do not include vehicles that will not pick up passengers.public List<StopTimesInPattern> getStopTimesForStop(org.onebusaway.gtfs.model.Stop stop, org.onebusaway.gtfs.model.calendar.ServiceDate serviceDate, boolean omitNonPickups)
stop
- Stop object to perform the search forserviceDate
- Return all departures for the specified datepublic StopTreeCache getStopTreeCache()
public Timetable currentUpdatedTimetableForTripPattern(TripPattern tripPattern)
public javax.ws.rs.core.Response getGraphQLResponse(String query, Map<String,Object> variables, String operationName)
public org.onebusaway.gtfs.model.Agency getAgencyWithoutFeedId(String agencyId)
public Set<org.onebusaway.gtfs.model.Agency> getAllAgencies()
Copyright © 2018. All rights reserved.