Changes between Version 3 and Version 4 of UserWikiVariableBuffer
- Timestamp:
- 11/25/19 11:06:17 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UserWikiVariableBuffer
v3 v4 4 4 5 5 The function below generates variable-distance buffers. 6 6 7 It operates by creating the union of a series of segment buffers . 7 8 Each segment buffer is the convex hull of the buffers of the segment start and end points, 8 9 with the buffer distance computed proportionally to the fractional distance along the line. 9 10 10 **Note: currently only the end distance can be given. The start distance is fixed to be (approximately) 0.**11 12 11 === Example === 13 12 {{{ 14 SELECT ST_VariableBufferFromLine( 'LINESTRING( 0 0, 100 0)' , 1 0 );13 SELECT ST_VariableBufferFromLine( 'LINESTRING( 0 0, 100 0)' , 1, 10 ); 15 14 }}} 16 15 … … 19 18 CREATE OR REPLACE FUNCTION ST_VariableBufferFromLine( 20 19 geom GEOMETRY, 20 start_dist NUMERIC, 21 21 end_dist NUMERIC 22 22 ) … … 31 31 (SELECT (dump).path[1], 32 32 ST_Buffer( (dump).geom, 33 GREATEST(end_dist * ST_LineLocatePoint(geom, (dump).geom), 0.001)) AS geom 33 start_dist + (end_dist - start_dist) * ST_LineLocatePoint(geom, (dump).geom) 34 ) AS geom 34 35 FROM step1), 35 36 step3 AS