Query and "Borrow" from Polygon Neighbors

02-20-2020 06:31 AM
New Contributor

I have a feature class with about 12,000 contiguous polygons (they are thiessen polygons). Each polygon has either a surplus or deficit value that represents the availability or lack of resources within that polygon. How can I test all neighboring polygons to query their values and then create a new value for every polygon based on the optimal reallocation of values between it and its adjacent polygons? I realize that this will create a cascade between polygons if there are multiple deficits in a row, so I might also need to build in a limit to the number of neighbours the query will run.


I am aware of the Polygon Neighbors tool in ArcGIS Pro, but from what I understand this only identifies which polygons are neighbours. I need to go a few steps further and find a way to query the value in each neighbouring polygon and then "borrow" their resources when they are available.


When I asked ESRI Canada's tech support they said this will likely require some python code, but I should ask GeoNet first.


I am using ArcGIS Pro 2.4 This is the first time I've used GeoNet, so please let me know if I should be posting this in another sort of community. Thanks!

0 Kudos
4 Replies
MVP Legendary Contributor

Attributes can be transferred to the table.

The question becomes what do you want to do with what you have?

I have used a text field (text) and an object id field (OID) as the transfer fields (Report by Fields option).

The highlighted polygon has 8 neighbors, this may not be the case with a Voronoi Diagram (Theissen polygons).

  • What is your observation of the number of neighbors? (is 8 most likely or is 4/5 more likely
  • Do you only intend to process first order adjacency?
  • Do you need to iterate until all deficits are satisfied by surpluses?
  • Is there a distance limit through which a surplus can travel (ie, iterations can effectively 'move' surpluses until the everthing is uniform (floating-point values) or close to normal (integer values)

You can relay the info to Esri Canada... tell them I sent you

New Contributor

Thanks this is a great help! I should have given Polygon Neighbors a shot. I've clipped an example and created the attribute table like you suggest. My surpluses or deficits are indicated in the "Srpls" field. Any ideas for what I should do next to iterate? Here's a screenshot of my "Barn Polys", and some answers to your questions.

  • 4-5 neighbors is more likely.
  • I could process multiple adjacent polygons, both multiple neighbors and then floating-point, as you suggest
  • Yes, I would like to iterate until all deficits are satisfied (within a distance limit)
  • Yes, there should be a distance limit. I'll try it first with 5 km. What would be the best way to implement a limit?

Polygon Neighbors showing surpluses and deficits

See the screenshot above.

  • Features 2, 9, and 6 have deficits. In number 2, the polygon neighbors tool shows that 1, 5, 8, and 9 are neighbors. Only the first 3 have surpluses, but as it happens they have enough to satisfy the deficit in 2.
  • If possible, I should give precedent to 1 and 5 since they share more borders with 2 than 8 does.
  • In the next iteration, any surplus that moves from 5 to 2 must be removed so it is no longer available for 9 and 6.
  • I hope this makes sense.

And here's a rookie question, but why do you think I'm not showing any node counts at all? I'll pass on any knowledge to ESRICan!

0 Kudos
MVP Legendary Contributor

Node counts is solely for polygons that meet at a single node and not along an edge.

Since there is no obvious starting location, the deficit polygons will probably become the origins.

The reductions in the surplus polygons will probably have to begin with moving surplus from them to satisfy deficits.

In your example, it might be useful to see the surplus/deficits summarized by area and perimeter

New Contributor

Thanks again. Yes my surplus values are created using area and other factors.

   How would you recommend creating a moving surplus to satisfy the deficits? Is there a standard geoprocessing tool for this? I suppose once the Poly Neighbor table is created, the process wouldn't even require GIS, right? Or at least it's not needed to process first order adjacency. The moving surplus sounds much more complex.

0 Kudos