I'm trying to buffer a polyline (WGS84/EPSG 4326) by 50km, and then dissolve all the overlaps in the buffer. So far I've tried a combination of:
- casting the EPSG 4326 geometry as geography (to get accurate buffer) then
- creating a dissolved buffer using ST_union(ST_buffer(geo.my_polyline)).
However, I'm getting a syntax error around my CAST
close-parenthesis: ERROR: syntax error at or near ")"
Here is my code:
create table geo.fifty_km_buffer as (
select id, ST_union(ST_buffer(
CAST(geo.polyline.geom) as geography,
50000
)) as geom
from geo.polyline
)
ST_union
results in overlapping polygons which should be dissolved, as described in the second question I linked to.