I need to convert a Shapefile (.shp), shx or dbf to GTFS (General Transit Feed Specification https://developers.google.com/transit/gtfs/reference).

Do you know any tool for this issue?

  • Is there a specific GTFS component that you're having difficulty with? This is very broad otherwise. There will be no point and click tool to do it for you, unless your shapefile somehow already conforms to the specification (and that seems extremely unlikely given the specification consists of multiple files, most of which are not spatial). – alphabetasoup Sep 22 '15 at 2:25

I'd do it using Python. It's going to be custom, I reckon.

There's a shapefile reading library: https://code.google.com/p/pyshp/

And you're writing CSVs. Doing it with Python means it's repeatable too!

| improve this answer | |
  • 2
    it's that or add the required fields in a program like QGIS and export the attribute table to csv... writing a script gives you the benefit of being able to do this again when the data updates but also documents in a repeatable way how the data is created, any typos or non-conformance can be rectified and overwritten quickly, whereas exporting the table is going to take as long every time and is more likely to be forgotten or misstepped. – Michael Stimson Sep 22 '15 at 3:56

Safe Software's FME Version 2016 can read Shapefiles (among numerous other formats) and write GTFS etc.


You are welcome to evaluate FME and make use of our support to see if this solution is suitable.

Disclosure: I am the European Services Manager for Safe Software Inc

| improve this answer | |

ArcGIS Pro 2.2 introduces a Features To GTFS Stops tool which:

Converts a feature class to a GTFS stops.txt file for a GTFS public transit dataset.

Note that:

A file geodatabase feature class is recommended for tool input instead of a shapefile because some field names allowed by the GTFS specification are longer than the maximum of 10 characters allowed for shapefile field names.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.