2

I am trying to make wind map in QGIS, where I used vector point shapefile.

Because I have two different shapefiles I first merged them:

enter image description here

Then I Dissolve it where I choose two attributes to dissolved:

enter image description here

enter image description here

But it seemes that the attributes did not dissolve.

enter image description here

enter image description here

How can solve this?

3
  • 1
    How do you define merging of attributes? What do you want your output to look like?
    – kowalski
    Mar 18, 2022 at 9:52
  • Are the values of those two attributes equal for the overlapping features in both datasets?
    – user30184
    Mar 18, 2022 at 10:11
  • 1
    I think that the problem it isn't when you disolve, it starts when you merge the shapefields. I imagine that where there are two close arrows you want one. This happens because the correspondence of the points of the shapefiles is not perfect. In that case, look for a way to merge it by making the points correspond. After that, I see that for the same point the arrows are different, you should recalculate the values ​​from those of the two arrows or take only one.... I would join the layers with "overlay fields prefix" and got the average between the two in a new field.
    – JLR
    Mar 18, 2022 at 11:06

1 Answer 1

1

You first have to "connect" the points where the two grids overlap: the points are probably not in the exact same location, but somehow shifted. So create a new point exactly in the middle of two neighboring points from the two grids, then combine the attributes from both layers.

Let's suppose your two grid layers are called grid1 and grid2.

  1. On layer grid1, select points that overlap the extent of grid2. Use Select by expression with this expression:
    within (
        $geometry, 
        layer_property( 
            'grid2', 
            'extent'
        )
    )
  1. Use Menu Processing > Toolbox > Geoemtry by expression, use grid1 as input, check Selected features only and insert this expression (replace 190 in line 7 with a distance a bit larger then the distance between neighboring points from the two grids):
    centroid (
        make_line (
            $geometry, 
            overlay_nearest (
                'grid2',
                $geometry,
                max_distance:=190
            )[0]
        )
    )
  1. On this new point layer, use Field calculator to get any attribute (here: value2) from grid2 with this expression:
    overlay_nearest (
        'grid2',
        "value2"
    )[0]
  1. Aggregate the values from the two layers - like sum, mean etc., whatever you need. Use field calculator for this.

  2. You have now a new point layer that combines the points from both grids where they overlap. In the original grids, delete the points where the extent of the two grids overlap - use the expression from step 1 to select the points to be deleted.

  3. Now you can merge the three layers: remaining points from grid1, remaining points from grid2 and the points from the layer created in step 2.

Red points: grid1, blue points: grid2; orange points created in step 2: enter image description here

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.