🔗Extract Raster Values
Below is a method to use the raster package
extract()function to get a subet of rasterBrick values. To be specific, I need to extract all raster values that are within a polygon boundary. In the past I have used
mask()and then the
getValues()functions from the
rasterpackage to subset data values within a polygon. But that method returns a data frame with a ton of NA values (anything outside of the crop area in the raster is an NA). This is fine most of the time but the current project that I am working on requires almost all of the memory on my computer. I'm working with extremely large rasters (2Gb). Removing the NA values after the
getValues()process crashes my computer. So I need a more effecient process.
🔗Random Forest Resources and Notes
Resources to understand and run random forests in r.
🔗Creating a polygon from scratch in R
A quick little snippet for making a polygon with coordinates out of thin air in r.
🔗Raster Distance Calculations
There are many cases when I have needed to calculate a distance from a point or many points to a feature in GIS. Until recently I have always used the near tool. This works really well for small datasets but can take forever with larger datasets. The near calculation also only works with points (I'm sure that there is a raster equivalent I just haven't done the research on it). I also really like to document where I got my data. You can do that in ArcGIS but it is an added step to do it.
🔗Web Dev Resources
A collection of resources that I couldn't work without
🔗Django Getting Started
My notes on learning Django. I'm using this Django Tutorial.