![Forrest logo](/images/logo.png)
ogr2ogr:tldr:309b1
The command "ogr2ogr" is a utility command in GDAL (Geospatial Data Abstraction Library) that is used to convert and transform various geospatial data formats.
In this specific command, the "-spat" option is used to specify a spatial extent or a bounding box. The "min_x" and "min_y" values represent the minimum longitude and latitude coordinates respectively, while the "max_x" and "max_y" values represent the maximum longitude and latitude coordinates respectively. This option is used to subset or filter the input data based on the specified spatial extent.
The "-f" option is used to specify the output format, in this case, "GPKG" which stands for GeoPackage. GeoPackage is an open standard format for storing geospatial data.
The "${path-to-output}.gpkg" represents the output file path and name with the .gpkg extension for the GeoPackage file.
Similarly, the "${path-to-input}.gpkg" represents the input file path and name with the .gpkg extension for the GeoPackage file.
Overall, this command is used to subset or filter the input GeoPackage file based on a specified spatial extent and save the resulting data into a new GeoPackage file. The resulting file will contain only the features that fall within the specified bounding box.