Determining landcover %'s (polygon layer) that is not within burned areas (raster layer) - polygon

I am trying to extract information on the % of different vegetation cover types within areas that have not been burned. However, the data I was given for the park includes areas that have been burned as a raster file in NAD_83 projection, and the vegetation cover as a polygon layer in WGS_84 projection. Essentially, I'm trying to erase the overlap between areas that have been burned and the vegetation layer to only look at vegetation cover types in areas that have not been burned. The vegetation is broken into 12 class labels based on understory/shrub cover type, and I want a percentage of how much each cover type occurs in unburned area. Can anyone help with this transformation?
I have access to ArcGIS Desktop v 10.8.2 with an Advanced licence.
I have tried converting the raster to points which worked, but I don't know how to make the points into polygons that perfectly match the size/shape of the original raster. I don't know another way to "erase" the two layers other than by trying to convert the raster to a polygon with the same coordinate system.

ArcMap is probably reprojecting the data on the fly, but you could start by transforming the raster and vector layers to a common datum.
If I understand correct, you want to know the area of veg types represented as polygons that are within unburned areas which are represented as pixels in a raster.
If that is correct, I would convert the unburned areas to a polygon layer. It might help to convert the burn raster such that unburned = 1 all else = 0 or NA, then convert unburned to a polygon.
With the unburned areas represented as polygons, intersect this layer with the veg layer. Doing so will cut the veg layer by the unburn polygon layer. The result should allow you to only select polygons that intersected with the unburned layer once it is vectorized. Get the area of these polygons grouped by veg type.

Related

Determine relative position of two spatial objects in R?

I have several spatial objects in R, let's say one squiggly line boundary in the form of a SpatialLinesDataFrame and a large set of SpatialPointsDataFrame named spdf.
How do I most efficiently determine for all of the points in spdf whether they lie north or south of the squiggly line defined in boundary?

R: Species distribution modeling for a riverine species - all coordinates not falling in raster cells

I am running Species Distribution Modeling in R in biomod2 package for an riverine species in the Ganges River basin so I clipped the bioclim layer with the river network that I obtained from hydrosheds. Resolution of bioclim layer and river network at 1km*1km. But the problem arose as not all coordinates fell on the raster cells (probable causes - coordinates taken at banks, river networks not correctly delineated etc.)
So how do I overcome this problem? Do I pull the coordinates to the nearest raster cell (nearest in terms of vertices? - If this is the correct method than an easier way to do this too) or do I just leave the coordinates - more than half occurrence points would be deleted.
enter image description here

Crop out all mapped area beyond region of 13 U.S. states

I've just started with mapping in R and I've managed to convert a lat, lon dataframe to a raster file and then plot state borders on top of that.
Now I need to get it ready to publish and would like to include only the shape of my 13-state region (and no great lakes).
library(tmap)
usa <- st_as_sf(maps::map("state", fill=TRUE, plot =FALSE))
map_us<- tm_shape(usa)+
tm_borders()
tm_shape(raster_file) +
tm_raster(style = "cont", palette = "viridis", midpoint = 0)+
map_us
I'm having a hard time finding something out there that would provide a polygon for multiple states and I have been through a lot of mapping packages. Sorry I can't include my raster data here.
To crop a raster file to {sf} vector shape you have in principle two options:
crop at data level; this involves raster::mask() with possibly raster::crop() later to reduce the extent of the raster (masked raster retains the original size)
retain the data, and overlay a white polygon with a hole over your plot
Cropping on data level is more "pure", but will leave you with ragged edges (a raster cell has to be square).
Overlaying a white polygon is not so pure, but might be preferable if your key aim is a slick presentation (and purity of essence be damned...)
You will find both of them discussed, together with examples and sample code, in this post on the RStudio community site.

How to calculate area of polygons within distance of other polygons

I have two sf polygon objects - one of land parcels and the other of parks. All parcels are within 2 miles of at least one park, but some parcels are within that distance to multiple parks. Parks and parcels are not of uniform size or shape.
For each land parcel, I want to calculate the area of park polygons within a half mile. Other posts answer how to calculate the area of each park and the distance between polygons, but not how I can calculate the area of parks within a half mile of each parcel. Any advice would be appreciated. Thank you!
Figured I should post the steps I took to solve this:
Create a buffer sf object for the parcels (dist = 1/2 mile)
Create an intersection sf object for the buffer and the parks (this will still have the parcel IDs, since it's based on each parcel's buffer)
Use st_area the calculate the area of those intersections
convert the intersection sf object to a data.table
merge that data.table with the original parcel sf object based on PID
That results in the parcel sf object having the area of the parks within a half mile of them.

How to estimate density of Polygon intersections in R?

I have many polygons that represent search areas of different people. By intersecting all that areas I want to get density map - 1 person searched in this area, two in that area and so on.
My trouble is that I have >5k geoJSON polygons and I need to intersect all of them. Is there a way to do it R's sf package or (less preferably) in ArcGIS?

Resources