I'm a bit of an R novice and looking to see if there is any way to assign values to a raster layer based upon polygons.

Some background - I am working on a mining project and have a regular grid of polygons that contains attributes (ie. material type). I have also created a masked raster that represents Z elevations for an excavator bucket (see images 1 & 2).

I am trying to use extract() with no success - is there away to assign the material type inside a polygon to the raster layer so that i can calculate how much of each material has been over-mined in the Z?

material type polygons

dig floor elevations raster

  • 1
    Hi Jake, welcome to GIS SE. Did you try rasterize() polygons? You can also take an ifelse() sentence inside calc() function. If you provide data or a reproducible example we could help you more – aldo_tapia May 10 at 15:40

Your Answer

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

Browse other questions tagged or ask your own question.