Hello @pcarrerabalsell
It sounds like you already have a GTFS file since you have stops.txt
.
Are you certain shapes.txt
is empty? It should be populated with vertices of the routes contained in the GTFS file. Unzip the GTFS zip file and open shapes.txt
in a text editor. It should look something like the example as shown in https://developers.google.com/transit/gtfs/examples/gtfs-feed#shapestxt
Are you able to share why you need to create a shapes.txt
?
I don't understand the core of the problem.
You are reading 2 files. One with lines and one with points?
And you want the line to start at the position where there is a point with a stop attribute? So if the line is ending at a point with a stop attribute you want to reverse it?
Are you having trouble testing if the line starts or ends at the point?
Are you having trouble using the Orientor?
Or is this something specific to GTFS files that I don't know of?
hi @debbiatsafe and @jkr_wrk ,
I want a gtfs with shapes to be displayed in a mobility application for which we are responsible for the backoffice.
Actually this gtfs comes without shapes.txt in source, it is not a mandatory file. We cook and adapt this gtfs to our mobility application needs.
One of the operations is to build the shapes.
Until now we inserted the shapes manually, but due to the constant change of trips in the gtfs this involves a lot of manual work.
What I wanted was to automate the construction of shapes depending on the trips and include it in the same workflow where gtfs is 'cooked'.
I had thought of building it from the stop_times table, stops table and the master lines in kml.
I managed to get a non-spatial table with trip id, origin stop id and destination stop id. I could cut the kml master for each trip with stops from the stops table. Then, if appropriate, reorient the line so that vertex 0 coincides with the coordinates of the origin stop.
The problem is that I'm not sure how to do it fully autonomously and automatically.
I hope I explained myself better.
Thanks in advance.
Pol
The problem is that I'm not sure how to do it fully autonomously and automatically.
So you know what steps to make. Do you know how to do each individual step automaticly or is there some manual thinking involved? Do you have trouble with the order of steps, or with connecting the steps?
It sometimes feels way to complex when you build all the steps together, but it is usually just how it should be done. Take it step by step, take a small dataset with simple examples and start building.
If we could help with any of the steps, feel free to ask.
Good to know the whole process and the little problems.