postgis - How to expand a polygon to reach a nearby line -
i expand polygon fills empty space between , nearby (and touching in 2 points) line, in the image posted here. can see blue linestring makes empty space on top of pink polygon , want fill polygon. there postgis solution ? havent' found "easy" way.
thanks !
the solution similar 1 presented here. in case need buff linestring bit.
with p ( select st_makepolygon(st_geomfromtext('linestring(0 0,1 0,1 1, 0 1, 0 0)')) geo ), l ( select st_buffer(st_geomfromtext('linestring(0.0 0.0,0.5 0, 0.7 -1, 1 0)'),0.000000000000001) geo ), bigpoly as( select st_union(geo) geom from( select geo p union select geo l) q ) select st_buffer(st_buildarea(st_interiorringn(geom,i)),0.000000000000001) geo bigpoly cross join generate_series(1,(select st_numinteriorrings(geom) bigpoly))
this give missing piece, need st_union rest, might want check if it's correct 1 if original polygon contains holes.
Comments
Post a Comment