This question already has an answer here:

The default function in raster::rasterize is to see if a point is within a polygon and if yes, make a cell. This results in that some of the outer parts of the polygon is not covered by the new raster. Is it possible to use rasterize (or fasterize or whatever) in a way, so that the entire polygon is covered?

marked as duplicate by Fran Raga, Gabriel De Luca, whyzar, Community Mar 19 at 14:08

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    You could maybe buffer the polygons by half-a-cell and then rasterise, or rasterise and then buffer the raster by a cell using a "grow" operation. Alternatively you have to form a rectangle for each of your raster cells and do a load of polygons-raster intersections... – Spacedman Mar 18 at 15:33

Make a fishnet, select cells in the fishnet that overlap the polygon, and then rasterize the cells selected. 'Fishnet' is the ESRI term for it. You can use the SF package to do it in R, as per the answer in this link.

  • Not sure what you mean by fishnet? – Jeppe Olsen Mar 19 at 8:19

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