andrewmaclachlan / casa0005repo Goto Github PK
View Code? Open in Web Editor NEWBookdown :book: for CASA0005 practicals: https://andrewmaclachlan.github.io/CASA0005repo/
License: Creative Commons Attribution Share Alike 4.0 International
Bookdown :book: for CASA0005 practicals: https://andrewmaclachlan.github.io/CASA0005repo/
License: Creative Commons Attribution Share Alike 4.0 International
Updated from MSc student
I wrote a bit of code for creating convex hulls for the dbscan output, which are a bit more nicely shaped than those in the practical, maybe someone will find it useful ๐
convex hulls to wrap around points
chulls <- data.frame() for (cluster in 1:max(BluePlaquesSubPoints$dbcluster)) { cluster_data <- BluePlaquesSubPoints %>% filter(dbcluster == cluster) ch <- chull(cluster_data$coords.x1, cluster_data$coords.x2) chulls <- chulls %>% bind_rows(cluster_data[c(ch), ]) }
Currently I'm learning this tutorial on my own, and I find that in 7.7.2, it takes a long time to resample such big data. Therefore I suggest we do the clipping in 7.7.3 first, and then resample. This may save some time. Will problem arise in it? Thanks.
My codes:
library(pacman)
p_load(sp,raster,rgeos,rgdal,rasterVis,raster,fs,sf,tidyverse)
# read data
manchester_boundary <- st_read("data/manchester_boundary_download/Manchester_boundary.shp")
listlandsat <- dir("data/LC08_L1TP_203023_20190513_20190521_01_T1",
pattern = "[B123456790].TIF",full.names = T) %>% stack()
#check they have the same Coordinate Reference System (CRS)
crs(manchester_boundary)
crs(listlandsat)
# get only Manchester
lsatmask <- listlandsat %>%
# now crop our temp data to the extent
crop(.,manchester_boundary)%>%
mask(., manchester_boundary)
# handle 8th band
b8list = dir("data/LC08_L1TP_203023_20190513_20190521_01_T1",
pattern = "[B8].TIF",full.names = T) %>%
raster()
## ngb is a nearest neighbour sampling method
b8correct <- b8list%>%
# now crop our temp data to the extent
crop(.,manchester_boundary)%>%
mask(., manchester_boundary)%>%
resample(., lsatmask$LC08_L1TP_203023_20190513_20190521_01_T1_B1,
method = "ngb")
lsatmask <- lsatmask %>%
addLayer(., b8correct)
raster::compareRaster(listlandsat$LC08_L1TP_203023_20190513_20190521_01_T1_B1,
listlandsat$LC08_L1TP_203023_20190513_20190521_01_T1_B8)
# add mask to the filenames within the raster stack
names(lsatmask) <- names(lsatmask)%>%
str_c(.,
"mask",
sep="_")
Thank you for your contribution. I've learned a lot from this course.
Add the new paper on GWR by Comber et al - https://onlinelibrary.wiley.com/doi/epdf/10.1111/gean.12316
Change pipe from %>%
to |>
Better way to convert to ppp than sf to sp https://www.paulamoraga.com/book-spatial/the-spatstat-package.html#from-sf-to-ppp
Geofabrik seems to have taken down the .shp for London.
Consider: https://docs.ropensci.org/osmextract/
Write up notes on key advice like the key advice on GWR
Take inspiration from https://github.com/BlakeRMills/30DayMapChallenge/tree/main/2023 or 30 day map challenge.
Consider less code in this week and more focus on mapping.
Do we need functions here?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.