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

Fix exception while requesting specific broken multipolygons #231

Merged
merged 1 commit into from
May 11, 2020

Conversation

tyrasd
Copy link
Member

@tyrasd tyrasd commented May 6, 2020

Makes building of broken multipolygon objects' geometries more robust by asserting that buffered invalid outers are actual polygons.

Some (rare?) invalid OSM geometries cannot simply be cleaned with the buffer(0) trick. This then results in ClassCastExceptions in requests like https://api.ohsome.org/v0.9/elements/area?bboxes=140.1010943%2C35.2697236%2C140.1800585%2C35.3308109&format=json&keys=natural&showMetadata=false&time=2018-01-01%2F2020-01-01%2FP1M&types=relation&values=wood.

This fix just removes these invalid geometry parts of the affected multipolygons.

Changes proposed in this pull request:

Type of change

Please delete if not relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

Makes building of multipolygon geometries more robust:

Some (rare?) invalid geometries cannot simply be cleaned with the buffer(0) trick. This then results in ClassCastExceptions.

This fix just removes these invalid geometry parts of the affected multipolygons.
@tyrasd tyrasd added the bug Something isn't working as expected label May 6, 2020
Copy link
Member

@rtroilo rtroilo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@tyrasd tyrasd merged commit 5e2beb7 into master May 11, 2020
@tyrasd tyrasd deleted the fix-multipolygon-invalid-outers-fallback branch May 11, 2020 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants