How can I pack polygons without empty places and intersections? Please tell me everything that might help me (API, algorithms, etc.)

I'm using:

  • USPS API to get carrier routes.
  • dbscan.js to generate clusters from points.
  • hull.js to generate polygons.
  • leaflet to show map

Example (I have):

enter image description here

Example (I need):

enter image description here

  • 1
    Please explain your question: what are the inputs, what operations are allowed on them in "packing," and what exactly do "empty places and intersections" mean? (Ordinarily we would think we know that last one, but your maps show intersections of polygons and they show intersections of streets, making the question ambiguous.) – whuber May 6 '16 at 14:44
  • 1
    I mean that polygons must fill all map and they mustn't intersect each other. – Yurii Kramarenko May 6 '16 at 14:48
  • 1
    @JerylCook I don't finish this project. But I find another api, that return data (carrier routes) in correct format. Unfortunately I can't remember It's name(( – Yurii Kramarenko Jan 17 '19 at 14:46
  • 1
    Thanks @YuriiKramarenko i was able to implement it using "Voronoi" the generated boundaries worked in my case: opendata.stackexchange.com/questions/13777/… – Jeryl Cook Jan 19 '19 at 15:46
  • 1
    @JerylCook g.c. Really good job) – Yurii Kramarenko Jan 28 '19 at 11:01

Instead of creating a convex hull over a set of points with the same attributes, create a Voronoi tesselation of all points, then merge the Voronoi polygons of those points with the same attributes.

There are lots of ways to process the information you may have, and what I just said is one idea on how to do it. Voronoi + merge might create multipolygons, which might not be what you want.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.