algorithm - Combine nearby polygons -


i have pair of (closed) polygons, each defined sequence of points (the vertices). polygons each represent plot of land, separated small river, stream forms narrow gap between 2 polygons.

i'm looking algorithm identify , remove gap, joining 2 polygons 1 connected polygon.

the figure below shows example, original polygons green , red, , resulting polygon shown in yellow.

example

so far, have been able following:

  • for each edge in polygon-a, find nearest vertex in polygon-b.
  • find vertices of polygon-b within distance of polygon-a.

but i'm not sure need now.

you might @ modification of convex hull algorithm. convex hull algorithm takes set of points , draws minimal convex shape containing points. question convex hull question, except concave regions @ top. using convex hull algorithm give this, close, not quite need (note .the brown areas different)

convex hull

depending on you're trying do, convex hull might "good enough", if not, still might able modify algorithm ignore parts non-convex, , simpy merge 2 polygons.

specifically this pdf shows how 2 convex hulls can merged, lot you're trying do.


Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -