Skip to content

mitanand/GRFS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 

Repository files navigation

GRFS General Ridesharing Feed Specification - Mitanand

Connecting public transport and ridesharing based on GTFS.


🚐 Specification

agency.txt


File: Required

All Optional attributes as in GTFS agency.txt.

Primary key (agency_id)

Field Name Type Presence Description
agency_id Unique ID Required Identifies a transit brand which is often synonymous with a transit agency. Note that in some cases, such as when a single agency operates multiple separate services, agencies and brands are distinct. This document uses the term "agency" in place of "brand". A dataset may contain data from multiple agencies.
agency_name Text Required Full name of the transit agency.
agency_url URL Required URL of the transit agency.
agency_timezone Timezone Required Timezone where the transit agency is located. If multiple agencies are specified in the dataset, each must have the same agency_timezone.

Example: agency.txt

agency_id,agency_name,agency_url,agency_timezone 
example,"EXAMPLE AG","https://www.example.com",Europe/Berlin

routes.txt


File: Required

All Optional attributes as in GTFS routes.txt.

Primary key (route_id) - 1:n Beziehung zwischen route_id und trip_id - Abweichung von GTFS.

Field Name Type Presence Description
route_id Unique ID Required Identifies a route. Prefixed with agency_id and ":" if multiple agencies are defined in agency.txt, e.g. "goflux:1234"
agency_id Foreign ID referencing agency.agency_id Required Agency for the specified route.
route_short_name Text Required Short name of a route departure_{city} -> {arrival_city}, e.g. Berlin - Munich.
route_long_name Text Required Full name of a route. This name is generally more descriptive than the route_short_name and often includes the route's destination or stop, {departure_address} - {arrival_address}, e.g. Alexanderplatz 7, 10178 Berlin - Marienplatz 8, 80331 Munich
route_type Enum Required 1551

Example: routes.txt

route_id,agency_id,route_short_name,route_long_name, route_type
goflux:05558a29-7a0a-42fa-8162-501e3c7a024a_dfde43ae-7f38-4d6e-9951-bfd622e23c55,goflux,"Berlin - Munich","Alexanderplatz 7,10178 Berlin - Marienplatz 8, 80331 Munich",1551

trips.txt


File: Required

All Optional attributes as in GTFS trips.txt.

Primary key (trip_id) - 1:n Beziehung zwischen route_id und trip_id - Abweichung von GTFS.

Field Name Type Presence Description
route_id Foreign ID referencing routes.route_id Required Identifies a route.
service_id Foreign ID referencing calendar.service_id or calendar_dates.service_id Required Identifies a set of dates when service is available for one or more routes.
trip_id Unique ID Required Identifies a trip.
shape_id Foreign ID referencing shapes.shape_id Required Identifies a geospatial shape describing the vehicle travel path for a trip.
driver_id Foreign ID referencing drivers.driver_id Optional Identifies a driver.
trip_url URL Required URL of a web page about the particular trip. Should be different from the agency.agency_url value, e.g. https://fahrgemeinschaft.de/?trip=322337

Example: trips.txt

trip_id,shape_id,route_id,service_id,driver_id 
ae253a08-5f04-454e-8652-92f7ea550b45,shape:c70a33af-be48-41e8-b81b-777ee61bbf01_27bda21e-55e1-4173-994a-e663a8e6f2c2,c70a33af-be48-41e8-b81b-777ee61bbf01_27bda21e-55e1-4173-994a-e663a8e6f2c2,service:20231205,ab37f804-7fa0-49a0-b813-efbe8eb62e3d

stop_times.txt


File: Required

All Optional attributes as in GTFS stop_times.txt.

Primary key (trip_id, stop_sequence)

Field Name Type Presence Description
trip_id Foreign ID referencing trips.trip_id Required Identifies a trip.
arrival_time Time Conditionally Required Arrival time at the stop (defined by stop_times.stop_id) for a specific trip (defined by stop_times.trip_id) in the time zone specified by agency.agency_timezone, not stops.stop_timezone.

If there are not separate times for arrival and departure at a stop, arrival_time and departure_time should be the same.

For times occurring after midnight on the service day, enter the time as a value greater than 24:00:00 in HH:MM:SS.

If exact arrival and departure times (timepoint=1 or empty) are not available, estimated or interpolated arrival and departure times (timepoint=0) should be provided.

Conditionally Required:
- Required for the first and last stop in a trip (defined by stop_times.stop_sequence).
- Required for timepoint=1.
- Optional otherwise.
departure_time Time Conditionally Required Departure time from the stop (defined by stop_times.stop_id) for a specific trip (defined by stop_times.trip_id) in the time zone specified by agency.agency_timezone, not stops.stop_timezone.

If there are not separate times for arrival and departure at a stop, arrival_time and departure_time should be the same.

For times occurring after midnight on the service day, enter the time as a value greater than 24:00:00 in HH:MM:SS.

If exact arrival and departure times (timepoint=1 or empty) are not available, estimated or interpolated arrival and departure times (timepoint=0) should be provided.
stop_id Foreign ID referencing stops.stop_id Required Identifies the serviced stop. All stops serviced during a trip must have a record in stop_times.txt. Referenced locations must be stops/platforms, i.e. their stops.location_type value must be 0 or empty. A stop may be serviced multiple times in the same trip, and multiple trips and routes may service the same stop.
stop_sequence Non-negative integer Required Order of stops for a particular trip. The values must increase along the trip but do not need to be consecutive.
Example: The first location on the trip could have a stop_sequence=1, the second location on the trip could have a stop_sequence=23, the third location could have a stop_sequence=40, and so on.

Example: stop_times.txt

trip_id,departure_time,arrival_time,stop_id,stop_sequence
fg:1,15:45:06,15:45:06,de:08436:8049,2

stops.txt


File: Required

All Optional attributes as in GTFS stops.txt.

Primary key (stop_id)

Field Name Type Presence Description
stop_id Unique ID Required Identifies a location: stop/platform, station, entrance/exit, generic node or boarding area (see location_type).

Multiple routes may use the same stop_id.
stop_name Text Required Name of the location, e.g. {street}, {house_nr}, {zip}, {city}.
stop_lat Latitude Required Latitude of the location.
stop_lon Longitude Required Longitude of the location.

Example: stops.txt

stop_id,stop_lat,stop_lon,stop_name
mfdz:Ang001,53.11901,14.015776,Mitfahrbank Biesenbrow

calendar.txt


File: Conditionally required

All attributes as in GTFS calendar.txt.

Primary key (service_id)

Field Name Type Presence Notwendigkeit
service_id Unique ID Required Identifies a set of dates when service is available for one or more routes. Each service_id value must be unique in a calendar.txt file.
monday ENUM Required Indicates whether the service operates on all Mondays in the date range specified by the start_date and end_date fields. Note that exceptions for particular dates may be listed in calendar_dates.txt. Valid options are:
1 - Service is available for all Mondays in the date range.
0 - Service is not available for Mondays in the date range.
tuesday ENUM Required Functions in the same way as monday except applies to Tuesdays
wednesday ENUM Required Functions in the same way as monday except applies to Tuesdays
thursday ENUM Required Functions in the same way as monday except applies to Tuesdays
friday ENUM Required Functions in the same way as monday except applies to Tuesdays
saturday ENUM Required Functions in the same way as monday except applies to Tuesdays
sunday ENUM Required Functions in the same way as monday except applies to Tuesdays
start_date ENUM Required Start service day for the service interval.
end_date ENUM Required End service day for the service interval. This service day is included in the interval.

Example: calendar.txt

service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
fg:1,0,0,1,0,0,0,0,20220223,20220223

calendar_dates.txt


File: Conditionally required

All attributes as in GTFS calendar_dates.txt.

Primary key (service_id,date)

Field Name Type Presence Notwendigkeit
service_id Unique ID Required Identifies a set of dates when service is available for one or more routes. Each service_id value must be unique in a calendar.txt file.
date Date Required Date when service exception occurs.
exception_type ENUM Required Indicates whether service is available on the date specified in the date field. Valid options are:
1 - Service has been added for the specified date.
2 - Service has been removed for the specified date.

Example: calendar_dates.txt

service_id,date,exception_type
fg:1,20220223,,

shapes.txt


File: Required

All Optional attributes as in GTFS shapes.txt.

Primary key (shape_id)

Field Name Type Presence Notwendigkeit
shape_id ID Required Identifies a shape.
shape_pt_lon Latitude Required Latitude of a shape point. Each record in shapes.txt represents a shape point used to define the shape.
shape_pt_lat Longitude Required Longitude of a shape point.
shape_pt_sequence Non-negative integer Required Sequence in which the shape points connect to form the shape. Values must increase along the trip but do not need to be consecutive.Example: If the shape "A_shp" has three points in its definition, the shapes.txt file might contain these records to define the shape:
shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence
A_shp,37.61956,-122.48161,0
A_shp,37.64430,-122.41070,6
A_shp,37.65863,-122.30839,11

Example: shapes.txt

shape_id,shape_pt_lon,shape_pt_lat,shape_pt_sequence
1,9.595989,47.753088,1

fare_attributes.txt


File: Optional

All Optional attributes as in GTFS fare_attributes.txt.

Primary key (trip_id)

Field Name Type Presence Notwendigkeit
trip_id Unique ID Optional Identifies a trip.
fare_id Unique ID Optional Identifies a fare class.
price Non-negative float Optional Fare price, in the unit specified by currency_type.
currency_type Currency code Optional Currency used to pay the fare.
payment_method Enum Optional Gibt an, wann der Fahrpreis bezahlt werden muss. Gültige Optionen sind:
0 - Fahrpreis wird an Bord bezahlt.
1 - Der Fahrpreis muss vor dem Einsteigen bezahlt werden.

Example: fare_attributes.txt

trip_id,fare_id,price,currency_type,payment_method
e5cacd3-96de-4c40-9f4f-caf17b85619a,54asdasd8asd2asd,5.60,EUR,0

driver.txt


File: Optional

Extension of GRFS to the GTFS standard

Primary key (driver_id)

Field Name Type Presence Notwendigkeit
driver_id Unique ID Optional Identifies a driver.
profile_picture URL Optional URL contains the profile picture
rating ENUM Optional Rating of the driver from 1 to 5.
0 no rating yet

Example: driver.txt

trip_id,profile_picture,driver_id,rating
e5cacd3-96de-4c40-9f4f-caf17b85619a,"https://www.example.com",5

additional_ridesharing_info.txt


File: Optional

Extension of GRFS to the GTFS standard

Primary key (trip_id)

Field Name Type Presence Notwendigkeit
trip_id Unique ID Required Identifies a trip.
number_free_seats ENUM Required Number of free seats
same_gender ENUM Optional Trip only for same gender:
1: Yes
2: No
luggage_size ENUM Optional Size of the luggage:
1: Small
2: medium
3: large
animal_car ENUM Optional Animals in Car allowed:
1: Yes
2: No
car_model Text Optional Car model
car_brand Text Optional Car brand
creation_date DATE Required Date when trip was create - YYYYMMDD HH:MM:SS
smoking ENUM Optional Smoking allowed:
1: Yes
2: No
payment_method Text Optional Method of payment

Example: additional_ridesharing_info.txt

trip_id,number_free_seats,same_gender,luggage_size,animal_car,car_model,car_brand,creation_date,smoking,payment_method
e5cacd3-96de-4c40-9f4f-caf17b85619a,3,2,2,2,Golf,VW,20230820 12:10:10,2,PayPal

About

General Ridesharing Feed Specification

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published