Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract configuration #3

Closed
xamanu opened this issue Sep 17, 2016 · 5 comments
Closed

Abstract configuration #3

xamanu opened this issue Sep 17, 2016 · 5 comments

Comments

@xamanu
Copy link
Contributor

xamanu commented Sep 17, 2016

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?

@xamanu xamanu changed the title config.json Abstract configuration Sep 17, 2016
@grote
Copy link
Owner

grote commented Sep 17, 2016

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?

@xamanu
Copy link
Contributor Author

xamanu commented Sep 17, 2016

Sounds good!

@xamanu
Copy link
Contributor Author

xamanu commented Sep 17, 2016

I put the basic configuration into a separate json config file. It's in the recent pull request. I appreciate your consideration!

@grote
Copy link
Owner

grote commented Sep 18, 2016

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 ;)

@jamescr
Copy link
Collaborator

jamescr commented Sep 18, 2016

👍 for using a json file for the config data., I'll comment on the PR.

@grote grote closed this as completed in 2bb8c03 Sep 19, 2016
@xamanu xamanu self-assigned this Nov 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants