Based on an irregular distribution of points (longitude,latitude), I obtained the convex hull below (I use saga_cmd with polygon convexity in 1). Would you have a way to create a convex hull that closely follows this irregular shape using one-liner commands or similar? I call commands from a bash terminal in Linux.
ST_ConcaveHullyou may get the envelope to follow more closely the irregular shape, as stated in your post;
ogr2ogr -f GPKG concave.gpkg points.gpkg -nln concave_layer -dialect sqlite -sql "select 'a', ST_ConcaveHull(st_collect(geometry),0.9) from points_layer"
A few remarks:
You are using a point layer, so if you call
st_concave_hulldirectly on your geometry it will try to make a polygon for each point, which will return empty geometries, so first we call
The layer name in the sql query can be retrieved with
ogrinfo file.gpkg, it is often not the same name as the layer.
For some functions to work in ogr2ogr you need a non-geometry field, that's why I passed
'a'to the command, here it works without it.
It is an expensive algorithm, to test it you may use a subset of your layer passing
where fid < 1000to the query