pyrosm
pyrosm copied to clipboard
Broken boundaries when using `OSM.get_boundaries()`
If I get the boundaries of an English county and plot them, there are some weird straight lines that do not belong to administrative divisions.
For instance, if I plot the Oxfordshire map:
fp = get_data("oxfordshire")
osm = OSM(fp)
boundaries = osm.get_boundaries()
boundaries.plot(
facecolor="none",
edgecolor="gray",
figsize=(8, 8)
)
I get this map with some straight random lines:
Getting only the border named "Oxfordshire" from the administrative_level corresponding to counties does not help either.
oxon_boundaries = osm.get_boundaries(name="Oxfordshire")
oxon_boundaries = oxon_boundaries[oxon_boundaries.admin_level == '6']
oxon_boundaries.plot(facecolor="none", edgecolor="gray")
@Zigur Thanks! I will look into this 👍🏻
I have the same problem.
After uploading the geo data was corrupted.
Me too
at least for me these seem to be broken where a boundary touches or intersects the boundary of the respective osm.pbf file.
The following would be german county boundaries but any boundary that touches the extent of the osm.pbf file gets connected in ways that create odd self intersecting polygons:
Hi @HTenkanen, i encountered same issue that the incomplete boundaries connected to Andorra
and i also investigated the issue, and found misalignment between roles (outer, inner, center) and masks (inner and outer). I try to fix it in this way, and here is my result. I made the incomplete boundaries as line strings, and see this screenshot Patch: boundary-issue.patch.gz
Cheers, Sam
Hi @HTenkanen,
I also found the bug in multiploygon geometry creation in the code, while i used it for my analysis. As you can see the protected area next to Andorra which is a multipolygon geometry, and rings are not assemble properly.
I also fixed the issue, but i didn't optimize it yet.
Here is the results and patch. Hope this patch helps. boundaries-multipolygon-display-issue.patch.gz