0

BACKGROUND:

At 10.8.1, I have used the Polygon Neighbors tool with a countywide parcel shapefile (approximately 47,000 polygons). The tool runs to completion (taking < 1 minute) without reporting any errors. I used the shapefile's PARCEL_NO field as the "Report by Field", and I unchecked "Include both sides..." option. All other settings were left at their default.

THE PROBLEM:

When I manually check the results, I find that Polygon Neighbors has failed to identify many of the neighboring polygons. For example, one of the ~47k polygons has 15 neighbors, but the tool only found 4 neighbors.

In several cases, none of the surrounding polygon neighbors were identified.

Out of approximately 20 manual checks, only one parcel's neighbors were correctly identified, and that was a simple situation with only two neighbors.

ATTEMPTED SOLUTIONS:

  1. Ran the Geometry Check tool on the parcel shapefile. It reports ok.
  2. Ran Polygon Neighbors from ArcCatalog instead of ArcMap. The same errors resulted.
  3. Selected a subset (169) of the ~47k polygons and Data > Export them to a new shapefile. This subset included the polygon with the 15 neighbors mentioned above. In this case, Polygon Neighbors correctly(!) identified all neighbors.
  4. Used QGIS to perform the same polygon neighbor concept with the ~47k polygon shapefile, using the methods described in https://spatialthoughts.com/2019/05/23/neighbor-polygons-aggregate-qgis/. This method correctly identified all neighbors. However, it took about 20 hours to complete, so I'd like to find a faster option.

QUESTION:

I've run out of ideas. Why does Polygon Neighbors fail to identify surrounding polygons in the ~47k polygon shapefile, yet correctly identify them in a much smaller shapefile subset?

4
  • It would help greatly if you could show us a picture of one errant polygon and its neighbours, ideally along with the coordinates of all their vertices, so that an attempt can be made to try and reproduce your results.
    – PolyGeo
    Commented Dec 27, 2020 at 1:02
  • Are the polygons singlepart or multipart? Does every polygon have a unique value for PARCEL_NO?
    – PolyGeo
    Commented Dec 27, 2020 at 1:19
  • 1
    It's great robust tool. Absence of neighbours in polygon A might mean it was a neighbour to others, because you excluded both sides.
    – FelixIP
    Commented Dec 27, 2020 at 2:31
  • @FelixIP is correct; please change your comment to an answer and I'll credit. I should have tested with the "Include both sides..." option checked on (insert face palm here...). In my defense, that option's description is cryptic; I read it to mean that if checked on, the list of neighbor pairs would be needlessly duplicated. Frankly, I still don't understand what that checkbox does... Anyway I'm happy, the tool is amazingly fast!. PolyGeo, the layer is multipart; nice to know that the tool also works for that data model.
    – Stu Smith
    Commented Dec 27, 2020 at 18:39

1 Answer 1

1

This is what tool does if you uncheck "Include both sides" option:

enter image description here

So if you'll decide to compute number of neighbors by counting frequency of src_OBJECTID, you'll end up with very few (first record only?) correct answers:

enter image description here

Tool essentially creates edges of a graph, with polygons being graph nodes. Uncheck option if you are dealing with undirected graph. It helps to solve multiple tasks, e.g. graph coloring, or equal totals grouping.

"Both sides" option is useful when dealing with directional graph, where edge weight in one direction might be different to one in opposite direction, e.g. during pipe route design. It also useful when you want quickly compute number of grumpy neighbors:

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.