Clip layers of a GeoPackage file to the given bounding box

ogr2ogr

  • Convert geospatial vector data between file formats.
    More information: <https://gdal.org/programs/ogr2ogr.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

ogr2ogr -spat {{min_x}} {{min_y}} {{max_x}} {{max_y}} -f GPKG {{path/to/output}}.gpkg {{path/to/input}}.gpkg

click the source code to copy install ogr2ogr on any operating system with command-not-found.com