# Algorithm to fill the gaps adjacent to parcels

I would like to find a way to fill the gaps between the road and its surrounding parcels, like described in picture below:

I have different parcels like A and B , i want to fill the gaps by adding the gap area to the adjacent parcel, the gap should be determined by the lines of the parcels which intersects the ROAD.

The final parcel B = (old) B + D , A = (old) A + C

I would like to find an algorithm to do this process.

I thought to make this algo :

• Make a convex hull around ROADS and Parcels.
• Get lines from the result layer and apply a tool like Extend line, but the constraint is that the lines would not be extended because they are already limited by parcel lines.

I'm not keen to follow this algorithm, i'm looking for any suggestions.

I'm using Arcpy in Arcgis 10.1, Arcobjects. • Of the lines which border polygons A and B, how would you determine the ones that need to be extended? Would you perhaps determine first the polygon vertices within a specifed distance of a road polygon and then try extending each line that starts/ends with those vertices. The two which require the shortest extension to reach the road polygon might be the two you actually extend. – PolyGeo Aug 17 '12 at 6:00
• To emphasize the comment by @PolyGeo: Generically, most line segments in any parcel, when extended, will meet the road somewhere. In the picture, two of the red segments are not even extensions of any segments in either parcel. So it sounds and looks like you have in mind some essential additional criteria that have not yet been expressed in this question. A better characterization of the data would help, too: this problem has better, simpler solutions when you have an exhaustive set of parcels covering the region around the road than when the parcels are scattered around. – whuber Aug 17 '12 at 13:15
• yes i see that there's a sub problem to determine which segment should be extended to the road , this is a problem too. but in the picture the RED segments , are extensions of their adjacent parcel segments. – geogeek Aug 17 '12 at 15:52

Assuming that the convex hull idea doesn't pan out, what about something like this:

1. convert the polygon vertices to points
2. convert the polygon to lines
3. split each line at each vertex (so you have line segments)
4. calculate the distance and angle of each vertex to the road
5. for each polygon, find the closest point (aka vertex) to the road
6. select the lines which touch that point, and find the line that has the same orientation angle as the closest point
• if there is a suitable line, this is a line which you should extend
• if there isn't a suitable line, you've selected a midpoint vertex which shouldn't be extended (such a vertex exists near the D in your diagram)
7. extend the line to the road, by adding a new vertex at the point which intersects the road
8. repeat for the second vertex, until you have processed two vertices per polygon
9. delete the unwanted segment of the line (which is coincident with the two vertices found above)
10. using a copy of the road layer, split the associated road line at the location of the extend lines