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
osmWebWizard.py: allow filtering road types in OSM API query to reduce download size #7585
Comments
Suggested approach:
|
Another thing that might reduce the OSM query by a lot: if the 'Add polygons' checkbox is disabled, modify the osm query so that it doesn't retrieve building shapes |
I will work through the approach 👍 |
Current Progress:
|
I will replace the query parameter in every readCompressed call. Is this a good approach? |
In principle, yes. I think all code paths should support the new filtering option. |
I was trying queries of the type:
It shortend the query but "higher-ed" the complexity. Now i am using queries of type:
Which is much longer but therefore more precise for the Overpass API. |
Sounds good! |
By filtering as described in my previous comment, we only get streets but no buildings, green areas, seas ... so the result will look like this ( its like turning off polygons in the masters version): As it is now we reduce the osm_bbox.osm.xml file from 14.3 MB to 2.5 MB for the same area. Update: After negating query we get 12,4 MB filesize for the same area and enabled all road-types. What do you think? |
Webwizard already has a checkbox that selects whether polygons are built. I think the best way forward would be to pass this information as another option to osmGet and use it to control whether non-road data is downloaded or not. |
Yes, that is what i meant with "turning off polygons in the masters version". Is there shortcut for non-road data in the Overpass API? Instead of filtering for every key-value pair containing "building, sea, etc. |
I don't think Overpass has special functions for road vs non-road stuff.
In my experience, one of the biggest things data-wise are the building shapes. Even filtering just those depending on the 'polygon' checkbox should achieve big savings. |
Okay thanks, i will try to add the polygon parameter to the process to reduce the download size. |
Final Status:
OSM File Sizes (all roads):
I think this i a pretty good result :) |
We try to limit the number of dependencies for non-default python libraries and I'd prefer it to merge your commit without the bs4 dependency. For idiomatic xml parsing, sumolib already comes with a small parsing wrapper. Here is a simple replacement guide for the bs4 lines:
replace with
|
If the PR gets merged i can also update the Tutorial and extend it with the new road-type feature 👍 |
Can you add `road.png' to the PR? |
…e download size eclipse#7585 (#10098) * [#7585] added new road-types tab eclipse#7585 * Pass Road-Type Parameter through script.js to osmGet.py, added new Argument to osmWebWizard.py eclipse#7585 * modify the osm query in readCompressed to restrict the list of retrieved osm-way-entities eclipse#7585 * added "add Polygon" parameter to the download process of the OSM data; getting data from XML files eclipse#7585 * finalize queries; minimizing download size of OSM data eclipse#7585 * replace bs4 with sumolibs xml parser eclipse#7585 * added road.png eclipse#7585
Works great! |
The relations add a significant amount of data to the osm download. Some of them are mandatory (i.e. turn restrictions). |
I will try to append your suggestion with the public transport in the near future, but for now i had to prepare for some exams :/ |
would require a new input field (road-type-filter) and corresponding new osmGet.py option
The text was updated successfully, but these errors were encountered: