5

I have two polygon layers - Parcels (in yellow below) and Sites (in Red hatch) - and I am trying to select all polygons from layer 1 that have any part of layer 2 in them, ignoring where edges touch.

In this example I want Parcels B, F, M, N, Q, R, W, X to be selected. I do not want Parcels A, C, etc. selected even though their edges touch the Sites

enter image description here

So far the only option under Select by Location that I've found to mostly work is "Intersect" with a negative Search Distance.

enter image description here

This negative Search Distance isn't ideal as I need to be sure I'm finding all features (although with 5mm I'm pretty close). In my testing I found that setting a smaller Search Distance like -0.2 will still select the additional unwanted polygons. I have checked, there is no overlap here.

Ultimately I am wanting to select all Parcel features that do not have a site, which will be incorporated into a much larger arcpy script.

enter image description here

Is there a geoprocessing tool that ignores touching edges when selecting polygons?

import arcpy
mxd = arcpy.mapping.MapDocument("CURRENT")
inFeat = "TestParcel"
selFeat = "TestSite"
arcpy.SelectLayerByLocation_management(inFeat, "INTERSECT", selFeat, "-0.5 Centimeters", "NEW_SELECTION", "INVERT")

I have tested the other selection Relationships like "Contains" however these don't select all the features I'd expect or select other features I don't want. The negative Search Distance on Intersect is the best result I've found so far.

Note: My polygons (in both layers) are varying sizes and shapes, and aren't always centred/aligned with each other. The screenshots here are just of my test data.

  • A slightly different option, Convert Red polygons to Centroids (feature to point, inside), then use "Select by Location" with Intersect and a small search tolerance. – klewis Feb 7 '17 at 20:36
  • the Select by Location, search tolerance should act as a Buffer and select the Polygons within the distance of the Centroid. – klewis Feb 7 '17 at 20:51
  • I feel like there must be a better way, but would it be acceptable to split your Sites by the Parcels, Merge the results, and then SelectLayerByLocation using "CONTAINS" using the merged sites? – danielm Feb 7 '17 at 21:07
  • Intersect both, join result by polygon I'd to polygons. Select ones with no match – FelixIP Feb 8 '17 at 3:28
  • @danielm you might be onto something there, although I suspect I'll get a nasty performance hit with it. I'll take a look after the weekend – Midavalo Feb 11 '17 at 7:06
1

enter image description here

Select B, F, Q, R, W, X (all but M and N):

  1. Select Layer By Location option Within
  2. And add to current selection with: Select Layer By Location option Contains

Select M and N: switch selection above, dissolve and then use option Have Their center in, Intersects

And then repeat 1 and 2 to add the rest to M and N selection

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.