AndGem / osm_extract_polygon

Extract Osmosis compatible and GeoJson polygon files from OSM PBF files
MIT License
16 stars 3 forks source link

Partial polygons #51

Open Gared opened 1 week ago

Gared commented 1 week ago

I don't know if this an issue with this library or osm data in general: For example if I try to extract germany-latest.osm.pbf it extracts also borders for austria, switzerland, etc. with admin_level=2, but the polygon in it is only the border between germany and austria and not the whole border of austria. Is there a way to extract only "whole polygons"?

AndGem commented 4 days ago

Hey @Gared ,

I looked a bit around, but it looks really like a data problem. I found for example this relation: https://ra.osmsurround.org/analyzeMap?relationId=51239

It is indeed incomplete.

However, in theory there might be a way to actutally still do it by merging multiple relations at the right places (and potentially interpolate a bit. This will be a bit more tricky. I'll play around with this in the next days to see if I can manage something (because my original intention was also to have this option.. I never tried it on this admin level and did not notice these kinds of problem, so thanks for reporting it).

AndGem commented 23 hours ago

As I feared, the data makes this really difficult. I had hoped that I can find overlapping nodes that I can use to reconstruct the whole border by stitching individual OSM relations together. However, already this doesn't work for germany-latest that I downloaded a few days ago.

I don't have any good idea how to do this in a reliable way. If you have any idea, I'm happy to try it out though.