# Seeking QGIS algorithm for Swapping land parcels/plots by property?

I've searched for a QGIS Algorithm for swapping plots in an area by land owners and I didn't find anything.

Do you know something that did that?

For example, in an area or in a town we have 2 big land owners. The plots are mixed between them. For a land consolidation we need to swap the plots between them. The result would be that land owner 1 is in the west side of the town and the land owner 2 is in the south side of town. It's about the agricultural land for bigger agricultural exploitation.

Example:

Plots before a swap

Plots after a swap

The green plot/parcels are for owner 1 The Red plot/parcels are for owner 2

It can be used for land consolidation.

• I think that you should develop a test dataset so that you can include a picture of it here. I would keep it simple initially. If you cannot find a solution using all square plots of the same size then there will be no chance of solving for more complex polygons.
– PolyGeo
Dec 13, 2018 at 7:51
• Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. You have a tag for PHP but are you wanting to ask about using that language to try and solve this?
– PolyGeo
Dec 13, 2018 at 8:14
• You are mixing a lot of terminology so it's unclear what you really want, I agree with @PolyGeo, add some images to your question to explain. Are you asking about Automated zonal design? A type of problem applied to census areas, if so search for the author Openshaw. Dec 13, 2018 at 11:31
• Google turned up this for `land swapping algorithm -pixel` books.google.com/… Dec 14, 2018 at 1:11
• Hi, can you show us some of the data you use ? Is the land modelised by polygon or only point ? What is your aim exactly, you want to swap lands to create a same aera of land for everybody but with linked lands, in order to form bigger fields of same value for each owner ? Dec 18, 2018 at 12:26

Here's an outline of one way to approach this problem:

1. Use the `convex hull` algorithm to create a polygon that encloses all the land belonging to a single owner. Repeat for each land owner.
2. Use the `centroid` algorithm to convert each land owner's convex hull to a point.
3. Create a voronoi plot of all the land owner centroids.
4. Assign all the plots that intersect each voronoi polygon to the corresponding landowner.
5. Calculate the total area of plots now assigned to each land owner.
6. Compare the new land area value to the original land area value for each owner. Look at the distribution of owners with too much land compared to owners with too little land.

a. If land owners with too much land are relatively evenly interspersed with land owners with too little land, begin reassigning plots to even out the differences. Find pairs of neighbors where one has too much and the other has too little. Take plots near the border between the two neighbors, and re-assign them to the neighbor with not enough land.

b. If land owners with too much land are clustered together, adjust the locations of the land owner points. Go back to step 3 (making a voronoi plot).

Note: This method assigns a point location to each land owner, and then attempts to give that land owner plots centered around that point. Steps 1-2 assign points to land owners based on the centroid of their current plots of land. Depending on the needs of the land owners, you could use a different method to choose the land owner points. For example, you could use their home addresses as land owner points.