[GIS] Adjusting polygons to boundary and filling holes

polygonpostgis

Here's the problem:
enter image description here

Where:

1: department boundary

3: polygons inside department boundary that "touch" the department boundary(1). They are not necessary fitting well inside

2: holes between 1 and 3

I need to "adjust" polygon shapes (3) to "match" department boundary (1) filling the holes (2)


Using PostGIS:

My 1st approach was to get the st_pointonsurface of all numbers 2 and number 3 by departments. Then assign the holes (2) to the nearest polygon by pointonsurfaces between each other.

See image (from another department boundary but same problem, exceeding dotted lines with no fillcolor are polygons zones that exceeded department boundary that I've already cut off by department boundary so no problem there)

enter image description here

This worked but got me another problem::

  • some (lots of) holes (2) that where attached to the nearest polygon (by st_pointonsurface) were really long lines

enter image description here

Here (2) are the holes that were attached to the nearest polygon, and the result is 'strange' new polygons with really long lines.


I can use any of ArcGIS 10, Quantum GIS and PostGIS to solve this, but I can't get a way to solve this.


EDIT

How about using topology? what rules may be useful for this problem?

enter image description here

How topology will resolve when multiple polygons are fighting to get the same hole?


EDIT 2

Using geometry approach with PostGIS.

one idea:
– make buffers of the multiple polygons that are inside the department boundary
– get the st_intersection between buffered polygon vs original polygon + hole. This way the new "buffered" polygon only keep the buffer where the "hole"-intersected-area is touched.

  • This may work with simple examples .. but with real world holes and polygons..
  • This will leave us another problem: the overlaps between different buffered polygons inside hole areas..

enter image description here

Best Answer

  1. Use ST_DumpPoints to get a set of vertices for each polygon in 3.
  2. From that construct Voronoi Polygons around your vertices
  3. Dissolve the Voronois by grouping
  4. Clip the resulting shapes with your department boundary.