Forrest logo
back to the ogrinfo tool

ogrinfo:tldr:80191

ogrinfo: Show detailed information of features matching a condition.
$ ogrinfo -where '${attribute_name > 42}' ${path-to-input-gpkg} ${layer_name}
try on your machine

The command you provided is using the "ogrinfo" utility, which is a command-line tool for inspecting and querying geospatial data. Here's the breakdown of the command:

  • "ogrinfo": This is the command itself, the tool you are running.

  • "-where '${attribute_name > 42}'": This option is used to specify a filter or condition for querying the data. In this case, it is filtering records based on a condition. The condition is defined as "${attribute_name > 42}", where "attribute_name" is the name of the attribute in the dataset, and "> 42" is the condition that the attribute value should be greater than 42.

  • "${path-to-input-gpkg}": This is the path to the input GeoPackage file that you want to query. You need to replace "${path-to-input-gpkg}" with the actual path to the GeoPackage file on your system.

  • "${layer_name}": This is the name of the layer or table within the GeoPackage that you want to query. You need to replace "${layer_name}" with the actual name of the layer or table you want to inspect.

When you run this command, ogrinfo will connect to the specified GeoPackage file, and apply the filter condition "-where '${attribute_name > 42}'" to retrieve only the records that meet this criteria from the specified layer or table. The resulting information will be displayed in the command-line output.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the ogrinfo tool