2

I'm using a shapefile from Statistics Canada, available here. This file maps Forward Sortation Areas (FSAs), which are the leading three characters of a Canadian postal code. When I try to add a new field, I cannot truly save it, as QGIS freezes up on me. When I open the file again, while most entries were saved, rows for territorial FSAs (CFSAUID starting with X or Y) are null. I've tried QGIS versions starting with QGIS 2 and I am up to 3.22.4 LTR Białowieża, with the same behaviour.

My minimum working example has been to create a new field with the field calculator to return a 1 for LANDAREA>5000 and 0 otherwise. Then, I try saving the attribute table with the freeze up and incomplete results as described above.

Is the operation invalid somehow, is there an issue with the shape file, or something else? I'm at a loss now.

11
  • 1
    Please add your function so it can be just copy-pasted. Some of us are lazy.
    – user30184
    Commented Nov 28, 2022 at 16:50
  • 1
    user30184: I can equally reproduce this by setting whole field to 1, the specific function used isn't the key part.
    – Pager85
    Commented Nov 28, 2022 at 17:01
  • 2
    I would recommend to try exporting the layer as a GeoPackage table and work with that instead. Shapefiles are outdated and have many limitations.
    – Matt
    Commented Nov 28, 2022 at 17:02
  • 2
    This is a side effect of working with the "cartographic" dataset, as every tiny island is represented by a polygon part. That is, about 90% of the polygons are fairly simple single parts, and a few of them are extremely complex with thousands of parts for some of them, like in the great North.
    – JGH
    Commented Nov 28, 2022 at 19:08
  • 2
    If you don't mind having the FSA boundaries covering the water, you can use the "digital" dataset which is much smaller and simpler.
    – JGH
    Commented Nov 28, 2022 at 19:08

1 Answer 1

2

Is the attribute table very large? I am guessing so as your file is 269 MB, which is starting to get pretty big for a shapefile. My computer fan kicked on when I opened it and I have a very capable machine.

In all likelihood your computer does not have enough RAM to allow QGIS to store that much data at once, so it basically crashes when you try to make edits to it and it has to read it all into memory. One thing you should try is to press save and then leave your computer for a while - sometimes QGIS can manage the task but not while multiple things are going on. It may help to close all other programs if you can.

Otherwise, you're going to have to start looking into workarounds and other potential methods (python, block-reading), but we can come back to this if the above doesn't work.

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.