Dear OSM community, I'm having problems with large relations. Mostly coastlines, seas or oceans (e.g. https://www.openstreetmap.org/relation/4497545). They cause problems when I try to segment large map tiles because they are not split apart if I keep relations together, causing quite high nodes counts per split. My question is: Is there some way to filter out such big relations using osm filter or similar commandline tools? Is anyone else having problems with this, and how did you address this problem? Best regards, David asked 15 Oct '21, 18:09 Gemons |
With osmosis you can do regional cuts using the However this process can lead to invalid geometries, so a large forest multipolygon that extends outside of your area might not be contained at all. (These large water bodies are a pet peeve of mine, I think they misrepresent the facts, are solely created to have nice labels on the map, and should be deleted and replaced by a node in the middle.) answered 15 Oct '21, 18:32 Frederik Ramm ♦ Thanks for the fast reply. I tried to clip relations at the bounding box of my map tiles, but as you mentioned I also saw that this sometimes produces weird results. E.g. one time I had a U-shaped forest. After clipping it was not clear anymore where inside and outside of the forest was. I think if there is no existing solution to filter a relation by node count (or member count could be enough as well) I will have to implement some filter like that on my own inside the program logic. I hope that the overall number of relations filtered out due to this will be low enough such that I can manually evaluate if the relations that were thrown away should really be thrown away.
(15 Oct '21, 18:44)
Gemons
Question is, what are you splitting the map for? IF you were to convert OSM data into geometries first (e.g. import into PostgreSQL) then you could split that nicely and cut large areas into smaller areas along the boundaries. Or use vector tiles. But I can't tell you if that will work for your use case since I don't know enough about that.
(15 Oct '21, 18:48)
Frederik Ramm ♦
I'm currently working on a map that only shows the type of environment. E.g. forest, water, meadow ... For this I merge multiple tag groups describing the envrionment into 11 environment groups. Then I import the map data into e.g. Python or Matlab and process the geometry. The code I have only works good on smaller map tiles ans the merging of polygons becomes quite expensive when the polygons become larger. Therefore, I split the map into smaller tiles upfront and process the tiles one by one. Ideally I will do this for the whole world map, mich means it should run automated as much as possible.
(15 Oct '21, 18:57)
Gemons
|