2

I would like to script the selection of the square that contains both the orange and green points, but not the squares with any other combination of points including white points. I am very familiar with python, but I do not know if the process of selecting a target feature with two sources layers is even possible. I cannot seem to figure out the process even within ArcMap's GUI. This seems like it should be easy. Any ideas?

Pseudo code: If square contains both orange and green points but only those points > select

Select Squares

  • 1
    Using select by location in ArcMap you need to select the ones with orange and then change your selection type to select from the current selection then select the ones with green - easy. Are you trying to do this in arcpy? – Michael Stimson Aug 19 '14 at 21:46
  • @MichaelMiles-Stimson he's got multiple layers... – DPSSpatial Aug 19 '14 at 21:50
  • Thanks! I got it! I was just over thinking it. Thanks mapBaker! – Etchisketchistan Aug 19 '14 at 21:53
  • 1
    If you have time it would be great if you could write up an answer to your own question to describe the steps for future readers of this Q(&A). – PolyGeo Aug 19 '14 at 21:55
3

You can do it in the GUI, just not all at once. Multiple selections are required using a 'current selected set' that gets modified. One option would be:

  1. Select squares that intersect green.
  2. Per Michael's comment, change method to 'from current' rather than 'create new', and select squares that intersect orange. You should now have all squares containing both green and orange and none that contain only one or the other (but some may contain white as well).
  3. Again change the method, this time to 'remove from current', and do those that intersect white. You should be left with squares that only contain green and orange, and nothing else.

Related question with some help document links, which would address a case if your points were all one layer (requiring both a location and attribute selection): Select by Attribute within a specific area (using Select by Location?)

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.