Skip to content
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

Cannot build geometry for a relation. #27

Closed
johnaschmidt opened this issue Nov 12, 2020 · 5 comments
Closed

Cannot build geometry for a relation. #27

johnaschmidt opened this issue Nov 12, 2020 · 5 comments

Comments

@johnaschmidt
Copy link

With the following:

from OSMPythonTools.overpass import Overpass

op = Overpass()
q = 'relation(110796); out body;'
r = op.query(q)
e = r.elements()[0]
e.geometry()

I get the following:

Exception: [OSMPythonTools.Element] Cannot build geometry: cannot find outer ring for inner ring. (relation/110796)

@BenConstable9
Copy link

I've also got this issue. Did you manage to fix it / find a way past it?

@johnaschmidt
Copy link
Author

johnaschmidt commented Jan 19, 2021 via email

@mocnik-science
Copy link
Owner

Dear John, Dear Ben,

I have no solution either, and I did not yet have the time to investigate this in depth. The algorithm I use is a common one and should work. Someone (could be me or someone else) would need to investigate whether there is some issue with the geometry (OSM data contains illegal geometries) or whether this is an issue with the algorithm itself. As I am quite busy, I will not be able to solve this but in a month or so. I hope for your understanding that I do not have the time to solve this now. ;(

Franz-Benjamin

@BenConstable9
Copy link

Hi, I don't have a fix. I ended up using osmx to download the geometry in question when I ran into the issue. I am wondering about if a possible solution might be to use the plotly library for sections of this library. The geometry in question was typically very complicated with multiple inner and outer boundaries. John

On Tue, Jan 19, 2021, 5:24 AM Ben Constable @.***> wrote: I've also got this issue. Did you manage to fix it / find a way past it? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#27 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACPUPHJBGWCFOE6EO5CS2XTS2V2WBANCNFSM4TSZWA2A .

Thank you for this, I shall try OSMX and see if I can solve my issue through this.

Dear John, Dear Ben,

I have no solution either, and I did not yet have the time to investigate this in depth. The algorithm I use is a common one and should work. Someone (could be me or someone else) would need to investigate whether there is some issue with the geometry (OSM data contains illegal geometries) or whether this is an issue with the algorithm itself. As I am quite busy, I will not be able to solve this but in a month or so. I hope for your understanding that I do not have the time to solve this now. ;(

Franz-Benjamin

No problem about not having the time to solve this issue but thank you for the reply. Could it be to do with the fact that the geometry I am downloading is a series of lines rather than a shape? I came into this issue when downloading a transit route from OpenStreetMap.

@mocnik-science
Copy link
Owner

Hi again,
It took me some time to understand the issue. I ask for your understanding that it took quite a while, but now it should work again. Maybe, you have already been successful with using OSMNX. Otherwise, feel welcome to test again. The fix is in e5bcc83 and will be made available as part of Version 0.3.0 in some hours.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants