Saturday, 4 January 2020

arcgis 10.0 - Find the intersection of two rasters


I have two raster images, Boolean classified (1 or 2). They overlap in given areas.


I need a raster that is only the overlapping sections.


Using Arcinfo 10. Answer can only use raster methods, no converting to polygons, points, etc...Just for reference here's a screen shot.



Answer



This seems like a pretty simple clipping operation. Use the Clip (Data Management) tool.


From the help documentation:



An existing raster or vector layer can be used as the clip extent. If you are using a feature class as the output extent, you have the option to clip the raster by the minimum bounding rectangle of the feature class or by the polygon geometry of the features. If clipping geometry is used, then the pixel depth of the output may be promoted. Therefore, you need to make sure that the output format can support the proper pixel depth.




This should actually be simpler than your requirement as it uses core functions and should not even require the Spatial Analyst extension, as other methods might.


-------------- Edit


On the other hand, if your goal is to create a raster that shows where both inputs were null, or either one had a value, or both had a value, then you would use Raster Multiplication. This essentially creates an output raster that has values which are the multiples of the values of the input rasters. Note that what follows requires the Spatial Analyst extension.


An example, in your case, with boolean rasters.


Raster 1:  1,2  
Raster 2: 1,2

Output Raster: Possible combinations: 1x1,1x2,2x1,2x2 with output values: 1,2,4
Value 1: Both Boolean False
Value 2: 1 or the other, Boolean True

Value 4: Both Boolean True

If you want to be able to determine which of your inputs has a true value, you will need to reclassify one of the input rasters so that your multiplied values are completely unique. Both inputs will need to be reclassified so that there is no Value of "1", as this will allow for duplicate values in a multiplied raster.


Example:


Raster 1: 1,2 - Use [Raster Addition][4], with a constant of 1 - Output Raster 3  
Raster 2: 1,2 - Use [Multiply Raster][5], with constant of 2 - Output Raster 4
Raster 3: 2,3
Raster 4: 2,4

Now, multiply Raster 3 and Raster 4

Output Raster: Possible Combinations: 2x2,3x2,4x2,4x3 with output values: 4,6,8,12

Value 4: Both Boolean False
Value 6: Raster 3 True, Raster 4 False
Value 8: Raster 4 True, Raster 3 False
Value 12: both Boolean True

You could do a combination of these operations where you clip one of the rasters by the other, to only show the overlapping area. Then reclassify and multiply the rasters to show where both are False, one or the other are True, or both are True.


Hope this helps.


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...