Skip to content

A GTFS writing library for Go. This is our fork with fixes that haven't been merged upstream yet.

License

Notifications You must be signed in to change notification settings

public-transport/gtfswriter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Report Card GoDoc

go gtfswriter

A writer for the GTFS structure created by the go gtfsparser. This can be used to write feeds that have been changed programmatically back to a GTFS feed.

Usage

feed := gtfsparser.NewFeed()
error := feed.Parse("sample-feed.zip")

// do stuff with feed

w := gtfswriter.Writer{}
werror := w.Write(feed, "/path/to/output")

Features

Optional fields are not outputted if empty, if default values are used, the writer outputs them empty.

The ZIP compression level can be specified by setting ZipCompressionLevel:

w := gtfswriter.Writer{ZipCompressionLevel : 9}
werror := w.Write(feed, "/path/to/output")

The following options are supported:

  • 0 (default): default compression
  • 1-9: Compression levels from 1 (fastest) to 9 (best)
  • -1: no compression

Known restrictions

For direct output in ZIP file, you must create it before:

// do stuff with feed
os.Create("/path/to/output.zip")

w := gtfswriter.Writer{}
werror := w.Write(feed, "/path/to/output")

License

GPL v2, see LICENSE

About

A GTFS writing library for Go. This is our fork with fixes that haven't been merged upstream yet.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 98.9%
  • Makefile 1.1%