Friday 19 May 2017

arcgis desktop - How to select parcels in ArcPy situated in a different county than is written in the attribute table?


I have two polygon feature classes: one with parcels, the other one with counties (40 counties)


I have to identify the parcels that in the attribute table belong to county 'X', but spatially they are situated in another county.


Manually, it works with Data Reviewer extension in ArcMap: I create a BatchJob with a Geometry on Geometry Check where I write 40 expressions (because I have 40 counties!!!) like this: Feature Class1 = [PARCELS] where COUNTYID = 'X'; Feature Class2 = [COUNTIES] where COUNTYID = 'X'; SPATIAL RELATION: INTERSECT (checking the option 'Find features not in this relationship') --> and the output are the parcels that have COUNTYID = 'X', but spatially ARE NOT in the county 'X'.


Is there a way to do this automatically? I thought about creating a list with the values of the COUNTYID field for both feature classes and then iterate through each value and select by location. The problem is that I cannot figure it out automatically the option 'Find features not in this relationship' that DataReviewer has and SelectByLocation does not :(


Thanx a lot!





No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...