Comments (8)
Great idea. I'd live to have that implemented.
What functions do you think should return geojson?
from node-gtfs.
I think it makes sense for the following functions:
- getStops
- getStopsByRoute
- getStopsByDistance
- getShapesByRoute
Maybe the name could be something like funcNameAsGeoJson?
from node-gtfs.
Sounds good. Or, instead we could extend those functions to take an
additional optional parameter 'geojson' which can be true or false. Or it
could be called 'type' and take the argument 'geojson'.
What do you think?
On Sat, Nov 12, 2016 at 10:26 Marcelo Muñoz Araya [email protected]
wrote:
I think it makes sense for the following functions:
- getStops
- getStopsByRoute
- getStopsByDistance
- getShapesByRoute
Maybe the name could be something like funcName_AsGeoJson_?
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
#66 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAF32SpERyxTVTLCP3n_4Lbm8E-9Ldd1ks5q9YZegaJpZM4KuUuq
.
from node-gtfs.
Ok! I agree, Let's try it that way.
2016-11-12 13:27 GMT-03:00 Brendan Nee [email protected]:
Sounds good. Or, instead we could extend those functions to take an
additional optional parameter 'geojson' which can be true or false. Or it
could be called 'type' and take the argument 'geojson'.What do you think?
On Sat, Nov 12, 2016 at 10:26 Marcelo Muñoz Araya <
[email protected]>
wrote:I think it makes sense for the following functions:
- getStops
- getStopsByRoute
- getStopsByDistance
- getShapesByRoute
Maybe the name could be something like funcName_AsGeoJson_?
—
You are receiving this because you commented.Reply to this email directly, view it on GitHub
<https://github.com/brendannee/node-gtfs/issues/
66#issuecomment-260111637>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAF32SpERyxTVTLCP3n_
4Lbm8E-9Ldd1ks5q9YZegaJpZM4KuUuq>
.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#66 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJuaz1NGEY1jMAzQkzSNZ4tKzs9j4HM5ks5q9ekFgaJpZM4KuUuq
.
from node-gtfs.
Hello, I'm kind of new at this so bear with me. I was also interested in an option to get an output in geoJSON. I added a geoJSON parameter which can be true or false (or anything really since I check only if it is there) which transform the result in a FeatureCollection
of Points for getStops
, getStopsByRoute
and getStopsByDistance
. You can look at it in my fork: ecaf6cd
I am not really satisfied on how I introduced the new parameter, since it is optional and there are other optional parameters I had to take into account that it can take the place of the other optional parameter. You already had some code for this case but only if there is only one optional parameter. It works but feels hacky. I would also maybe pass an options
object just in case there are other optional parameters added down the line. To keep backward compatibility the optional parameters that still exist would have to stay outside the option object though.
Anyways, this is what I did so far. I'll start working on other functions like routes and maybe also try to tackle streams, this would be a nice addition though and I've been wanting to try them for a while.
from node-gtfs.
I like your idea of passing an options
object to support other optional parameters, and for functions that already take optional parameters we could move these in. That would be part of a entirely new version of this library with breaking changes.
from node-gtfs.
I added some new routes to node-gtfs that are geoJSON specific. This ended up working better than adding options to the existing methods.
I added routes for getting stops and shapes from GTFS.
I also published a new package called gtfs-to-geojson that uses these routes in a handy command line tool to generate geoJSON and save it to a file.
https://github.com/brendannee/gtfs-to-geojson
Check it out and let me know what you think.
from node-gtfs.
New routes might be the better idea here to keep backward compatibility. The options object idea would be better off for a new version, as it is now it creates more problem than it solves.
Thanks by the way, this is nice work. I'm learning as I fiddle with your code :)
from node-gtfs.
Related Issues (20)
- Can I use the command line for query operations? HOT 6
- GTFS-R TripDescriptor HOT 5
- Working with Docker Database locked HOT 4
- Dropping/Clearing database HOT 1
- Deployment on errors HOT 5
- Invalid default csv parser option "relax" in import script. HOT 2
- Performance improvements HOT 4
- Possible performance improvement: DuckDB HOT 4
- Changing internal maxInsertVariables has significant impact on total import time HOT 5
- Agency_id defined in agency.txt but not in routes.txt results in invalid GTFS export HOT 1
- Edge deployment and SQLite HOT 4
- Not running with Deno HOT 9
- occupancyStatus from vehicle_positions HOT 6
- Persistent trip_updates when running getStopTimeUpdates HOT 13
- Deleting the db to avoid id collisions HOT 3
- Propagate RT delays to missing stop_sequences HOT 6
- updateGtfsRealtime doesn't work if one URL is down HOT 2
- Disable clean stale GTFS-Realtime data by default HOT 12
- Zip File Containing Multiple GTFS Static Zip Files HOT 3
- import.js throws an error because attribution_id is missing but the spec says it's optional HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-gtfs.