library(sf)
## Warning: package 'sf' was built under R version 4.4.2
## Linking to GEOS 3.12.2, GDAL 3.9.3, PROJ 9.4.1; sf_use_s2() is TRUE
library(tmap)
## Warning: package 'tmap' was built under R version 4.4.2
## Breaking News: tmap 3.x is retiring. Please test v4, e.g. with
## remotes::install_github('r-tmap/tmap')
library(tigris)
## Warning: package 'tigris' was built under R version 4.4.2
## To enable caching of data, set `options(tigris_use_cache = TRUE)`
## in your R script or .Rprofile.
storm_channel<-st_read("C:/Users/vmq938/OneDrive - University of Texas at San Antonio/methods1/StormChannels/StormChannels.shp")
## Reading layer `StormChannels' from data source
## `C:\Users\vmq938\OneDrive - University of Texas at San Antonio\methods1\StormChannels\StormChannels.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 12042 features and 17 fields
## Geometry type: MULTILINESTRING
## Dimension: XY
## Bounding box: xmin: 2024999 ymin: 13600410 xmax: 2249487 ymax: 13824430
## Projected CRS: NAD83 / Texas South Central (ftUS)
corridor_plan<-st_read("C:/Users/vmq938/OneDrive - University of Texas at San Antonio/methods1/CorridorPlans/CorridorPlans.shp")
## Reading layer `CorridorPlans' from data source
## `C:\Users\vmq938\OneDrive - University of Texas at San Antonio\methods1\CorridorPlans\CorridorPlans.shp'
## using driver `ESRI Shapefile'
## Simple feature collection with 12 features and 4 fields
## Geometry type: POLYGON
## Dimension: XY
## Bounding box: xmin: 2058688 ymin: 13665110 xmax: 2178301 ymax: 13793820
## Projected CRS: NAD83 / Texas South Central (ftUS)
#Transform the coordinate reference systems of both datasets to crs = 4326 (2')
storm_channel<-st_transform(storm_channel,crs = 4326)
corridor_plan<-st_transform(corridor_plan, crs = 4326)
#To find what parts of storm channels are within the corridor plan area, please intersect corridor plans with storm channels (2')
intersected_channel<-st_intersection(storm_channel, corridor_plan)
## Warning: attribute variables are assumed to be spatially constant throughout
## all geometries
#Visualize the intersected storm channels with a background of Bexar County census tracts (1')
bexar_ct<-tracts(state = "TX", county = "Bexar", cb=T)
## Retrieving data for the year 2022
## | | | 0% | |= | 1% | |= | 2% | |== | 2% | |== | 3% | |=== | 4% | |=== | 5% | |==== | 5% | |==== | 6% | |===== | 7% | |===== | 8% | |====== | 8% | |====== | 9% | |======= | 9% | |======= | 10% | |======= | 11% | |======== | 11% | |======== | 12% | |========= | 12% | |========= | 13% | |========== | 14% | |========== | 15% | |=========== | 15% | |=========== | 16% | |============ | 17% | |============= | 18% | |============= | 19% | |============== | 20% | |=============== | 21% | |=============== | 22% | |================ | 22% | |================ | 23% | |================= | 24% | |================= | 25% | |================== | 25% | |================== | 26% | |=================== | 27% | |==================== | 28% | |==================== | 29% | |===================== | 30% | |====================== | 31% | |====================== | 32% | |======================= | 32% | |======================= | 33% | |======================== | 34% | |======================== | 35% | |========================= | 35% | |========================= | 36% | |========================== | 37% | |=========================== | 38% | |=========================== | 39% | |============================ | 40% | |============================= | 41% | |============================= | 42% | |============================== | 42% | |============================== | 43% | |=============================== | 44% | |=============================== | 45% | |================================ | 45% | |================================ | 46% | |================================= | 47% | |================================= | 48% | |================================== | 48% | |================================== | 49% | |=================================== | 50% | |=================================== | 51% | |==================================== | 51% | |==================================== | 52% | |===================================== | 52% | |===================================== | 53% | |====================================== | 54% | |====================================== | 55% | |======================================= | 55% | |======================================= | 56% | |======================================== | 56% | |======================================== | 57% | |======================================== | 58% | |========================================= | 58% | |========================================= | 59% | |========================================== | 59% | |========================================== | 60% | |=========================================== | 61% | |=========================================== | 62% | |============================================ | 62% | |============================================ | 63% | |============================================= | 64% | |============================================= | 65% | |============================================== | 65% | |============================================== | 66% | |=============================================== | 67% | |=============================================== | 68% | |================================================ | 68% | |================================================ | 69% | |================================================= | 69% | |================================================= | 70% | |================================================= | 71% | |================================================== | 71% | |================================================== | 72% | |=================================================== | 72% | |=================================================== | 73% | |==================================================== | 74% | |==================================================== | 75% | |===================================================== | 75% | |===================================================== | 76% | |====================================================== | 77% | |======================================================= | 78% | |======================================================= | 79% | |======================================================== | 79% | |======================================================== | 80% | |========================================================= | 81% | |========================================================= | 82% | |========================================================== | 82% | |========================================================== | 83% | |=========================================================== | 84% | |=========================================================== | 85% | |============================================================ | 85% | |============================================================ | 86% | |============================================================= | 87% | |============================================================= | 88% | |============================================================== | 88% | |============================================================== | 89% | |=============================================================== | 89% | |=============================================================== | 90% | |=============================================================== | 91% | |================================================================ | 91% | |================================================================ | 92% | |================================================================= | 92% | |================================================================= | 93% | |================================================================== | 94% | |================================================================== | 95% | |=================================================================== | 95% | |=================================================================== | 96% | |==================================================================== | 97% | |===================================================================== | 98% | |===================================================================== | 99% | |======================================================================| 99% | |======================================================================| 100%
tm_shape(bexar_ct)+
tm_borders()+
tm_shape(intersected_channel)+
tm_lines(col="blue")
#Read the raster file (LC09_028040_20230826.tif) Download LC09_028040_20230826.tif)Open this document with ReadSpeaker docReader, which is the land surface temperature of Dallas. (1')
library(raster)
## Loading required package: sp
LST<-raster("C:/Users/vmq938/OneDrive - University of Texas at San Antonio/methods1/LC09_028040_20230826.tif")
#Convert the Kelvin into Celsius (C = K - 273.15) and then plot the raster data. (2')
LST<-setMinMax(LST)
LST<- LST-273.15
cellStats(LST,max)
## [1] 61.28771
#Only visualize the areas with temperatures higher than 40 Degree Celsius (2').
plot(LST, main="Land Surface Temperature, Dallas")
plot(LST > 40, main = "LST>40")
knitr::opts_chunk$set(echo = TRUE)