Since I only have Incorporated area feature class, how can I select census blocks that are in unincorporated area? Or not within any incorporated areas using ArcMap or ArcPy?
2 Answers
Give this a shot:
arcpy.env.workspace = "c:\\yourWorkspace"
arcpy.management.MakeFeatureLayer("incorporatedPlaces","incorporatedPlacesLyr")
arcpy.management.MakeFeatureLayer("censusBlocks","censusBlockLyr")
arcpy.management.SelectLayerByLocation("censusBlockLyr","HAVE_THEIR_CENTER_IN","incorporatedPlacesLyr")
arcpy.management.SelectLayerByAttributes("censusBlockLyr","SWITCH_SELECTION")
To read more about this check out this link from ESRI Help: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Select_Layer_By_Attribute/001700000071000000/
Select by Location, in Arcinfo, will give you a variety of options to refine that requirement.
-
Is there anyway to do it in ArcGIS 10 with ArcView level license? Thank you.– user8517Jun 28, 2012 at 20:06
-
5I believe that Select By Locatino is available in all licences of Arc. Have a look here for more details: help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//…. You can select all the ones that DO have their centers in an unincorporated area and then for the second part of your question, just switch selection. Jun 28, 2012 at 20:14
-
I did use select by location with "HAVE_THEIR_CENTER_IN" in Python. But I could not find a switch selection option after that. I really appreciate your help.– user8517Jun 28, 2012 at 20:17
-
2If you're doing it in Python simply add a line under your SelectLayerByLocation() that goes something like this: SelectLayerByAttribute("LayerWithSelections","SWITCH_SELECTION") help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/…– AHighJun 28, 2012 at 21:46
-
1SelectLayerByAttribute("LayerWithSelections","SWITCH_SELECTION") worked!– user8517Jun 29, 2012 at 14:04