Hello, what I'm trying to achieve is that I'd like to split a large OSM file into smaller OSM files which are going to be based on web mercator tiles at a particular zoom level, let's say 16. I'm aware of osmium-tool CLI and I know I could use this command:
The issue is that I needed to run a python script that executes the command above with different bbox boundaries (using mercantile package) — and every individual So, I'd like to code a C++ tool myself on top of libosmium directly and produce multiple osm files for tiles while handing the source OSM file. I think I can implement a A super small and simple example would be really useful for me to understand how I can implement a simpler and less sophisticated version of I'm hoping to find a direction and potentially also shed light on this for other for future reference, thank you. asked 02 Sep '23, 02:35 mfatihmar |
There is no "super small and simple example" because it is not a super small and simple problem you are trying to solve. You can look at the Osmium source code and find all the details in there. I suggest a different approach: answered 02 Sep '23, 08:05 Jochen Topf I had a look at osmium extract and considered --config something.json option but the limits are simply too low for me. On the C++ side, reading and processing a 50-100MB .osm.pbf file is not a big deal but osmium-tool set the memory and file limits simply too low for the pipeline I'm trying to build. I also had a look at these two places related: - https://github.com/osmcode/osmium-tool/issues/265 - https://github.com/osmcode/osmium-tool/commit/353e9d565342af1ea703c56a15f41dc40732168a Perhaps it's a bit complex than I initially anticipated but at least currently, I'm thinking of processing relations first, ways second and nodes the last to determine dependencies between them and create&use It is a little bit hard for me to read osmium-tool codebase (command-extract) and follow its logic. I will, however, use I wanted to see if there are hints/tips/tricks for this but apparently no, I need to implement a proper tool on top of libosmium.
(02 Sep '23, 13:58)
mfatihmar
|
Why do you want to do this? There may be an existing tool for your end goal.
I'm trying to break a large OSM file of a city into smaller chunks in web mercator tiles at a particular zoom level, so that I then convert them into 3D OBJ files and stream over the internet (over a real-time network connection). It's a pretty custom workflow and instead of hosting a full-blown tile-server, all I need is static OSM and OBJ files built/baked let's say every month automatically. I have looked at OSM2World, osmosis, osmium etc. and I think I need to write some custom tools on top of lower-level libraries like libosmium. Thank you for asking though :)