title: Rasterize error: Polygon to raster conversion produces horizontal lines
body: <p>I am working with shapefiles in R that I need to convert from polygon to raster. While the vectors look perfect when plotted, when converted to raster using 'rasterize' they produce erroneous horizontal lines. Here is an example of the problem:</p>
  
  <p><a href="https://i.stack.imgur.com/FX3Nj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FX3Nj.jpg" alt="Polygon"></a>
  <a href="https://i.stack.imgur.com/sEJ33.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sEJ33.jpg" alt="Raster"></a></p>
  
  <p>Here is a generic example of the code that I am using (sorry that I cannot upload the data itself as it is proprietary):</p>
  
  <pre><code>spdf.dat &lt;- readOGR("directory here", "layer here")
  
  # Plot polygon
  plot(spdf.dat, col = 'dimgrey', border = 'black')
  
  # Extract boundaries
  ext &lt;- extent(spdf.dat)
  
  # Set resolution for rasterization
  res &lt;- 1 
  
  # determine no. of columns from extents and resolution
  yrow &lt;- round((ext@ymax - ext@ymin) / res)
  xcol  &lt;- round((ext@xmax - ext@xmin) / res)
  
  # Rasterize base
  rast.base &lt;- raster(ext, yrow, xcol, crs = projection(spdf.dat))
  
  # Rasterize substrate polygons
  rast &lt;- rasterize(spdf.dat, rast.base, field = 1, fun = 'min', progress='text')
  plot(rast, col = 'dimgrey')
  </code></pre>
  
  <p>Does this seem to be a problem with the source data or the rasterize function? Has anyone seen this sort of error before? Thank you for any advice that you can provide.</p>