We have successfully uploaded OSM data to our server using Docker, following the official OSM documentation: Using a Docker container.
I would like to clean and modify some data, such as removing unverified boundaries, walls, and polygons that are subject to disputes between countries.
What is the best way to handle this?
Based on my current knowledge, I can connect to the OSM database on our server and edit the data using QGIS. However, we also want the data to update automatically after each OSM update.
Any advice or best practices for managing this scenario would be greatly appreciated.
That’ll get a a raster tile rendering server, with a Postgres database that matches either OSM Carto, or some other map style (if you’re using a different one).
Unless QGIS can do more than I’m aware of, probably not?
Given that you want automatic updates, I’d suggest trying to build that logic into the lua script that is called both at initial database load and when minutely updates to the database are applied.
If you haven’t set automatic updates up yet, I’d do that next.
While you’re testing, I’d suggest using a really small OSM extract (so that you can reload quickly) and test removing features from that in the lua, as updates come in. Specific advice about how to do that probably needs more specific examples from you (i.e. links to what you have so far).
Also be aware that osm2pgsql can now do more that the switch2osm documentation talks about (flex output, for example) and other tile options are available too.
If you can identify the to be removed objects by their tags (it would work by ID as well but IDs are not guaranteed to be stable), you can modify the database queries in the .mml file of the map style (re-run carto afterwards to update the .xml file).
It allows you to use spatial intersections (for example remove all boundary fortification features in a provided polygon). If you add queries to the map style, check if conditional indexes need modified WHERE clauses or new indexes need to be added. If you work with large polygons, consider splitting the polygon into smaller chunks for better usage of a spatial index if the features to be intersected are smaller (e.g. intersection of road segments with countries).
Best regards
Michael, who sometimes has clients requesting for modified map styles being transparent in their country or not rendering certain layers in some regions