Code Monkey home page Code Monkey logo

gtfs-php-sdk's People

Contributors

bertware avatar bijanmmarkes avatar evgushchin avatar filippotoso avatar greeny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gtfs-php-sdk's Issues

Remove kit.zip file from repository

The Zip file in tests/Resources/Gtfs/kit.zip adds and additional 29.4mb to the package size.

This should either be ignored when installing it via composer or removed and retrieved from a hosted endpoint.

For server deployments or even serverless deployments, this would make the project too large to deploy.

Does this package support GTFS realtime?

Thanks for your work on this package, comes in very handy!

I find mixed info on realtime support, so I was wondering if this package supports it?
Saw that it is tagged with gtfs-realtime, but it doesn't seem to be able to read the file I have. (regular GTFS file works fine).
Further research shows that PHP support is deprecated for it, so might need to consider a language change.

"Invalid" CSV with spaces after separators

After parsing a lot of GTFS sources, I've found out some that have spaces after commas in files, for example this one from https://transitfeeds.com/p/metra/:

route_id, route_short_name, route_long_name, route_desc, agency_id, route_type, route_color, route_text_color, route_url
BNSF, BNSF, Burlington Northern, , METRA, 2, 29C233, 000000, https://metrarail.com/maps-schedules/train-lines/BNSF
HC, HC, Heritage Corridor, , METRA, 2, 550E0C, FFFFFF, https://metrarail.com/maps-schedules/train-lines/HC
MD-N, MD-N, Milwaukee North, , METRA, 2, CC5500, FFFFFF, https://metrarail.com/maps-schedules/train-lines/MD-N
MD-W, MD-W, Milwaukee West, , METRA, 2, F1AD0E, 000000, https://metrarail.com/maps-schedules/train-lines/MD-W
ME, ME, Metra Electric, , METRA, 2, EB5C00, FFFFFF, https://metrarail.com/maps-schedules/train-lines/ME
NCS, NCS, North Central Service, , METRA, 2, 9785BC, FFFFFF, https://metrarail.com/maps-schedules/train-lines/NCS
RI, RI, Rock Island, , METRA, 2, E02400, FFFFFF, https://metrarail.com/maps-schedules/train-lines/RI
SWS, SWS, Southwest Service, , METRA, 2, 0042A8, FFFFFF, https://metrarail.com/maps-schedules/train-lines/SWS
UP-N, UP-N, Union Pacific North, , METRA, 2, 008000, FFFFFF, https://metrarail.com/maps-schedules/train-lines/UP-N
UP-NW, UP-NW, Union Pacific Northwest, , METRA, 2, FFE600, 000000, https://metrarail.com/maps-schedules/train-lines/UP-NW
UP-W, UP-W, Union Pacific West, , METRA, 2, FE8D81, 000000, https://metrarail.com/maps-schedules/train-lines/UP-W

Now the obvious issue here is that it ges parsed and none of the values are assigned since the header row contains values with space at the begining.

I know this isn't really an issue of your library, but before I start making a PR, I basically wanted to ask if you think this is something that should be handled on library side. I have some suggestions on how to fix this:

  1. array_map('trim', $row) for all rows. This will fix all issues related to extra spaces. However in a rare case where the space actually has to be in the name, this will strip it (but I can't imagine a case where space at the begining or end of anything will be required).
  2. the same as above, but just for header row. That way data stays in the original form, but the header will be "fixed" in case it has spaces (and in header it's pretty much guaranteed that we won't have anything with required spaces)
  3. some kind of "smart" detection of whether or not the spaces should be removed. I personally don't like this option, as it's a bit magical and the two above sound better to me.

If you think that one of these should be implemented, let me know and I'll prepare a PR.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.