Closed M-nes closed 4 years ago
Hi @M-nes, would you mind providing the trimmed version of GTFS? Maybe I can help look into it.
Also what were the start and end time that you were looking at?
Yes of course you can find them here: trimmed_gtfs_feed.zip
I am interested in rush hours so I focused on the timestep strating from 7:00 am to 9:00 am.
@M-nes , you may want to define the start and end time in seconds
start = 7*60*60 # 7:00 AM
end = 9*60*60 # 9:00 AM
and here is the resulting graph - does that look right to you?
Thank you for your answer @yiyange ! But I still have some questions...
stops.txt
.I am not really familiar with graphs in general so I am not sure if this is normal or not. Is there a way to add all of them into the graph?
ox.plot_graph(G)
?@M-nes that probably has something to do with the fact that we were only looking at time from 7 to 9. Any stop that have no services in that time is not included.
Here I ran for 24 hours the number of nodes in the graph is the same as number of stops in the trimmed feed. (Side note: the nodes in the graph should technically be larger than the number of actual physical stops, but that is another issue (https://github.com/kuanb/peartree/issues/144))
Not particular reason :) It comes handy and I do not know other good network plotting utils.
@yiyange Oh ok it's nice to know!
Would you mind sharing the code you used to import and plot the feed to your graph G
? I still get the InsufficientSummaryResults: The target time frame returned no valid edge costs from feed object.
error when I try it.
@M-nes so I had to rename the individual .txt (remove the extra text in the end) in the folder and re-zip. Here is the code -
fpath = 'paris_trimmed_gtfs_feed.zip'
feed = pt.get_representative_feed(fpath)
start = 0*60*60
end = 24*60*60
G = pt.load_feed_as_graph(feed, start, end)
Thanks @yiyange !
Hello,
I find myself facing an issue with the use of the
G = pt.load_feed_as_graph(feed, start, end)
command.I am working with GTFS feed of the Paris region in France but I am not interested in the totality of the feed. As I only wanted to work on a smallest area, I selected the stop stations that were of interest to me and then extracted -into new GTFS files- the data of the original GTFS files that were linked to these stop stations. I used a script I found here that I modified a bit to fit my GTFS files and to trim them.
However, when I try to load my trimmed feed with
G = pt.load_feed_as_graph(feed, start, end)
I get the following error:InsufficientSummaryResults
``` --------------------------------------------------------------------------- InsufficientSummaryResults Traceback (most recent call last) in
3 # Converts feed subset into a directed network mugenerate_plotph
4
----> 5 G = pt.load_feed_as_graph(feed, start, end)
6
7 end_time = time.time()
~/anaconda3/envs/iox/lib/python3.6/site-packages/peartree/paths.py in load_feed_as_graph(feed, start_time, end_time, name, existing_graph, connection_threshold, walk_speed_kmph, stop_cost_method, fallback_stop_cost, interpolate_times, impute_walk_transfers, use_multiprocessing)
218 interpolate_times,
219 stop_cost_method,
--> 220 use_multiprocessing)
221
222 # This is a flag used to check if we need to run any additional steps
~/anaconda3/envs/iox/lib/python3.6/site-packages/peartree/graph.py in generate_summary_graph_elements(feed, target_time_start, target_time_end, fallback_stop_cost, interpolate_times, stop_cost_method, use_multiprocessing)
119
120 # Same sanity checks on the output before we continue
--> 121 _verify_outputs(all_edge_costs, all_wait_times)
122
123 summary_edge_costs = generate_summary_edge_costs(all_edge_costs)
~/anaconda3/envs/iox/lib/python3.6/site-packages/peartree/graph.py in _verify_outputs(all_edge_costs, all_wait_times)
208 # Handle if there are no valid edges returned (or wait times)
209 if all_edge_costs is None or len(all_edge_costs) == 0:
--> 210 raise InsufficientSummaryResults('The target time frame returned no '
211 'valid edge costs from feed object.')
212 if all_wait_times is None or len(all_wait_times) == 0:
InsufficientSummaryResults: The target time frame returned no valid edge costs from feed object.
```
I don't understand why the error is raised, I think my GTFS files where trimmed properly so I should be able to create a graph with them.
Any help or indications would be greatly appreciated.