Get a raster composed of 0s and 1s

Jump to solution
08-22-2018 08:50 PM
New Contributor II

Novice with ArcGis, I would like to convert my Polyline dataset to a Raster with only 0s and 1s

To this end, I used the Gis command "Polyline to Raster" and set the cell size small enough, so that the lines features might be captured.

However, the Raster Attribute table that I got contained only positively coded cells (i.e. those crossed by a line and whose values correspond to the ID of the line.) while I would have liked to get an attribute table with all the cells.

Thus, I thought about using the "Raster calculator" tool and the following command : Con(IsNull(raster), 0, 1). Unfortunately, this didn't work. I got a Raster with an attribute table containing 0 and 1 admittedly, but with only two values now.

Thus, I would like to ask for your help in order to be able to get a Raster with an Attribute table containing all the cells, coded as follows: 0 when no line crosses the cell, and 1 otherwise.

Thanks a lot,

0 Kudos
10 Replies
Occasional Contributor II

One simple way to deal with this is to make a raster with all 0 values for the extent you want. Then convert your vector lines to raster and give it the value of 1. Then merge your 1's on top of your 0's and voila! That's if you need all your nodata values to actually have a value of 0. 

0 Kudos