johnpholden / qgis3redistricter

Redistricting for QGIS v3
GNU General Public License v3.0
5 stars 2 forks source link

Plan Attributes Table displays incorrect information #6

Closed wmorrisett closed 3 years ago

wmorrisett commented 3 years ago

Problem: When reloading a previously created Plan, the Redistricting Attributes Panel does not display correct information. I created a Plan with 5 districts. After reopening the Plan the Attributes Panel displays the following rows: Unassigned, NULL, 1, 2, 3, 4.

Steps: Create new basic plan with 5 districts -- no extra options. Assign some polygons to District 1. Save the QGIS project. Close QGIS. Reopen QGIS. Reload the Redistricting Plan previously created. (Same problem results when you keep QGIS open and just close the Redistricting Plugin Main Panel, and then restart the Redistricting Plugin and reopen the Plan.)

Shapes and data file: ct_bg_proj_P2_2020tiger.zip. Download URL: https://redistrictingdatahub.org/dataset/20212030-ct-hastaqdna-population-projections-joined-to-2020-census-block-groups-p2/

Configuration: Windows 10 with most recent updates. QGIS version 3.20.0-Odense (downloaded on 6/30/2021). Plugin: Statto Redistricter QGISv3, Installed Version: 2.1.3. (I had the same problem with the plugin in QGIS 3.16, before installing QGIS 3.20.)

See also attached PDF, with screen shots.

Problem After Closing Redistricting Plugin 06-30.pdf

johnpholden commented 3 years ago

Hi, this should be fixed in the absolute most recent version (on github, not on QGIS, repository is not yet updated). It was saving the NULL district to disk. To install, visit: https://github.com/johnpholden/qgis3redistricter - click on the green Code button and select "Download ZIP," and then use the install from zip feature in the plugin dialogue. It should be updated in the system soon. Apologies for the inconvenience.

wmorrisett commented 3 years ago

Thanks for the quick reply. I reinstalled the plugin using https://github.com/johnpholden/qgis3redistricter - green Code button and selecting "Download Zip". The plugin installed version is now 2.2.4. Next I started with a fresh set of ct_bg_proj_P2_2020tiger.zip files, and started a new QGIS Project. The plugin 2.2.4 release did not fix the problem: After creating a new Plan, closing the Plan and reopening the Plan, the Attributes Panel still displays the following rows: Unassigned, NULL, 1, 2, 3, 4.

johnpholden commented 3 years ago

You are correct - I've just pushed a patch which (hopefully) fixes this error again.

wmorrisett commented 3 years ago

I installed the new version of the plugin. Ver. 2.2.5. Started with new project and shapefiles. Tried creating a Plan. Plugin Attributes table is empty. No symbology added. Python errors:

2021-07-01T14:50:28 WARNING Traceback (most recent call last): File "C:.../QGIS3\profiles\default/python/plugins\qgis3redistricter-master\StattoRedistrict.py", line 2277, in updatePanelAndSaveParameters self.saveParameters() File ".../QGIS3\profiles\default/python/plugins\qgis3redistricter-master\StattoRedistrict.py", line 1363, in saveParameters self.initializeElectorates() File ".../QGIS3\profiles\default/python/plugins\qgis3redistricter-master\StattoRedistrict.py", line 2022, in initializeElectorates locked[districtName[counter]] = 0 KeyError: 2

johnpholden commented 3 years ago

I added that line in to try to solve another error I came across. Apologies, patched.

wmorrisett commented 3 years ago

That fixed the problem! I used the latest plugin version, V 2.2.6. Thanks John! I marked the issue closed. Bill M.