Circle CI

gtfs-geojson is a Ruby utility to convert the shapes.txt file of a GTFS feed into a GeoJSON file. It uses the GTFS gem to validate GTFS feeds and wrap the feed data into usable objects. Two command-line utilities are also included with a gem install.


Add the following to your Gemfile.

gem 'gtfs-geojson'

or install the gem through the command line.

gem install `gtfs-geojson`

Command-Line Utilities

Convert a GTFS feed shapes.txt file into a GeoJSON file.

gtfs_to_geojson output.geojson

Print a human-readable form of a GTFS-realtime feed.

gtfs-rt_to_json positions.json


require 'gtfs-geojson'
geojson = GTFS::GeoJSON.generate("")"gtfs.geojson",'w') do { |f| f.write(geojson) }

Develop Locally

To develop locally, clone the repository and run bundler to setup the necessary gems.

bundle install

Run Tests

bundle exec rake

Run Tests and Collect Code Coverage

bundle exec rake coverage


Please contact Tyler at [email protected] or file a GitHub Issue with any ideas or suggestions.