QUESTION 1
library(sf)
## Linking to GEOS 3.12.1, GDAL 3.8.4, PROJ 9.3.1; sf_use_s2() is TRUE
library(tmap)
## Breaking News: tmap 3.x is retiring. Please test v4, e.g. with
## remotes::install_github('r-tmap/tmap')
library(tigris)
## To enable caching of data, set `options(tigris_use_cache = TRUE)`
## in your R script or .Rprofile.
storm_channel <- st_read('C:/Users/adrian.gallegos/OneDrive - BASIS.ed/Desktop/FALL UTSA/HW5/StormChannels/StormChannels.shp')
## Reading layer `StormChannels' from data source
## `C:\Users\adrian.gallegos\OneDrive - BASIS.ed\Desktop\FALL UTSA\HW5\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_plans <- st_read('C:/Users/adrian.gallegos/OneDrive - BASIS.ed/Desktop/FALL UTSA/HW5/CorridorPlans/CorridorPlans.shp')
## Reading layer `CorridorPlans' from data source
## `C:\Users\adrian.gallegos\OneDrive - BASIS.ed\Desktop\FALL UTSA\HW5\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)
storm_channel<-st_transform(storm_channel,crs = 4326)
corridor_plans<-st_transform(corridor_plans,crs = 4326)
QUESTION 2
intersected_channel <- st_intersection(storm_channel, corridor_plans)
## Warning: attribute variables are assumed to be spatially constant throughout
## all geometries
QUESTION 3
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% | |======== | 12% | |========= | 13% | |========== | 14% | |=========== | 15% | |============ | 17% | |============= | 18% | |============= | 19% | |============== | 19% | |============== | 20% | |=============== | 21% | |=============== | 22% | |================ | 22% | |================ | 23% | |================= | 24% | |================= | 25% | |=================== | 27% | |==================== | 28% | |==================== | 29% | |===================== | 30% | |====================== | 31% | |====================== | 32% | |======================== | 34% | |========================= | 35% | |========================= | 36% | |========================== | 37% | |=========================== | 39% | |============================ | 40% | |============================= | 41% | |=============================== | 44% | |================================= | 47% | |================================= | 48% | |=================================== | 50% | |=================================== | 51% | |==================================== | 52% | |===================================== | 53% | |====================================== | 54% | |======================================= | 56% | |======================================== | 56% | |======================================== | 57% | |======================================== | 58% | |========================================= | 58% | |========================================= | 59% | |========================================== | 59% | |========================================== | 61% | |=========================================== | 61% | |============================================== | 65% | |============================================== | 66% | |======================================================== | 80% | |========================================================= | 81% | |============================================================ | 86% | |============================================================= | 87% | |============================================================== | 89% | |=============================================================== | 90% | |=============================================================== | 91% | |================================================================ | 91% | |================================================================ | 92% | |================================================================= | 92% | |================================================================= | 93% | |===================================================================== | 99% | |======================================================================| 100%
tm_shape(bexar_ct)+
tm_borders()+
tm_shape(intersected_channel)+
tm_lines(col="blue")
QUESTION 4
library(raster)
## Loading required package: sp
LST <- raster('C:/Users/adrian.gallegos/OneDrive - BASIS.ed/Desktop/FALL UTSA/HW5/LC09_028040_20230826.tif')
QUESTION 5
LST <- setMinMax(LST)
LST <- LST - 273.15
cellStats(LST, max)
## [1] 61.28771
plot(LST, main="Land SurfaceTemperature, Dallas")
library(ggplot2)
library(rasterVis)
## Warning: package 'rasterVis' was built under R version 4.4.2
## Loading required package: lattice
gplot(LST) +
geom_tile(aes(fill = value)) +
scale_fill_viridis_c() +
labs() +
theme_minimal()
QUESTION 6
plot(LST > 40, main = "LST>40",
col = c("#ffffff", "#0000ff"))