I want to clip a vector-layer by another layer with ogr2ogr
as explained here.
I always struggle to find out how to refer to a layer in ogr2ogr
for input and output. Does anyone have a quick tip?
I want to clip a vector-layer by another layer with ogr2ogr
as explained here.
I always struggle to find out how to refer to a layer in ogr2ogr
for input and output. Does anyone have a quick tip?
Based on the ogr2ogr documentation, this should work:
ogr2ogr -clipsrc clip_polygons.gpkg -clipsrclayer clip_polygons_layer -nln output_layer output.gpkg input.gpkg input_layer
-nln
gdal.org/programs/ogr2ogr.html#cmdoption-ogr2ogr-nln is what you want to know about selecting the name of the output layer.