I am writing a code in Python to find bus stops inside of different rectangles that depend on incoming data.I am able to this with the overpass Api and the python module overpy but query time is usually around 5 seconds and I would like to have it under 1 second. Moreover, the limit of queries is reached. My second attempt was to save a local osm copy and to cut the area of interest with osmosis, however, trimming the area takes nearly 2 minutes. What is the fastest way to accomplish this ? asked 02 Mar '21, 17:38 fragodec |
The command line tool Osmium can do all sorts of things like creating extracts. It is much faster than Osmosis. I recommend the following way of processing OSM data:
Python code will be slower than the optimized C++ code of the Osmium command line tool, so it makes sense to do pre-filtering with the faster tool (step 2/3) and then use Python for the rest. answered 02 Mar '21, 20:46 Jochen Topf 1
Thank you for your detailed answer. Two-follow up questions:
(03 Mar '21, 07:55)
fragodec
1
to 1) No, unfortunately there isn't an easy way to install Osmium on Windows. You might be able to use WSL for this. to 2) There is no special way for doing this, but you can run any program from Python with
(03 Mar '21, 08:33)
Jochen Topf
|