GIScience / openpoiservice

:round_pushpin: Openpoiservice is a flask application which hosts a highly customizable points of interest database derived from OpenStreetMap data.
https://openrouteservice.org
Apache License 2.0
173 stars 22 forks source link

Multipolygon overlapping issue #69

Open zephylac opened 5 years ago

zephylac commented 5 years ago

MultiPolygon doesn't support overlapping polygons:
explained here
official doc info

Said in OCJ standard for MultiPolygon features : Downloadable PDF 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.

TimMcCauley commented 5 years ago

@zephylac sorry for being very dormant lately. This approach with multi-params sounds just fine