Spatial Data: Monitoring Trends in Burn SeverityData Category: Fire History Data Description: MTBS is the Monitoring Trends in Burn Severity project which maps the burn severity and perimeters of fires across the United States beginning in 1984. Data Link: http://www.mtbs.gov/ Data Use Policy: http://www.mtbs.gov/cooperators.html Use with R: MTBS data (in this case, the National MTBS Fire Occurrence Dataset) can be downloaded from the MTBS website as a vector point shapefile. The files come packaged in a zipped .tar.gz format. Using the link to the file on the website, you can download the file to your current directory using the download.file function from the built-in utils package. To “untar” the zipped file and extract the shapefile, use the untar function also from the utils package. The shapefile can then be read using the readOGR function from the rgdal package. In this example, I extracted the Michigan points and plotted them on an outline of Michigan with colors coordinating to the year of the fire.
Scalebars and North Arrows with MapmiscSeptember 21, 2016Description: The package mapmisc is great for creating simple, fast, and effective maps; it utilizes shorter, neater coding at the cost of being less customizable than some other mapping packages. This R-Tip is modified from: https://cran.r-project.org/web/packages/mapmisc/vignettes/mapmisc.pdf First, let’s install and load some packages that we’ll be using in this R-Tip, including the mapmisc package.
Let’s download regional shapefiles for the US. You can download the file cb_2014_us_region_20m.shp from this website: http://www2.census.gov/geo/tiger/GENZ2014/shp/ Let’s open the shapefiles in R and read them in:
Next, we’ll define the shapefile’s projection, and since we’re dealing with a map of the US, we’ll reproject the shapefile using the US National Atlas equal-area projection.
Now, we can add a scaleBar and north arrow easily with mapmisc. scaleBar() is particularly user-friendly because it automatically generates the scale and true north based on the projection settings of the object you provide.
In the map above, we can see scaleBar seems to have taken one of the extremes for the north arrow; as I mentioned at the beginning, mapmisc is user friendly, but it does take away some options to customize your map, and with such a large extent being mapped, this north arrow may not be ideal. For fun, let’s try that again, this time with just the northeast. The north arrow will be able to represent true north better for a smaller area.
scaleBar is a very user-friendly command from the package mapmisc that can help you easily enhance your maps. Keep in mind some of the shortcomings discussed when choosing to use this command. |
Spatial Ecology @ MSUClick on "Category" below to search for R code compiled by the Zarnetske Spatial & Community Ecology Lab and students in MSU's Spatial Ecology graduate course (FOR870/FW870) Category
All
Archive
October 2016
|