3

I work on QGIS 3.10.3 and would like to know if it is possible to compress a large vector data (size: 66298KB). The GIS software is still loading every time I touch the mouse.

Is it possible to compress the shapefile in QGIS?

7
  • 2
    67 MB isn't large, but anyway... have you considered changing the visibility settings for the layer? Is there a virtual layer in your project? What kind of tasks do you do that a mere touching of your mouse forces a reload of the data? What specifications does your PC have?
    – Erik
    Commented Oct 13, 2022 at 11:32
  • If you also wish to ask about ArcGIS Pro then please do that in a separate question.
    – PolyGeo
    Commented Oct 13, 2022 at 11:45
  • No, I haven't changed the visibility setting for the layer. I don't have a virtual layer in the project. Only have this layer. When I try to select a line or open the attribute table. It still loading. My PC has 8 GB ram and 2.60 GHz. I have 700 000 records in this layer. So, I suppose it would be normal it takes so much time.
    – GIS Noh
    Commented Oct 13, 2022 at 12:07
  • 1
    Compressing the file would not bring any benefit; on the contrary it could slow you down. I would investigate into splitting the file either spatially (think tiles) or horizontally by feature type/group (for example roads in one layer, buildings into another one, etc) Commented Oct 13, 2022 at 14:41
  • 1
    Is your layer stored on a local hard drive, a cloud drive or a network or some other location that might be slow? Does this happen if you add the layer to a new project all by itself? Is your layer and project in the same coordinate system? Do you have complex symbology or label rules? How many fields are in the table? You might add a spatial index and look at your render settings (multi core & simplified checked?) If you zoom in close does it help a lot? I don't recall QGIS behavior on this but ArcGIS snapping with many vertices could be slow.
    – John
    Commented Oct 13, 2022 at 22:43

2 Answers 2

3

If losing some unnecessary details does not matter, you can reduce the file size of vector files by generalizing the shapes. That means reducing the number of vertices (and thus saving storing capacity).

In QGIS, there are several tools available like Menu Vector > Geometry Tools > Simplify or GRASS v.generalize (see e.g. this example).

There is also a simplify() function in QGIS expressions.

0

Use a Geopackage database. It is better than shapefiles when working with large files.

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.