-
Notifications
You must be signed in to change notification settings - Fork 3
problem extracting admin level 3 - 4 within a country from country-specific pbf #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @mashallAryan , thanks for filing the issue! I'm not fully surprised that there is some "leaking" of other countries admin boundaries in the data source. Unfortunately, it is not trivial to filter for "country" as the data seems to be not consistently contained in There are some solutions (that are more or less hacky) that I can see on how to resolve the situation. There might also be a workaround that might work out for your use case. What you might do (not tested; maybe it doesn't work):
I assume this might work and solve your issue. Otherwise, I'm tempted to actually implement solution What do you think? And if you have tried out the workaround, please let me know if it works. I would add it to the README until the issue is properly addressed (if possible). I'm also open to PRs if you want to add the information yourself. |
Hi, Following AndGem's workaround, a useful solution could be to accept a polygon mask file as an input to this routine, and publish out only polygons whose centroids fall inside that mask. That essentially internalizes the the extra "cut" operation with osmosis. Pseudocode for how to find a centroid, and compute whether the centroid is inside another polygon, is easy to come by. But overall, thank you for this contribution! It's super useful. |
I would like to extract admin levels within a specific country (e.g. USA) give its pbf file. The problem is the output of osm_extract_polygon includes admin levels from neighboring countries as well (e.g Canada). Is this a bug or I am not able to use this properly?
example:
osm_extract_polygon -m 3 -x 6 us-latest.osm.pbf
includes "quebec" but does not include Alaska.
The text was updated successfully, but these errors were encountered: