UMR-PASSAGES / DissolveWithStats

QGIS plugin to dissolve geometries and calculate statistics on attributes in the process
6 stars 5 forks source link

Tool not calcualting statistics. #10

Closed Mattah12 closed 1 year ago

Mattah12 commented 1 year ago

The tool is just returning the values for the first record in each dissolve field value, rather than calcualting statistics.

It still carries out the physical dissolve.

For example when carrying out a dissolve on the below with 'Sum' calculated as the statistic:

image

It returns just the first record: image

juliepierson commented 1 year ago

Hi @Mattah12, Thanks for your feedback !

First of all this tool is no longer maintained, since there is now a core qgis tool which does the job : aggregate

Still it should work :-) Could you send me your data and a screenshot of the tool with all your parameters ? Thanks !

Mattah12 commented 1 year ago

Thanks for the prompt reply. I had no idea about Aggregate, does the job perfectly.

My data is saved here - https://drive.google.com/file/d/1BSFIazR3-TznuWvZn9GIw_UVQzAUxQqr/view?usp=share_link

And below is how I'm using the tool:

image

You can't see the first 6 fields, but I'm not keeping those anyway.

I just ran it again to be sure, and it's still just spitting out the first feature of each of the 'name' fields.

juliepierson commented 1 year ago

Ok, thanks, I'll have a look into this as soon as I can !

juliepierson commented 1 year ago

I just tried it, I had a warning message during dissolve with stats "cannot delete identifier column" (or something like that, message was in french). I tried again after exporting your layer in a shapefile without fid column, I had to repair geometries first and it worked all right.

When I created this plugin, geopackage wasn't much around (it was some time ago !), and the fid automatic field does not seem to be well handled.

Of course it's better to use the core aggregate tool :-)

Mattah12 commented 1 year ago

I thought I had fixed geometries, bu tmaybe not? Either way, best to use the built-in Aggregate as you say. Thanks for taking a look.