0

I would like to use GeoPackage as the default format for a project at work. The only issue is non-gis user prefer shapefile because they can drag-n-drop the .dbf in a spreadsheet and immediately use the data (which is undeniably convenient).

Is there a simple way to import data from a GeoPackage in spreadsheet (Calc or Excel)?

I know it's possible to export as CSV from SIG, but that's extra steps and maintenance, which puts shapefile as the better option.

From my testing, this method does not work on GeoPackage file. I tried in LibreOffice Calc and Excel with encoding UTF-8 and Latin-3

Edit : the .dbf is a copie of the original so it is not a problem to use it like that.

3
  • 1
    Try: geeksforgeeks.org/connecting-excel-to-sqlite
    – Bera
    Commented May 31 at 9:19
  • 4
    It's bad practice to open and modify shapefile DBF in a spreadsheet as it's really easy to corrupt the shapefile (the link between the attribute and the geometry are based on record order so simply reordering the .dbf will cause problem as well as adding or removing a line...). If your user insist doing that made it clear that there is a strong risk and that they should always made a backup copy before editing...
    – J.R
    Commented May 31 at 9:31
  • You are right. The .dbf are copied so as to not destroy the geo-data. I will try the connection sqlite to excel because this is the kind of answer I am looking into.
    – MesanGeo
    Commented Jun 1 at 15:58

2 Answers 2

1

Obviously in your use case the .dbf data are used as read-only, because if your users edit and save the edits back to the original shapefile they were likely corrupt the shapefile by the same. I do not believe that you have decided to use so dangerous workflow.

You can get effectively similar read-only access to the attribute data of GeoPackage by copying attributes into Excel format with ogr2ogr

ogr2ogr -f "xlsx" my_layer_attributes.xlsx my_geopackage.gpkg my_layer
1
  • You are right. The .dbf are copied for uses from the non-gis user. I will try your answer even tho it is still extra steps for the user not familiar with gis.
    – MesanGeo
    Commented Jun 1 at 15:56
0

It seems like "Export as spreadsheet" with the geopackage is the simpliest way. Creating a .bat with the formula proposed above can work too.

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.