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?


1 Answer 1


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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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