I'm no GIS expert and I hope I can explain my problem in English.
I have these polygons – and a border. Sometimes I need this exact definition of the polygons but if you want to have an overview map, it will look much better, if the polygons are expanded and there is no empty space between.
My idea was to use a Voronoi diagram to fill the empty spaces. I cut to original the Voronoi diagram with polygons, then I cut every polygon that is outside the border. In this step, I had quite a lot problems but, after some tries I got a very good result by using the point on surface function to check if the polygon is outside the border.
But I'm stuck in the next step – join the original polygons with the new created.
I try to use several PostGIS functions, sometimes combined. Base function that I used is st_union. I combined it with st_buffer and ST_SnapToGrid or st_simplyfiy and st_makevalid because I read that this gives good results.
But I have some of these errors in it (see picture) and as a result I need exact one polygon. Most of the results are multi-polygons.
I even try a PostGIStopology example, but I don’t get it working. I try to script something in PHP to merge/join the polygon.
Some of them even complex one are exactly what if want but a lot of them don’t find the correct next neighbor point and the direction of the line is wrong on some parts.
Then I try something else more drastic ^^ I use st_union to merge the polygons as good as possible. To get only one polygon filter all polygon by the area and only use the biggest one corresponding to the original polygons. That one often have some wired line on the surface. I export the polygon with st_astext and spilt then by the brackets inside and also use the biggest one. The result is okay in higher zoom level, but if you zoom in use the white not used space.
Do you have any other ideas? At the moment, I use QGIS to visualize the output and I see that QGIS has a lot of function that may be able to do what I want (but I don’t know if it’s scriptable even if it looks like it can do that).
Note: Sorry I have to delete some images, because I'm just allowed to link two images