1

I know how to make a buffer around each point,

$ ogr2ogr oom.csv a1.houses.csv -lco GEOMETRY=AS_WKT -dialect SQLITE -sql \
"SELECT ST_Buffer(GEOMETRY,.01,1) AS WKT FROM 'a1.houses'"
$ cat oom.csv
WKT
"POLYGON ((120.83444...
"POLYGON ((120.81399...
...

How do I instead make one buffer, containing all the points? I.e., the output file should contain just a single POLYGON.

2

1 Answer 1

1

Using the ST_Union tip in the comments, we achieve the answer, and then go on to make a KML.

$ ogr2ogr houses.buf.csv a1.houses.csv \
-lco GEOMETRY=AS_WKT -dialect SQLITE -sql \
"SELECT ST_Buffer(ST_Union(GEOMETRY),.001,1)
 AS WKT, 1 AS Name FROM 'a1.houses'"
$ ogr2ogr houses.buf.kml houses.buf.csv -sql \
'SELECT Name FROM "houses.buf"' -f LIBKML

Not the answer you're looking for? Browse other questions tagged or ask your own question.