How can I convert a GeoPackage file into GeoJSON?
ogr2ogr -f GeoJSON out.json BGRI2021_0706.gpkg
returns
$ ogr2ogr -f GeoJSON out.json BGRI2021_0706.gpkg
ERROR 1: database disk image is malformed
FAILURE:
Unable to open datasource `BGRI2021_0706.gpkg' with the following drivers.
-> `FITS'
-> `PCIDSK'
-> `netCDF'
-> `PDS4'
-> `VICAR'
-> `JP2OpenJPEG'
-> `PDF'
-> `MBTiles'
-> `BAG'
-> `EEDA'
-> `OGCAPI'
-> `ESRI Shapefile'
-> `MapInfo File'
-> `UK .NTF'
-> `LVBAG'
-> `OGR_SDTS'
-> `S57'
-> `DGN'
-> `OGR_VRT'
-> `REC'
-> `Memory'
-> `CSV'
-> `NAS'
-> `GML'
-> `GPX'
-> `LIBKML'
-> `KML'
-> `GeoJSON'
-> `GeoJSONSeq'
-> `ESRIJSON'
-> `TopoJSON'
-> `Interlis 1'
-> `Interlis 2'
-> `OGR_GMT'
-> `GPKG'
-> `SQLite'
-> `ODBC'
-> `WAsP'
-> `PGeo'
-> `MSSQLSpatial'
-> `OGR_OGDI'
-> `PostgreSQL'
-> `MySQL'
-> `OpenFileGDB'
-> `DXF'
-> `CAD'
-> `FlatGeobuf'
-> `Geoconcept'
-> `GeoRSS'
-> `GPSTrackMaker'
-> `VFK'
-> `PGDUMP'
-> `OSM'
-> `GPSBabel'
-> `OGR_PDS'
-> `WFS'
-> `OAPIF'
-> `SOSI'
-> `Geomedia'
-> `EDIGEO'
-> `SVG'
-> `CouchDB'
-> `Cloudant'
-> `Idrisi'
-> `ARCGEN'
-> `XLS'
-> `ODS'
-> `XLSX'
-> `Elasticsearch'
-> `Walk'
-> `Carto'
-> `AmigoCloud'
-> `SXF'
-> `Selafin'
-> `JML'
-> `PLSCENES'
-> `CSW'
-> `VDV'
-> `GMLAS'
-> `MVT'
-> `NGW'
-> `MapML'
-> `TIGER'
-> `AVCBin'
-> `AVCE00'
-> `HTTP'
ogr2ogr supports already GeoPackage
$ ogrinfo --formats | grep GPKG
GPKG -raster,vector- (rw+vs): GeoPackage
I am using GDAL 3.3.2, released 2021/09/01