2

I have a large geopackage file (15gb) for which I'd like to see the attribute (/field/column) names. Is this possible without loading the whole file?

Edit: It would be ideal if there was a command line tool that allowed you to do this. Something like just seeing the 'head' of the file

3

Use ogrinfo, e.g.:

ogrinfo -so <path/to/file.gpkg> <layer_name>
0

One cumbersome way to do this would be to convert to (something like) geojson using ogr2ogr, and then look at the head of the file. E.g.

ogr2ogr -f "GeoJSON"  <geojson_file_name> <geopackage_file_name>

Then once that's done, look at the top lines:

head -100 <geojson_file_name>

This would show the field names as geojson features.

This did the trick for me, but there's probably a format that would make more sense to convert to than geojson. And a more efficient way of doing things that doesn't require converting the geopackage to something else.

  • You ideally can create a connection to the geopackage and then use DB manager to inspect the table structure. – kartoza-geek Apr 20 at 10:15
0

DBManager in QGIS can connect to the GeoPackage and show data structure as well as preview the data. Layers within the package can also be deleted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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