2

I think this is a really silly question, yet I can't solve it quickly now:

I want to work with this rather large geopackage: https://data.statistik.gv.at/data/OGDEXT_RASTER_1_STATISTIK_AUSTRIA_LAEA_GPKG.zip

Besides not being really sure how to handle such a big geopackage, I (for now) just want to know the columnames. And the columnnames I just want to know to count the rows using this ogrinfo call:

ogrinfo -dialect sqlite -sql "select count(cellcode) as num_cellcode" STATISTIK_AUSTRIA_RASTER_LAEA_3035.gpkg

However, it throws me the error:

INFO: Open of `STATISTIK_AUSTRIA_RASTER_LAEA_3035.gpkg'
      using driver `GPKG' successful.
ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(select count(code_sdmx) as num_cellcode):
  no such column: code_sdmx

I used the name cellcode as the command: ogrinfo -al STATISTIK_AUSTRIA_RASTER_LAEA_3035.gpkg lists the following:

OGRFeature(l000100):12943
  cellcode (String) = 100mN27263E47266
  code_sdmx (String) = AT_CRS3035RES100mN2726300E4726600
  code_su (String) = CRS3035RES100mN2726300E4726600
  POLYGON ((4726600 2726300,4726600 2726400,4726700 2726400,4726700 2726300,4726600 2726300))

So my question would be how to get the littel sql-query to run and count the number of rows.

1 Answer 1

3

This GeoPackage contains multiple layers. If you want the count from the l000100 layer, this would be your command:

ogrinfo -dialect sqlite -sql "select count(cellcode) as num_cellcode from l000100" STATISTIK_AUSTRIA_RASTER_LAEA_3035.gpkg
2
  • thanks!! I missed that there are multiple layers...
    – Lenn
    Jun 28 at 14:40
  • You're welcome! Jun 29 at 7:53

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.