| Modifier and Type | Class and Description |
|---|---|
class |
GTFSFeed.FirstAndLastStopsDoNotHaveTimes
Thrown when we cannot interpolate stop times because the first or last stops do not have times
|
| Modifier and Type | Field and Description |
|---|---|
Map<String,Agency> |
agency |
long |
checksum
CRC32 of the GTFS file this was loaded from
|
NavigableSet<GTFSError> |
errors |
com.google.common.eventbus.EventBus |
eventBus |
Map<String,Fare> |
fares |
String |
feedId |
Map<String,FeedInfo> |
feedInfo |
NavigableSet<org.mapdb.Fun.Tuple2<String,Frequency>> |
frequencies |
Map<String,Pattern> |
patterns |
Map<String,Route> |
routes |
org.mapdb.BTreeMap<String,Service> |
services |
ConcurrentNavigableMap<org.mapdb.Fun.Tuple2<String,Integer>,ShapePoint> |
shape_points |
org.mapdb.BTreeMap<org.mapdb.Fun.Tuple2,StopTime> |
stop_times |
Map<String,Stop> |
stops |
Map<String,Transfer> |
transfers |
Set<String> |
transitIds |
Map<String,String> |
tripPatternMap |
org.mapdb.BTreeMap<String,Trip> |
trips |
| Constructor and Description |
|---|
GTFSFeed()
Create a GTFS feed in a temp file
|
GTFSFeed(String dbFile)
Create a GTFS feed connected to a particular DB, which will be created if it does not exist.
|
| Modifier and Type | Method and Description |
|---|---|
GTFSFeed |
clone()
Cloning can be useful when you want to make only a few modifications to an existing feed.
|
void |
close() |
protected void |
finalize() |
void |
findPatterns()
MapDB-based implementation to find patterns.
|
static GTFSFeed |
fromFile(String file)
Static factory method returning a new instance of GTFSFeed containing the contents of
the GTFS file at the supplied filesystem path.
|
static GTFSFeed |
fromFile(String file,
String feedId)
Static factory method returning a new instance of GTFSFeed containing the contents of
the GTFS file at the supplied filesystem path.
|
com.vividsolutions.jts.geom.Polygon |
getConvexHull() |
FeedInfo |
getFeedInfo() |
Collection<Frequency> |
getFrequencies(String trip_id) |
Iterable<StopTime> |
getInterpolatedStopTimesForTrip(String trip_id)
For the given trip ID, fetch all the stop times in order, and interpolate stop-to-stop travel times.
|
List<String> |
getOrderedStopListForTrip(String trip_id) |
Iterable<StopTime> |
getOrderedStopTimesForTrip(String trip_id)
For the given trip ID, fetch all the stop times in order of increasing stop_sequence.
|
Shape |
getShape(String shape_id)
Get the shape for the given shape ID
|
com.vividsolutions.jts.index.strtree.STRtree |
getSpatialIndex()
TODO rename getStopSpatialIndex to make it clear what the index contains.
|
com.vividsolutions.jts.geom.LineString |
getStraightLineForStops(String trip_id) |
double |
getTripDistance(String trip_id,
boolean straightLine)
Get the length of a trip in meters.
|
com.vividsolutions.jts.geom.LineString |
getTripGeometry(String trip_id)
Returns a trip geometry object (LineString) for a given trip id.
|
double |
getTripSpeed(String trip_id)
Get trip speed (using trip shape if available) in meters per second.
|
double |
getTripSpeed(String trip_id,
boolean straightLine)
Get trip speed in meters per second.
|
boolean |
hasFeedInfo() |
void |
loadFromFile(ZipFile zip) |
void |
loadFromFile(ZipFile zip,
String fid)
The order in which we load the tables is important for two reasons.
|
void |
toFile(String file) |
FeedLoadResult |
toSQL(DataSource dataSource) |
void |
validate() |
void |
validate(boolean repair,
Validator... validators) |
public String feedId
public final NavigableSet<org.mapdb.Fun.Tuple2<String,Frequency>> frequencies
public long checksum
public final ConcurrentNavigableMap<org.mapdb.Fun.Tuple2<String,Integer>,ShapePoint> shape_points
public final org.mapdb.BTreeMap<org.mapdb.Fun.Tuple2,StopTime> stop_times
public final NavigableSet<GTFSError> errors
public transient com.google.common.eventbus.EventBus eventBus
public GTFSFeed()
public GTFSFeed(String dbFile) throws IOException, ExecutionException
IOExceptionExecutionExceptionpublic void loadFromFile(ZipFile zip, String fid) throws Exception
Exceptionpublic FeedLoadResult toSQL(DataSource dataSource)
public void toFile(String file)
public void validate(boolean repair,
Validator... validators)
public void validate()
public static GTFSFeed fromFile(String file)
public static GTFSFeed fromFile(String file, String feedId)
public boolean hasFeedInfo()
public FeedInfo getFeedInfo()
public Iterable<StopTime> getOrderedStopTimesForTrip(String trip_id)
public com.vividsolutions.jts.index.strtree.STRtree getSpatialIndex()
public void findPatterns()
public Iterable<StopTime> getInterpolatedStopTimesForTrip(String trip_id) throws GTFSFeed.FirstAndLastStopsDoNotHaveTimes
public Collection<Frequency> getFrequencies(String trip_id)
public com.vividsolutions.jts.geom.LineString getStraightLineForStops(String trip_id)
public com.vividsolutions.jts.geom.LineString getTripGeometry(String trip_id)
trip_id - trip id of desired trip geometryLineStringpublic double getTripDistance(String trip_id, boolean straightLine)
public double getTripSpeed(String trip_id)
public double getTripSpeed(String trip_id, boolean straightLine)
public com.vividsolutions.jts.geom.Polygon getConvexHull()
public GTFSFeed clone()
protected void finalize()
throws IOException
finalize in class ObjectIOExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2019. All rights reserved.