'How to only buffer outside of the polygon and leave the shared edge un-buffered?
What I am trying to achieve is to buffer a set of connecting polygons while leaving the shared edges un-buffered.
After some searching, ArcGIS's buffer wizards + dissolve does exactly that but unfortunately without an Arcgis license I am searching for a solution that uses QGIS or other platforms such as PostGIS.
The image below shows the result using ArcGIS's buffer wizards + dissolve
Desired Result:
The main challenge is to cut the overlaps from two adjacent buffers into two disjoint polygons along a line equidistant to the unbuffered polygons.
Adding an modified image from JFK to elaborate on my desired result with an example, black shaded polygons are the original polygon, and polygon A and B are the seperate buffered polygons that has three buffered sides, and one un-buffered side (the side where A, B touches)
Solution 1:[1]
The doc says the wizard starts by dissolving the polygons, then a buffer is applied on the output.
You can do the same in PostGIS: st_collect
aggregates the geometries together, creating a multi-polygon if geometries are disjoint. st_buffer
does the buffering (in CRS unit), st_dump
will explode the single multi-part buffer into individual polygons.
WITH src(geom) AS (values
('POLYGON((0 0,0 10,10 10, 10 0, 0 0))'::geometry),
('POLYGON((0 0,0 10,-10 10, -10 0, 0 0))'::geometry),
('POLYGON((20 20,20 30,30 30, 30 20, 20 20))'::geometry))
SELECT st_asText(
(st_dump(
st_buffer(
st_collect(geom),
1)
)).geom)
FROM src;
---------
POLYGON((20 19,19.8049096779839 19.0192147195968,19.6173165676349 19.0761204674887,19.4444297669804 19.1685303876975,19.2928932188135 19.2928932188135,19.1685303876975 19.4444297669804,19.0761204674887 19.6173165676349,19.0192147195968 19.8049096779839,19 20,19 30,19.0192147195968 30.1950903220161,19.0761204674887 30.3826834323651,19.1685303876975 30.5555702330196,19.2928932188135 30.7071067811865,19.4444297669804 30.8314696123025,19.6173165676349 30.9238795325113,19.8049096779839 30.9807852804032,20 31,30 31,30.1950903220161 30.9807852804032,30.3826834323651 30.9238795325113,30.5555702330196 30.8314696123025,30.7071067811865 30.7071067811865,30.8314696123025 30.5555702330196,30.9238795325113 30.3826834323651,30.9807852804032 30.1950903220161,31 30,31 20,30.9807852804032 19.8049096779839,30.9238795325113 19.6173165676349,30.8314696123025 19.4444297669804,30.7071067811865 19.2928932188135,30.5555702330196 19.1685303876975,30.3826834323651 19.0761204674887,30.1950903220161 19.0192147195968,30 19,20 19))
POLYGON((0 -1,-10 -1,-10.1950903220161 -0.980785280403231,-10.3826834323651 -0.923879532511287,-10.5555702330196 -0.831469612302547,-10.7071067811865 -0.70710678118655,-10.8314696123025 -0.555570233019605,-10.9238795325113 -0.382683432365094,-10.9807852804032 -0.195090322016134,-11 0,-11 10,-10.9807852804032 10.1950903220161,-10.9238795325113 10.3826834323651,-10.8314696123025 10.5555702330196,-10.7071067811865 10.7071067811865,-10.5555702330196 10.8314696123025,-10.3826834323651 10.9238795325113,-10.1950903220161 10.9807852804032,-10 11,0 11,10 11,10.1950903220161 10.9807852804032,10.3826834323651 10.9238795325113,10.5555702330196 10.8314696123025,10.7071067811865 10.7071067811865,10.8314696123025 10.5555702330196,10.9238795325113 10.3826834323651,10.9807852804032 10.1950903220161,11 10,11 0,10.9807852804032 -0.195090322016128,10.9238795325113 -0.38268343236509,10.8314696123025 -0.555570233019602,10.7071067811865 -0.707106781186547,10.5555702330196 -0.831469612302545,10.3826834323651 -0.923879532511287,10.1950903220161 -0.98078528040323,10 -1,0 -1))
(2 rows)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | JGH |