2

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?

8

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/

2

Select by Location, in Arcinfo, will give you a variety of options to refine that requirement.

7
  • Is there anyway to do it in ArcGIS 10 with ArcView level license? Thank you.
    – user8517
    Jun 28 '12 at 20:06
  • 5
    I 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 '12 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.
    – user8517
    Jun 28 '12 at 20:17
  • 2
    If 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#/…
    – AHigh
    Jun 28 '12 at 21:46
  • 1
    SelectLayerByAttribute("LayerWithSelections","SWITCH_SELECTION") worked!
    – user8517
    Jun 29 '12 at 14:04

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.