-
Notifications
You must be signed in to change notification settings - Fork 31
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
[WIP] Add default route creator #72
Conversation
creators/routes_creator.py
Outdated
# Add route information | ||
route = schedule.AddRoute( | ||
route_id=line_ref, | ||
route_type=self._get_route_type(line), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure it is a good idea to get this from the config, because there might be providers with different route types like bus, tram and trains. Shouldn't this come from OSM ideally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created different small functions for the different properties to, like you proposed, be able to override them in specific creators later. In these functions, I first only got the information from OSM and overrode the functions in Incofer's creator, but then later thought that it would be cool if one could specify the values in the configuration. But with your other comment, I indeed think that this is overkill and not wanted. I just pushed my old commit which is much more simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I preffer getting the attributes from OSM. In the case of GTFS optional attributes as fallback we can set a default value for all providers and a warning message with help on how to fix it in OSM. (as an enhacement, when running the script we can set a flag to ignore warnings ).
For required attributes (I also prefer to get them from OSM and printing the error in case of) I'll agree to have the fallback value in the config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't be better to handle the attributes in core.osm_connector.py
?
creators/incofer/incofer.json
Outdated
"text_color": "ffffff", | ||
"type": "Tram", | ||
"url": "http://www.incofer.go.cr/tren-urbano-alajuela-rio-segundo" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that all lines have the same color, description, etc.
Is this really something for the config? Maybe these should be seen as default values, if no other source of information is available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think @xamanu was advocating for storing these things in OSM, if I remember correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed He was advocating. (I should add that data to osm)
The default route creator is based on Incofer's creator and splits up the different properties in small functions which can be overridden by custom creators easily. This is already done in Incofer's creator but not in Fenix' because Fenix does route creation in its trips creator. Fixes #26. Fixes #13.
I suggest closing this PR and file a new pull request based on the recent work, which has been already successfully used by us (@AltNico, @ialokim and myself) to generate GTFSes in Nicaragua: https://github.com/mapanica/osm2gtfs/tree/default-creators |
@xamanu
I agree with you! |
The default route creator is based on Incofer's creator and splits up the different properties in small functions which read from the config and the line object by default, but also can be overridden by custom creators easily. This is already done in Incofer's creator but not in Fenix' and Accra's because they do route creation in their trip creators.
Fixes #26.
Fixes #13.