2

I have to use Geoprocessing tools in ModelBuilder.

My requirement is compare features in a Source personal geodatabase with those in a Target personal geodatabase and if the target personal geodatabase has extra captured features then to export them as a shapefile.

I am using Select Layer By Location tol first select all intersecting features in source and target personal geodatabases and then trying to switch selection in that same Select Layer By Location tool.

How can I SWITCH_SELECTION in the select in location Select Layer By Location tool?

enter image description here

2

2 Answers 2

2

You should use each select operation one at a time.

  • The first one, that is in your model should be defined as NEW_SELECTION only;
  • Then use another Select Layer by Location (or by Attributes, it shouldn't matter) on the output of the first Selection, and choose SWITCH_SELECTION without defining any expression.

This should do the job.

EDIT: Further comments

The reason you do not see any selection in the output of your model is that you use MAKE FEATURE LAYER tool which creates a temporary layer within your model; thus in order to see the output you should export it to a new layer. You can use the copy features tool to export selected features. See result below (non intersecting polygons are populating a new layer and symbolized as hollow polygons with red border)

Results with export

This is the model I used:

Model to export selected

If you wish to only select features in your already existing feature class, you can drop the Make Feature Layer tool and preform selection directly on your layers. See results and model below (note that in order to see the selection on the view window you should zoom-in or out to perform rendering):

Selection no Export

and the model:

Model no export

3
  • Still my problem not solved first selection i have used NEW SELECTION and another select use select by attribute with SWITCH SELECTION but is not giving any results.
    – SATYA
    May 12, 2015 at 5:20
  • 1
    Does the first Selection (NEW_SELECTION) gives any selected features? Is it possible that all features in your feature layer intersect with a feature in your target building, i.e. if all are selected, than switch selection will unselect all.
    – dof1985
    May 12, 2015 at 6:46
  • @SATYA - If it helped you, you could mark it as an answer
    – dof1985
    May 13, 2015 at 6:11
1

Here is the model that worked for me. Note that you have to turn your 'intersect' and 'switch selection' into TWO parts in the model. In my model I was intersecting the Feature layer with the outline of the United States. In the final step I used 'Copy Features' to create a feature class that will appear on my map.

Model

1
  • Sure thing! It took me awhile to figure it out myself. May 13, 2015 at 16:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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