Skip to content

Pr 7320 - #188

Merged
prabinoid merged 2 commits into
test/aoi-related-prsfrom
pr-7320
Sep 24, 2026
Merged

prabinoid merged 2 commits into
test/aoi-related-prsfrom
pr-7320

Conversation

@prabinoid

Copy link
Copy Markdown

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation
  • 🧑‍💻 Refactor
  • ✅ Test
  • 🤖 Build or CI
  • ❓ Other (please specify)

Related Issue

Example: Fixes #123

Describe this PR

A brief description of how this solves the issue.

Screenshots

Please provide screenshots of the change.

Alternative Approaches Considered

Did you attempt any other approaches that are not documented in code?

Review Guide

Notes for the reviewer. How to test this change?

Checklist before requesting a review

[optional] What gif best describes this PR or how it makes you feel?

dulcetberg and others added 2 commits August 22, 2026 15:11
Fixes hotosm#2285.

GridService._adapt_feature_geometry() only accepted Polygon/MultiPolygon
geometries, silently dropping (returning None) anything else - including
LineStrings. This meant a closed area imported as a LineString (which is
exactly what tools like geojson.io produce when converting a closed .osm
way to GeoJSON) got rejected outright with "The AOI contains geometries
which are not polygons or multipolygons", even though it's unambiguously
a valid area outline.

Now, a LineString whose first and last coordinates match (a closed ring)
and has at least 4 points is converted into a Polygon using the same
coordinates before the existing Polygon/MultiPolygon check runs. An open
LineString (a real path, not a boundary) is still rejected, same as
before - only genuinely closed rings get converted.

Verified against 4 cases directly (couldn't import GridService in
isolation - importing the backend package pulls in its full dependency
tree beyond what this static method needs, same situation as PR hotosm#7319):
- closed LineString -> now converted and accepted as a Polygon
- open LineString -> still correctly rejected
- existing Polygon input -> unchanged
- a degenerate 3-point "closed" ring (below the 4-point minimum) -> still
  correctly rejected

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Brian Bergstrom <dulcetberg@gmail.com>
@prabinoid
prabinoid merged commit efb2e54 into test/aoi-related-prs Sep 24, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants