I’ve been trying to build a website (in Django) which is to be an index of all MTB routes in the world. I’m a Pythonian so wherever I can I try to use Python.
I’ve successfully extracted data from the OSM API (https://stackoverflow.com/questions/68248846/display-relation-trail-in-leaflet) but found that doing this for all MTB trails (tag: route=mtb) is too much data (processing takes very long). So I tried to do everything locally by downloading a torrent of the entire OpenStreetMap dataset (from https://planet.openstreetmap.org/) and filtering for tag: route=mtb using osmfilter (part of osmctools in Ubuntu 20.04), like this:
This produces a file of about 1.2 GB and on closer inspection seems to contain all the data I need. My goal was to transform the file into a pandas.DataFrame() so I could do some further filtering en transforming before pushing relevant aspects into my Django DB. I tried to load the file as a regular XML file using Python Pandas but this crashed the Jupyter notebook Kernel. I guess the data is too big.
I’m open to many solutions, for example one could break the file up into many different files containing 1 relation and it’s members per file, using an osmium based script. Perhaps then I can move on with pandas.read_xml(). This would be nice for batch processing en filling the Database. Loading the whole OSM XML file into a pd.DataFrame would be nice but I guess this really is a lot of data. Perhaps this can also be done on a per-relation basis with pyosmium?
Ok, the conversion worked and I can do the same things with the file (while it being considerably smaller). The result is also the same thought… No lists of Members per relation. I have a hard time understanding pyosmium.
My reasoning was that it also doesn’t really make sense to maintain 2 help fora with the same target audience. I posted this first about 3 weeks ago and recently, because there was no satisfying answer, I turned to the pyosmium github page https://github.com/osmcode/pyosmium/issues/184, shortly after posting that issue, I read that they prefer me posting questions at help.openstreetmap.org, and thus I tried it there.
Anyway, since I have no idea if there is any overlap in visitors between here and help.openstreetmap.org, and it could well be that the probability of getting a correct answer is much higher at help.openstreet.org, I tried it there as well.
In any event, my plan was to post the outcome and the answer on both forums, helping both audiences and increasing the chance that someone DDG-ing/Googling hits the right answer.
If this is undesirable, I apologize and I would like to hear what the preferred forum is and where the largest number of knowledgeable people roam the posts.
I would at least expect that you add links to other sites where you have posted the same question. This way you can avoid that people spend their time answering your question, which has already been answered elsewhere. Thank you.