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

closed as unclear what you're asking by whuber May 6 '16 at 14:44

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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 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 at 15:46
  • 1
    @JerylCook g.c. Really good job) – Yurii Kramarenko Jan 28 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.

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