I have a shapefile of Lakes over my study area. Each polygon has attribute information of each lake, name, shape etc. Actually I want to eliminate all lakes from analysis. In other word, I want lakes to have 0 value and the area that out of boundary of lake to have their orginal pixel values. when I do subset using this shapefile, the output is not I want because my shapefile deoesn't have any value outer boundary of lake.

How can I build a proper mask file (inner part of lake has 0 value, outer is 1) using this shapefile in ArcGIS Desktop?


Firstly you can rasterize your shapefile with the Polygon to Raster tool, then you can change its values using the Raster Calculator (e.g. set all cells whose value is greater than 0 to 0, otherwise 1) accordingly to the desired mask layer.

  • I need a shapefile or AOI file again after these steps you suggested to do subset. I have already got the mask file I desired (0 and 1). But I used "Raster to polygon" tool to get polygon file of lakes again, the values I desired disappeared, just FID number, shape, ID, Gridcode numbers have left in attribute. How should I do this? – Bandrush Barda Oct 7 '13 at 8:16
  • @BandrushBarda Have you set the "raster field" (optional) parameter with the "Raster to polygon" tool? – Antonio Falciano Oct 7 '13 at 8:32
  • There are 2 choices. One is value, another is count. I tried both of them. But results are the same. – Bandrush Barda Oct 7 '13 at 8:40
  • If you are interested in a shapefile you can follow another approach (more accurate): create a polygon shapefile containing only a feature covering the whole study area, then calculate the Symmetrical Difference with your lake shp and put 1 in a new field, e.g. "MASK_VALUE". Finally, you have only to merge the lake with the symmetrical difference. Hope this helps! – Antonio Falciano Oct 7 '13 at 8:55
  • Sorry. Which version of ARCGIS has Symmetric Difference tool? I cann't find it in ARCGIS 9.2. – Bandrush Barda Oct 7 '13 at 10:18

You could create a second polygon layer (fill layer) with a single shape that encompasses all of the features in your lakes layer. Then union your fill layer with the lakes layer and delete lakes, perhaps be selecting them by attribute first (the lakes will have attributes, name etc, the fill polygons will have none).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.