public class GraphIndex extends Object
Modifier and Type | Class and Description |
---|---|
static class |
GraphIndex.StopAndDistance |
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.
|
Agency |
getAgencyWithoutFeedId(String agencyId)
Fetch an agency by its string ID, ignoring the fact that this ID should be scoped by a feedId.
|
Set<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(Stop stop,
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<Route> |
routesForStop(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(ServiceDate date)
An OBA Service Date is a local date without timezone, only year month and day.
|
Collection<StopTimesInPattern> |
stopTimesForStop(Stop stop,
boolean omitNonPickups)
Fetch upcoming vehicle departures from a stop.
|
List<StopTimesInPattern> |
stopTimesForStop(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<FeedScopedId,Stop> stopForId
public final Map<FeedScopedId,Trip> tripForId
public final Map<FeedScopedId,Route> routeForId
public final Map<FeedScopedId,String> serviceForId
public final Map<String,TripPattern> patternForId
public final Map<Stop,TransitStop> stopVertexForStop
public final Map<Trip,TripPattern> patternForTrip
public final com.google.common.collect.Multimap<String,TripPattern> patternsForFeedId
public final com.google.common.collect.Multimap<Route,TripPattern> patternsForRoute
public final com.google.common.collect.Multimap<Stop,TripPattern> patternsForStop
public final com.google.common.collect.Multimap<String,Stop> stopsForParentStation
public final Map<Stop,StopCluster> stopClusterForStop
public final Map<String,StopCluster> stopClusterForId
public final Map<FeedScopedId,org.locationtech.jts.geom.Geometry> flexAreasById
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(ServiceDate date)
public BitSet servicesRunning(org.joda.time.LocalDate date)
public Set<Route> routesForStop(Stop stop)
public Collection<StopTimesInPattern> stopTimesForStop(Stop stop, boolean omitNonPickups)
public List<StopTimesInPattern> stopTimesForStop(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(Stop stop, 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 Agency getAgencyWithoutFeedId(String agencyId)
Copyright © 2019. All rights reserved.