2

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?

1
  • 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). Commented Sep 22, 2015 at 2:25

3 Answers 3

4

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!

1
  • 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. Commented Sep 22, 2015 at 3:56
2

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

http://www.safe.com/

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

1

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.

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