GIScience / GIScience/openpoiservice

Multipolygon overlapping issue

Open
#69 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
199
Forks
25
PR merge metrics
No merged PRs in 30d

Description

MultiPolygon doesn't support overlapping polygons:
explained [here](https://gis.stackexchange.com/questions/247923/overlapping-polygon-becoming-hole-when-converting-geojson-to-shapefile)
[official doc info](https://shapely.readthedocs.io/en/latest/manual.html#MultiPolygon)

Said in OCJ standard for MultiPolygon features :
[Downloadable PDF](https://portal.opengeospatial.org/files/?artifact_id=829) on page 22
>2.1.12 MultiPolygon
>A MultiPolygon is a MultiSurface whose elements are Polygons..
>The assertions for MultiPolygons are :
>1. The interiors of 2 Polygons that are elements of a MultiPolygon may not intersect.
>∀ M ∈ MultiPolygon, ∀ Pi, Pj ∈ M.Geometries(), i≠j, Interior(Pi) ∩ Interior(Pj) = ∅
>2. The Boundaries of any 2 Polygons that are elements of a MultiPolygon may not ‘cross’ and >may touch
>at only a finite number of points. (Note that crossing is prevented by assertion 1 above).
>∀ M ∈ MultiPolygon, ∀ Pi, Pj ∈ M.Geometries(), ∀ ci ∈ Pi.Boundaries(), cj ∈ Pj.Boundaries()
>ci ∩ cj = {p1, ….., pk | pi ∈ Point, 1 <= i <= k}
>3. A MultiPolygon is defined as topologically closed.
>4. A MultiPolygon may not have cut lines, spikes or punctures, a MultiPolygon is a Regular, >Closed point
>set:
>∀ M ∈ MultiPolygon, M = Closure(Interior(M))
>5. The interior of a MultiPolygon with more than 1 Polygon is not connected, the number of >connected
>components of the interior of a MultiPolygon is equal to the number of Polygons in the >MultiPolygon

This issue happens as I try to merge Polygons into a single MultiPolygon. That way I make one request and have multiple responses. As I make lots of requests, this hackish way allows me to reduce the number of requests thus gaining process time.

I would suggest to keep it like that to respect OCJ standard, but maybe add support for an official ‘multi-params’ support.
I would guess that support would be allowed by taking an array as parameter instead of a single object.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the linked Shapely documentation and OGC MultiPolygon specification to confirm the validity constraints described. Then locate the API request handling and tests for polygon inputs; done should mean overlapping polygons are handled according to the chosen behavior and array-based multi-parameter support is defined and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.