2
2
Fork
You've already forked overpass-api-python-wrapper
2

Support relation on geojson #48

Open
opened 2016年04月12日 06:05:03 +02:00 by humitos · 11 comments
humitos commented 2016年04月12日 06:05:03 +02:00 (Migrated from github.com)
Copy link

I found that relation type are being skipped. Is it intentional? Why? https://github.com/mvexel/overpass-api-python-wrapper/blob/master/overpass/api.py#L126

Is it possible to add support for them?

Thanks!

I found that `relation` type are being skipped. Is it intentional? Why? https://github.com/mvexel/overpass-api-python-wrapper/blob/master/overpass/api.py#L126 Is it possible to add support for them? Thanks!
colinmccormick commented 2016年07月13日 23:05:58 +02:00 (Migrated from github.com)
Copy link

I would also like to know the answer to this - hopefully it's not intentional.

I would also like to know the answer to this - hopefully it's not intentional.
mmd-osm commented 2016年11月10日 13:21:31 +01:00 (Migrated from github.com)
Copy link
Another report of missing relation support: http://gis.stackexchange.com/questions/217278/what-is-the-right-code-for-getting-geojson-data-of-relations-by-overpass-in-pyth
t-g-williams commented 2017年05月27日 00:49:16 +02:00 (Migrated from github.com)
Copy link

For those who may still be having problems with this, I have addressed this issue and created a pull request on github. See following link: https://github.com/mvexel/overpass-api-python-wrapper/pull/76

For those who may still be having problems with this, I have addressed this issue and created a pull request on github. See following link: https://github.com/mvexel/overpass-api-python-wrapper/pull/76
TimHarder commented 2017年09月12日 13:28:38 +02:00 (Migrated from github.com)
Copy link

Thanks t-g-williams .. saved me a lot of headaches today. Thanks for the implementation of relations.!

On that note .. would also second the need for native support of relations.

Thanks t-g-williams .. saved me a lot of headaches today. Thanks for the implementation of relations.! On that note .. would also second the need for native support of relations.
t-g-williams commented 2017年09月14日 22:38:46 +02:00 (Migrated from github.com)
Copy link

@TimHarder I just added a further commit that I hadn't gotten around to pushing ("added support for multipolygons"), it's been sitting on my computer for a while.
The previous commit that I made didn't account for multipolygons (i.e. more complex polygons that may have "inner" areas removed from them - see http://wiki.openstreetmap.org/wiki/Relation:multipolygon). This addresses that.
It seems to be failing some test though when I upload it to github, but the code runs on my computer.
Hope that helps

@TimHarder I just added a further commit that I hadn't gotten around to pushing ("added support for multipolygons"), it's been sitting on my computer for a while. The previous commit that I made didn't account for multipolygons (i.e. more complex polygons that may have "inner" areas removed from them - see http://wiki.openstreetmap.org/wiki/Relation:multipolygon). This addresses that. It seems to be failing some test though when I upload it to github, but the code runs on my computer. Hope that helps

@t-g-williams and others, I would love to add relation support and am considering this PR.

I think we can go ahead and add it if we can work on getting some test coverage. The code is a little hard to parse, but I think we can work on cleaning it up some after we merge and release.

Who can work on the test coverage?

@t-g-williams and others, I would love to add relation support and am considering this PR. I think we can go ahead and add it if we can work on getting some test coverage. The code is a little hard to parse, but I think we can work on cleaning it up some after we merge and release. Who can work on the test coverage?

I do want to tackle this but not sure how yet. Looking at using pyosmium or perhaps interfacing with Shapely (which could potentially simplify other aspects as well -- reducing the code needed to support output formats but instead relegating that to Shapely.

Pinging a few experts! @lonvia @pnorman @iandees @tbolender

I am still more than happy to work on the current PR as well, but it has gotten stale and it would need to be manually merged. The reason I didn't merge it at the time was mainly that the code was just really hard to read. Also I would love some unit tests for it. (Test coverage is abysmal anyway so I am not setting a great example..)

Thanks all!

I do want to tackle this but not sure how yet. Looking at using `pyosmium` or perhaps interfacing with `Shapely` (which could potentially simplify other aspects as well -- reducing the code needed to support output formats but instead relegating that to `Shapely`. Pinging a few experts! @lonvia @pnorman @iandees @tbolender I am still more than happy to work on the current PR as well, but it has gotten stale and it would need to be manually merged. The reason I didn't merge it at the time was mainly that the code was just really hard to read. Also I would love some unit tests for it. (Test coverage is abysmal anyway so I am not setting a great example..) Thanks all!
pnorman commented 2018年09月14日 01:56:49 +02:00 (Migrated from github.com)
Copy link

I haven't researched this issue in detail, so I'm not up on exactly what's wanted.

pyosmium is a great option if you want to convert OSM data into WKB, or some other OCG geometry. That doesn't seem to be what this library is doing. Software using the result from this library may want to do stuff like turn ways into geometries, create area objects, etc.

I haven't researched this issue in detail, so I'm not up on exactly what's wanted. pyosmium is a great option if you want to convert OSM data into WKB, or some other OCG geometry. That doesn't seem to be what this library is doing. Software using the *result* from this library may want to do stuff like turn ways into geometries, create area objects, etc.
hbruch commented 2019年05月02日 00:02:26 +02:00 (Migrated from github.com)
Copy link

Perhaps it would be an option to integrate @tommyjcarpenter’s osmtogeojson? While still in an early stage, it has some relation support. And of course, some more test coverage would be required as well....

Perhaps it would be an option to integrate @tommyjcarpenter’s osmtogeojson? While still in an early stage, it has some relation support. And of course, some more test coverage would be required as well....

Still relevant for 0.8. Marking as geojson + help wanted. If you have a minimal example of a relation that should round-trip to GeoJSON, please add it.

Still relevant for 0.8. Marking as geojson + help wanted. If you have a minimal example of a relation that should round-trip to GeoJSON, please add it.

together with #181 we will not pick this up until after 1.0 has shipped.

together with #181 we will not pick this up until after 1.0 has shipped.
mvexel added this to the v1.x milestone 2026年05月04日 01:47:57 +02:00
Sign in to join this conversation.
No Branch/Tag specified
main
tutorial/d1-httpx-nvim
0.8.x
dev-contributor-tooling
1.0-dev
dev
feature/api-modernization
maintenance/base-0.8
maintenance/geojson-fixtures
archive/async-models
maintenance/endpoint-guard
maintenance/live-query-tool
maintenance/modernize-plan
archive/dev-prebaseline-20260502
archive/modernize
archive/chore-tests
chore/poetry
archive/readme
v0.8.2
v0.8.1
v0.8.0
v0.7.2
0.7.1
0.7.0
0.6.1
0.6.0
0.5.7
0.5.6
0.5.5
0.4.0
0.1.0
0.0.2
0.0.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mvexel/overpass-api-python-wrapper#48
Reference in a new issue
mvexel/overpass-api-python-wrapper
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?