Abstract configuration
Closed this issue · 5 comments
Hello,
currently a lot of custom configuration data is stored in code. I'd like to push it to be more generic.
I'd suggest to rely on a config.json file similar to geom2gtfs does: https://github.com/conveyal/geom2gtfs/blob/master/kingco.json.example
We could start with a simple structure, based on the general information used for querying from OSM and from GTFS' agency.txt and start and end date from calendar.txt:
{
"query":{
"network": "",
"bbox": {"e": "-48.2711", "n": "-27.2155", "s": "-27.9410", "w": "-49.0155"},
},
"agency":{
"agency_id": "",
"agency_name": "",
"agency_url": "",
"agency_timezone": "",
"agency_lang": "",
"agency_phone": "",
"agency_fare_url": "",
},
"feed_info":{
"publisher_name": "",
"publisher_url": "",
"licence_name": "",
"licence_url": "",
"version": "",
},
"gtfs_mode":3,
"start_date": "",
"end_date":"",
"schedule_information": "",
"output": "",
}
What do you think? Is this a way to go?
Thanks for creating this ticket. We should definitely get as much specific information out of the code as possible and we should do it in small incremental steps.
@jamescr will like the json format above as that looks very similar to what he is already using in his fork.
How about we start with extracting the feed_info
and agency
as a first step and then create additional tickets for the other data that could also live in this same json file?
Sounds good!
I put the basic configuration into a separate json config file. It's in the recent pull request. I appreciate your consideration!
I put the basic configuration into a separate json config file. It's in the recent pull request. I appreciate your consideration!
Thanks a lot! Btw., there's no need to mention this here again. I get notified about new PRs and changes to them ;)
👍 for using a json file for the config data., I'll comment on the PR.