Here's the problem:
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)
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
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?
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..
Best Answer