Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(raster)
- library(sf)
- # Bay area data: long_min = -123.0056, long_max = -121.99944, lat_min = 36.99944, lat_max = 38.00056
- sf_bay_data = raster::raster("data/goldengate/n38w123/imgn38w123_13.img")
- # Create Simple Feature Geometry (sfg) Polygon around GG Bridge
- gg_sfg <- st_polygon(list(cbind(c(-122.56, -122.56, -122.41, -122.41, -122.56), c(37.88, 37.77, 37.77, 37.88, 37.88))))
- # Add projection info by creating an sfc object
- gg_sfc <- st_sfc(gg_sfg, crs = "+init=epsg:4326")
- # Create simple feature dataframe
- gg_sf <- st_sf(gg_sfc)
- # Crop SF Bay data to zoom in around GG Bridge
- gg_data <- raster::crop(sf_bay_data, gg_sf)
Add Comment
Please, Sign In to add comment