-1

My original geodata is a linear object representing a road network.

When I run the ST_Buffer geo tool with the setting 'endcap=flat join=round'

I will learn the result as in the figure 1 below:

enter image description here

When I run the setting with 'endcap=round join=round' I get the result as in the figure below figure 2

enter image description here

Question: How do I get a result with a continuous edge as shown in the figure below figure 3

enter image description here

Cyril Mikhalchenko
  • 4,397
  • 7
  • 14
  • 45
  • 4
    Your question doesn't have a question. – Vince Jan 18 '19 at 00:50
  • 1
    So your Answers aren't answers and the Q and two As are just one big code-this-for-me request? I can't vote to reopen that. – Vince Jan 18 '19 at 11:01
  • 1
    Cyril you should only have 1 question and 1 correct answer (you can answer your own question but you seem to be treating GIS>SE as thread based tool - it is not is a question with one correct answer tool) – Mapperz Jan 18 '19 at 15:05

1 Answers1

1

Method is a SQL script, using https://gis.stackexchange.com/a/250496/120129, author for which part of its implementation.

  1. Create lines of approximately equal length from lines, the line must be ordered;
  2. Run the script:
WITH
tblb AS (SELECT id, ST_Buffer ((geom), 0.0001,'endcap=round join=round') as geom FROM <name_table>),
tblc_l AS (SELECT a.id, ST_LineMerge(ST_Difference(ST_ExteriorRing(a.geom), b.geom)) geom FROM tblb a LEFT JOIN tblb b ON (ST_Intersects(a.geom, b.geom) AND a.id < b.id)),
tblcpoly_l AS (SELECT id, ST_MakePolygon(ST_AddPoint(geom, ST_StartPoint(geom))) geom FROM tblc_l),
tbld_r AS (SELECT a.id, ST_LineMerge(ST_Difference(ST_ExteriorRing(a.geom), b.geom)) geom FROM tblb a LEFT JOIN tblb b ON (ST_Intersects(a.geom, b.geom) AND a.id > b.id)),
tbldpoly_r AS (SELECT id, ST_MakePolygon(ST_AddPoint(geom, ST_StartPoint(geom))) geom FROM tbld_r)
SELECT ST_Intersection(a.geom, b.geom) as geom FROM tblcpoly_l a, tbldpoly_r b
WHERE ST_Intersects (a.geom, b.geom) AND a.id=b.id;
  1. See the picture

enter image description here

Good luck to everyone :-),

Original solutions ...

This script is called - ST_BambooBuffer...

Cyril Mikhalchenko
  • 4,397
  • 7
  • 14
  • 45