Riverscapes / QRiS

Riverscapes Studio - for QGIS
https://qris.riverscapes.net
GNU General Public License v3.0
2 stars 0 forks source link

Add length and area fields in every polygon or line feature class for all DCE types #330

Closed Jdgilby closed 7 months ago

Jdgilby commented 9 months ago

These used to exist as virtual fields I believe and auto calculated areas and lengths. I think they got removed when migrating to the 3FCE setup. We should implement these again. Issue #318 happened when a user was trying to add a field to calculate total length of structures.

This might bring up another issue of adding fields(I'll post after further testing). What happens when adding a new field to a layer (or virtual field)? Nick said his have stayed and been preserved. It caused issues for Sam. The new field gets added to every layer that shares the same type of geometry since its technically adding the new field to the dce_"" layers in the .gpkg.

KellyMWhitehead commented 9 months ago

Adding a virtual length/area field to all dce layers (all layers?) should be straight forward. I will do this in a future release.

Users adding virtual fields might be safe, however the will not persist with the qris project, only with the qgz file.

Users adding data fields is not recommended with the 3 feature class system as it would add the field to all layers. QRiS knows nothing about these additional fields, and could potentially cause instability with the toolbar.

Jdgilby commented 9 months ago

As to point 3 then, is it possible to restrict a layer from having fields added so users cant do this?

KellyMWhitehead commented 7 months ago

I have added length and area virtual fields back to QRIS DCE layers. (version 0.3.17)

It appears that we are unable to restrict users from manually adding fields to layers.

Jdgilby commented 5 months ago

@KellyMWhitehead Maybe a non issue, but I recently added a field to a project as a test and tried to delete it and I cant. I cant even delete it in the dce_polygons layer in the .gpkg. Not a huge deal but kind of annoying. Heres the error:

Could not commit changes to layer dce_polygons

Errors: ERROR: 1 attribute not deleted.

Provider errors: OGR error deleting field 3: bad result for PRAGMA foreign_key_check, got 1 rows, expected 0