trafiklab / gtfs-php-sdk Goto Github PK
View Code? Open in Web Editor NEWAn SDK to easily handle GTFS files
License: Mozilla Public License 2.0
An SDK to easily handle GTFS files
License: Mozilla Public License 2.0
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.
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.
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:
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).If you think that one of these should be implemented, let me know and I'll prepare a PR.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.