How to delete all the areas where two shapefiles intersect

2597
3
Jump to solution
08-01-2014 02:49 AM
JackWiseman
New Contributor II

Hi there,

 

I have two files, one showing all of the sites belonging to a company a year ago and another showing a list of sites that have been sold in the last year, there are a couple of thousand so going through them manually would take a while, is there a way to just delete the areas that intersect? The Clip tool in the editor toolbar lets you delete the area that intersects for individual shapefiles but when using the clip tool through the toolbox the only option semms to be to preserve the area that intersects, any help would really be appreciated,

 

Thanks,

Jack

0 Kudos
1 Solution

Accepted Solutions
RichardFairhurst
MVP Honored Contributor

If you have an Advanced license you would use the Erase tool.

If you don't have an Advanced license you would have to use the Union tool.  Since you only are dealing with two feature classes the Basic license is sufficient, but you would need a higher license to process more than 2 feature classes at once with this tool.  You should consider using the Integrate tool on a copy of the feature classes prior to using the Union tool if you do not think the topology of the two layers matches very well.

The output of the Union tool will have two fields for the ObjectIDs of the two input layers.  You would only retain those polygons where the ObjectID field of the Sales layer has a value of -1, meaning there are no sales properties in that location and only the original company ownerships exist there.  Select that set of polygons and export them to a new feature class or do the inverse selection and delete all of the sales properties.

You may want to use the Multipart to Singlepart tool on these new polygons, since by default the Union tool preserves all parts of the original polygon that are not cut by the other polygon as one multipart feature even if the cut results in several parts that do not touch each other.  Be prepared to deal with sliver polygons if the topology of the two layers is off and you may need to use the Dissolve tool with the multipart option unchecked if there was bad topology internal to either of the two layers.

View solution in original post

3 Replies
RichardFairhurst
MVP Honored Contributor

If you have an Advanced license you would use the Erase tool.

If you don't have an Advanced license you would have to use the Union tool.  Since you only are dealing with two feature classes the Basic license is sufficient, but you would need a higher license to process more than 2 feature classes at once with this tool.  You should consider using the Integrate tool on a copy of the feature classes prior to using the Union tool if you do not think the topology of the two layers matches very well.

The output of the Union tool will have two fields for the ObjectIDs of the two input layers.  You would only retain those polygons where the ObjectID field of the Sales layer has a value of -1, meaning there are no sales properties in that location and only the original company ownerships exist there.  Select that set of polygons and export them to a new feature class or do the inverse selection and delete all of the sales properties.

You may want to use the Multipart to Singlepart tool on these new polygons, since by default the Union tool preserves all parts of the original polygon that are not cut by the other polygon as one multipart feature even if the cut results in several parts that do not touch each other.  Be prepared to deal with sliver polygons if the topology of the two layers is off and you may need to use the Dissolve tool with the multipart option unchecked if there was bad topology internal to either of the two layers.

JackWiseman
New Contributor II

That's really helpful thanks Richard, I've measured the area of the ownership layer polygons and then used the intersect tool with the ownership and sale layers, I've calculated the difference between the original ownership layer and the intersect product, where there is no difference they can just be deleted in the way you've explained as there is 100% overlap before moving onto the sliver polygons which seem to take the most time! Thanks again!

0 Kudos
RichardFairhurst
MVP Honored Contributor

Actually you want to use the full set of both layers with the Union tool.  The selection for either export or deletion would get rid of full and partial overlapping areas and all parts of the sales properties that did not overlap the original properties (although that should not occur if the sales were a true subset of the original properties). Using the Intersect tool first only complicates the process of reaching your objective more than it helps.  You could export the overlapping parts from the union if you wanted to also know how much area was deleted, since the set of polygons that have ObjectIDs greater than -1 in both fields is identical to the Intersect output.

0 Kudos