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
Solved! Go to Solution.
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"?
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!
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.
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?
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 .
Thanks for your response.
I will try if it also works for me or not.
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.
This is my go-to answer for this particular problem.