How to perform reverse clip?

19630
17
Jump to solution
02-15-2017 08:29 AM
GwanSeonKim
New Contributor II

Hi,

I would like to delete overlapped area and get not-overlapped raster image.

I tried to use clip tool, but clip tool only provided overlapped areas.

I have one base raster layer (brown pixels) and one polygon (pink color).

Do you have any idea how to deleted overlapped area?

Alternatively, I also have two raster layers. One for base raster (brown pixels) and the other one for overlapped raster (pink pixels) after use mask tool. 

I guess I may use raster calculation tool to get the not-overlapped pixels as an image, but I do not know how to do that.

 

In order to get not-overlapped image, I do not know which one will be better and faster between (one raster with polygon) and (two rasters).

Thank you,

Sun

0 Kudos
17 Replies
GwanSeonKim
New Contributor II

Dear Darren,

I just want to let you know that your code is working good.

I do not know why I had error before.

I just changed output raster directory rather than default, it works perfectly.

Thanks for your code.

P.S Do you know why I had the error if I used "default directory"? 

0 Kudos
DarrenWiens2
MVP Honored Contributor

Glad to hear it. No, I don't know why you got that error. It looks like others who had the same error fixed it by saving to a different location (like you), or to a different file format, or setting the workspace environment, or other environments, etc. It looks like one of those errors that can be caused by many things, or nothing at all!

0 Kudos
GwanSeonKim
New Contributor II

I am trying to use the code you provided, but it may take time since I am doing entire U.S. I will let you know if it works or not. Thank you.

0 Kudos
GwanSeonKim
New Contributor II

Unfortunately, I got an error as below:

ERROR 000539: Error running expression: rcexec()
Traceback (most recent call last):
File "<expression>", line 1, in <module>
File "<string>", line 8, in rcexec
RuntimeError: ERROR 010240: Could not save raster dataset

In each raster, I have only one value (value=1) with count.

I do not know whether the error comes from this or not.

Do you have any idea why I got this error? 

0 Kudos
AbdullahAnter
Occasional Contributor III

what about overlap area if you remove it from raster?

will it be with no data?

or you will select one raster to fill that area?

if so

Use  mosaic to new raster tool Mosaic To New Raster—Help | ArcGIS Desktop .

0 Kudos
GwanSeonKim
New Contributor II

Thanks for your response.

I will try if it also works for me or not.

0 Kudos
JayantaPoddar
MVP Esteemed Contributor

If I have to suggest another workaround, then it would be as follows

1. Create a new polygon feature class (Envelope_Polygon) and draw polygon that covers the whole Raster data. 

2. Using Erase Tool with Pink_Polygon, get the non-overlapping portion of the Envelope Polygon.

3. Clip (Data Management) the Raster with the remaining portion of the Envelope Polygon.



Think Location
MichelleTotman
Occasional Contributor

This is my go-to answer for this particular problem.