1

I have a .sqlite dataset, and I want to open it using QGIS, check the data, and plot some color maps. It's a 1 km by 1 km gridded data. When I import the data into QGIS using "add SpatiaLite layer" and zoom in into some regions, at each zoom level, some of the grid cells disappear, and it does not show all the cells, like this: .sqlite data imported and plotted by QGIS

But when I convert the data to GeoPackage format and plot it again, it shows all the grid cells: Converted GeoPackage data plotted by QGIS

What's the problem with showing .sqlite data in QGIS?

1
  • Impossible to say what goes wrong without having test data. Does it happen also if you convert your GeoPackage into a new SpatiaLite db?
    – user30184
    Commented May 3, 2022 at 6:23

1 Answer 1

1

I guess it is beacause a broken spatial index or broken geometries. Most of the time i am able to fix it with recovering the spatial index:

SELECT RecoverSpatialIndex(1);

or recreate the geometries within an update:

UPDATE YOUR_POLYGON_TABLE
SET geom = ST_Buffer(geom, 0)

You can execute this queries in the "Database Manager" in QGIS after you connected your sqlite/spatialite Database.

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.