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

Features.within() segfaults for empty/invalid areas #28

Closed
osmuser63783 opened this issue Dec 29, 2023 · 4 comments
Closed

Features.within() segfaults for empty/invalid areas #28

osmuser63783 opened this issue Dec 29, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@osmuser63783
Copy link

from geodesk import *
planet = Features("/mnt/raid1/geodesk/planet-new.gol")
islands = planet("a[place=island,islet]")
for outer_island in islands:
    inner_islands = islands.within(outer_island)
Segmentation fault (core dumped)

This appears to be related to passing a multipolygon to "within": it does not happen when I limit the outer islands to be ways only (islands = planet("a[place=island,islet]").ways).

I am running geodesk 0.1.0. My "planet" was created using gol-tool 0.1.9.

@clarisma
Copy link
Owner

I haven't been able to reproduce this (with a recent planet and one from a year ago).
Could you please add this print statement and tell me at which feature the crash occurs?

for outer_island in islands:
   print(f"Checking island: {outer_island}")
   inner_islands = islands.within(outer_island)

Thanks!

@osmuser63783
Copy link
Author

It happens with https://openstreetmap.org/relation/15441662 and also with https://openstreetmap.org/relation/15763992.

These are multipolygon relations that have relations as members, which they shouldn't... what fun!

By the way, I tried #18 again and it's not working, even though I'm sure I built a new GOL file. I'm going to build a new one and report back, just to be sure.

The PBF file I used was https://planet.openstreetmap.org/pbf/planet-231120.osm.pbf

@clarisma clarisma changed the title Segmentation fault with within() Features.within() segfaults for empty/invalid areas Dec 30, 2023
@clarisma
Copy link
Owner

Thanks, very helpful, this narrows down the issue. The crash occurs during filter construction whenever an area is empty/invalid.

@clarisma clarisma added the bug Something isn't working label Dec 30, 2023
@osmuser63783
Copy link
Author

Can confirm this is still an issue with 0.1.2 and a new GOL, whereas #18 is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants