Commit 988f87dd authored by Romulo Pereira Goncalves's avatar Romulo Pereira Goncalves
Browse files

Project using the nearest neighbour method

parent 081b0770
......@@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 22,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
......@@ -62,7 +62,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 3,
"metadata": {},
"outputs": [
{
......@@ -927,7 +927,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 4,
"metadata": {},
"outputs": [
{
......@@ -1042,11 +1042,11 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"load_utm <- TRUE\n",
"load_utm <- FALSE\n",
"\n",
"if (load_utm == TRUE) {\n",
" # This file already was cropped and projected to UTM\n",
......@@ -1055,27 +1055,27 @@
" a1 <- brick(paste(dataPath,\"20200921_I_filt1.tif\", sep = \"\"))\n",
" proj4string(a1) <- '+proj=longlat +zone=33 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs'\n",
" a1 = a1[[-4]] #remove 4th channel, no variance (all =255)\n",
" a1 <- raster::projectRaster(a1, crs = \"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0\") \n",
" a1 <- raster::projectRaster(a1, crs = \"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0\", method = \"ngb\")) \n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"class : RasterBrick \n",
"dimensions : 11527, 11667, 134485509, 3 (nrow, ncol, ncell, nlayers)\n",
"resolution : 0.0303, 0.0303 (x, y)\n",
"extent : 357605.2, 357958.7, 5768101, 5768450 (xmin, xmax, ymin, ymax)\n",
"crs : +proj=utm +zone=33 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs \n",
"source : /home/romulo/gitlab/HabitatSampler/demo/Data/20200921_I_filt1_utm.tif \n",
"names : X20200921_I_filt1_utm.1, X20200921_I_filt1_utm.2, X20200921_I_filt1_utm.3 \n",
"min values : 0.00000000, 0.01612369, 0.00000000 \n",
"max values : 309.2744, 310.8932, 321.3706 \n"
"dimensions : 576, 1286, 740736, 3 (nrow, ncol, ncell, nlayers)\n",
"resolution : 0.0253, 0.041 (x, y)\n",
"extent : 357800, 357832.5, 5768263, 5768287 (xmin, xmax, ymin, ymax)\n",
"crs : +proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0 \n",
"source : memory\n",
"names : X20200921_test_site_I_klein.1, X20200921_test_site_I_klein.2, X20200921_test_site_I_klein.3 \n",
"min values : -72.01107, -76.71490, -72.34129 \n",
"max values : 259.3055, 260.9450, 256.4853 \n"
]
},
"metadata": {},
......@@ -105,7 +105,7 @@ if (load_utm == TRUE) {
a1 <- brick(paste(dataPath,"20200921_I_filt1.tif", sep = ""))
proj4string(a1) <- '+proj=longlat +zone=33 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs'
a1 = a1[[-4]] #remove 4th channel, no variance (all =255)
a1 <- raster::projectRaster(a1, crs = "+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0")
a1 <- raster::projectRaster(a1, crs = "+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0", method = "ngb")
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment