How to convert a raster to polygon for clipping other rasters in ArcMap
Hello all!
So, I've been using PCI Geomatica for a few months at work and I HATE IT. I HATE THIS SOFTWARE. It makes ArcMap look like a fun game. I know all about the clipping and subsetting tools/algorithms in PCI, but I prefer to use ArcMap. So here's a lil tutorial for y'all. (To use these tools I think you need to have an Advanced license...)
I am looking at NDVI change between T1 and T2 for Landsat imagery. To get the most accurate NDVI statistics, I wanted only the stats for the land, and not have it skewed by the water. Luckily all Landsat TM imagery comes with a water mask yaay (water = 0, else 1). I can't multiply my NDVI image by the mask, because NDVI values are from -1 to 1. So I need to clip the image as per the land. Again, I know you can clip things in PCI but I am just going to ignore that software right now.
First we need to convert our watermask and raster image to a polygon. Thankfully ArcMap comes with a nifty little tool called "Raster to Polygon". The raster:
The tool:
Uncheck "Simplify polygons" if you want the EXACT delineation. I had it unchecked. If you have a good computer, the process should take about a minute, depending of course on the size of the raster. The ouput:
Now, to select only the land, you use the grid code, or raster code, of the pixels. Everything that is land should be 1, and all water pixels are 0.
Export the selected attributes to a new shapefile and name it land.
Yay! Now we have a nice shapefile that we can edit and clip rasters with. So I brought in my 2010-1984 NDVI raster and clipped it according to my land polygon.
This clipping process normalized my data and tightened the range. For this region, the range was like, -138 to 140, which is extreme, because there are a lot of changing mudflats and water levels all along the coast. After cleaning up the water mask and the land shapefile, the NDVI range was -0.4 to 0.7, much more acceptable!
I hope this helps some people!










