##My dataframe with point files (lets call it trainData_crs) trainData_crs<- read.csv(file.csv) > class(trainData_crs) [1] "data.frame"
trainData_crs<- read.csv(file.csv)
class(trainData_crs)
[1] "data.frame"
crs(trainData_crs) [1] NA
summary(trainData_crs) PlotType Class Latitude Longitude
closedforest:22 Min. :1.000 Min. :17.81 Min. :24.72
grass :34 1st Qu.:2.000 1st Qu.:17.86 1st Qu.:24.98
lowforest :24 Median :3.000 Median :17.92 Median :25.02
mediumforest:26 Mean :2.904 Mean :17.95 Mean :25.02
shrubs : 4 3rd Qu.:4.000 3rd Qu.:18.01 3rd Qu.:25.10
unknown : 3 Max. :7.000 Max. :18.46 Max. :25.16
water : 1
crs(trainData_crs)
[1] NA
summary(trainData_crs)
PlotType Class Latitude Longitude
closedforest:22 Min. :1.000 Min. :17.81 Min. :24.72
grass :34 1st Qu.:2.000 1st Qu.:17.86 1st Qu.:24.98
lowforest :24 Median :3.000 Median :17.92 Median :25.02
mediumforest:26 Mean :2.904 Mean :17.95 Mean :25.02
shrubs : 4 3rd Qu.:4.000 3rd Qu.:18.01 3rd Qu.:25.10
unknown : 3 Max. :7.000 Max. :18.46 Max. :25.16
water : 1
all_landsat_bands<-list.files ("file.tif") img <- brick(all_landsat_bands)
img <- brick(LandsatAprJune_2019_st) class(img) [1] "RasterBrick" attr(,"package") [1] "raster" names(img) [1] "B1" "B2" "B3" "B4" "B5" "B6" "B7" "B10" "B11"
all_landsat_bands<-list.files ("file.tif")
img <- brick(all_landsat_bands)
img <- brick(LandsatAprJune_2019_st)
class(img)
[1] "RasterBrick"
attr(,"package")
[1] "raster"
names(img)
[1] "B1" "B2" "B3" "B4" "B5" "B6" "B7" "B10" "B11"
coordinates(trainData_crs)<-~Latitude +Longitude
proj4string(trainData_crs) = CRS("+init=epsg:4326")
crs(trainData_crs_sp) CRS arguments: +proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-138,-105,-289,0,0,0,0 +units=m +no_defs crs(img) CRS arguments: +proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-138,-105,-289,0,0,0,0 +units=m +no_defs
crs(trainData_crs_sp)
CRS arguments:
+proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-138,-105,-289,0,0,0,0 +units=m
+no_defs
crs(img)
CRS arguments:
+proj=utm +zone=34 +south +a=6378249.145 +b=6356514.966398753 +towgs84=-138,-105,-289,0,0,0,0 +units=m
+no_defs