I have two shapefiles which has two attribute information like below:

fid DN
217536 2
217537 4
217538 6
217539 8
217540 10
217541 11
217852 3
217853 5

Both shapefiles have square grid of 250 x 250 Meter which has DN values and files has similar headers one is FID and Second is DN Values.

Both file has similar projection and nicely coming over each other in QGIS GUI.

I want to calculate the change in DN values within each vector grids. But there is no common filed on which basis I can pick the value i.e., fid is different for both shapefiles.

  • Your question is unclear. Can you provide the two shapefiles (dummy data) or post at least a screenshot? Not exactly clear what result you expect and where. What do you mean by calculate the change in DN values within each vector grids?
    – Babel
    Jun 6, 2023 at 9:49

1 Answer 1


I assume your grids overlap exactly, or very close to.

  1. Join attributes by location to join the DN field of the second grid to the first. Join type = "Take attributes of the feature with largest overlap only (one to one)"
  2. The output will have a new field named DN_2. Field Calculate the change "DN_2"-"DN"

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.