3D forest height maps with ggplot2 and rayshader in R

  Рет қаралды 13,842

Milos Makes Maps

Milos Makes Maps

Күн бұрын

Пікірлер: 92
@vishalmishra3590
@vishalmishra3590 4 ай бұрын
Milos you are amazing! Thanks a lot for teaching all of us this
@AleksPopovic
@AleksPopovic 10 ай бұрын
Whoa, this looks great! Love the 3d stuff you put up every time!
@milos-makes-maps
@milos-makes-maps 10 ай бұрын
Thanks Aleks! I enjoy creating and sharing the 3d rendering tutorials
@cahierCanada
@cahierCanada 7 ай бұрын
Amazing! Thank you so much!
@brunob.7792
@brunob.7792 Жыл бұрын
i was able to reproduce this! After almost 1hour rendering on a Ryzen 5600x 326g DDR4 ram 3600mhz, i was able to achieve the portugal map.png image on the directory. Also, i was able to watch the whole rendering process. It was amazing! Do amazon rainforest buddy! We brazilians, want to know how the situation is over here with illegal harvesting happening all the time!
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Wow, that's incredible! I hope you didn't fry your CPU 🤯. I might give it a try with Amazon in the future! Thanks for trying out my new tutorial and happy that it worked for you!
@santiago_s
@santiago_s Жыл бұрын
@@milos-makes-maps i'm trying with a laptop :( lol! How works with Amazon? Could you teach us?
@strangerr4980
@strangerr4980 6 ай бұрын
@@milos-makes-mapsWhat are the your computer operating system and graphics card specifications? and what time did you create this map sir?
@daniela_rondon
@daniela_rondon Жыл бұрын
Wow, just amazing!!! Thank you for sharing
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Hi Daniela, you’re very welcome! I’m so happy to hear that you found the tutorial amazing. You made my day with your comment. 😊
@mahatmaalimibrahim6631
@mahatmaalimibrahim6631 Жыл бұрын
Fantastic as usual. Thank you.
@milos-makes-maps
@milos-makes-maps Жыл бұрын
My pleasure!
@zhengpengfei6047
@zhengpengfei6047 Жыл бұрын
What a great work!Thank you!
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thank you for your kind words! I’m glad you enjoyed the tutorial and found it useful. I appreciate your support and encouragement. 😊
@johneagle4384
@johneagle4384 9 ай бұрын
Wow, this is so cool!!!
@milos-makes-maps
@milos-makes-maps 9 ай бұрын
Thank you!
@akshitgautam4206
@akshitgautam4206 10 ай бұрын
Really like your work!
@milos-makes-maps
@milos-makes-maps 10 ай бұрын
Thank you so much!!
@elisaurysuarez5927
@elisaurysuarez5927 2 ай бұрын
¡Great!
@jacksonkimani3336
@jacksonkimani3336 Жыл бұрын
Great work Sir Milos.. I am greatly inspired with this..
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thank you very much! I’m happy to hear that you are inspired by this. I hope you have fun creating your own 3D maps. 😄
@manivannansekar5026
@manivannansekar5026 5 ай бұрын
Amazing. make one tutorial for river please
@milos-makes-maps
@milos-makes-maps 5 ай бұрын
Hey, I've already created a tutorial on 3D river basin maps. Check it out on my channel!
@pallavshrestha5698
@pallavshrestha5698 7 ай бұрын
Hi Milos. I like the editor you are using in this video. Is it Sublime Text? The arguments visualising is pretty helpful, which I don’t find in Rstudio.
@milos-makes-maps
@milos-makes-maps 7 ай бұрын
Hi Pallav! These days I use VSCode and I have a tutorial that walks you through the process of installing and setting up R in VSCode here: kzbin.info/www/bejne/oWiceWt7mrdogNE
@elisaurysuarez5927
@elisaurysuarez5927 2 ай бұрын
My computer literally explodes with that render
@haipokung7926
@haipokung7926 7 ай бұрын
good figure❤❤❤
@christostheocharidis2037
@christostheocharidis2037 Жыл бұрын
Great turotial thank you very much. I have also an issue, when I run the classInt: classIntervals, It takes ages to run and never run it. I chose a different study area and I put n = 5 so the dimensions are 1149, 2893 (smaller than the video) but it still do nothing. Is it normal? should I leave it to run ?
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thanks! Really sorry to hear that you have such serious optimization issues with classInt. What is the style that you use? Can you try quantile or equal? Also, if it doesn't work you could also skip that part
@christostheocharidis2037
@christostheocharidis2037 Жыл бұрын
@@milos-makes-maps It ran eventually with the fisher method but after one hour approximately.
@milos-makes-maps
@milos-makes-maps Жыл бұрын
@@christostheocharidis2037 wow 😨, that doesn't sound good!
@h.rainakkhanreal3090
@h.rainakkhanreal3090 5 ай бұрын
Hi Milos, amazing tutorial. However, I am getting stuck in Section 5. Breaks classInt: classIntervals. This part of the code in Rstudio keeps on running forever, with no output. I left it running for 8 hours and finally had to interrupt and close R. This happened both for Portugal and Bangladesh. Is there any solution to this? I am using an intel i9 RTX 4080 laptop. I would like to add: - when trying 'equal' and 'quantile', the output is immediate. It is the style = 'fisher' that's causing this issue. Equal/quantile style maps look pretty bad for Bangladesh, with canopy height of 1m covering majority of the country.
@mirkodelfinsoruco8686
@mirkodelfinsoruco8686 Жыл бұрын
I generated a mosaic based on an image from ggogle earth and saved it as a png, but I get the following error (Error in rayrender::obj_model(cache_filename, x = -bbox_center[1], y = -bbox_center[2], : unused argument (texture = TRUE)
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Could you please install the latest newest version of rayshader using devtools::install_github("tylermorganwall/rayshader")
@sohom-
@sohom- 7 ай бұрын
I am getting this error in the last step of "rendering object". Can you help me with this please. Error in if (id) rgl.attrib.count(id, "colors") else rgl.getcolorcount() : argument is not interpretable as logical
@milos-makes-maps
@milos-makes-maps 7 ай бұрын
Hey, it seems that you are getting an error when using the `plot_gg()` function from the `rayshader` package in R. This error is caused by an incompatibility between the `rayshader` and `scales` packages, which are used to create the hillshade and shadow effects on the plot. There are a few possible solutions to this problem: - You can try to install the latest development versions of the `rayshader` and `rayrender` packages from GitHub, which may have fixed this issue. To do this, you need to run the following commands in R: ```r # if package is missing, run `install.packages("remotes")` first remotes::install_github("tylermorganwall/rayshader") remotes::install_github("tylermorganwall/rayrender") ``` - You can try to adjust the `width` and `height` parameters of the `plot_gg()` function to match the aspect ratio of your plot. For example, if your plot is square, you can use `width = 4000` and `height = 4000`. - You can try to remove and reinstall the `rayshader` package from CRAN, and restart your session
@Aztech501
@Aztech501 4 ай бұрын
Hi, Milos. I am geting stuck in section 3 (cropping tiles). This part of the code stops showing the next error: Error: [crop] file exists. You can use 'overwrite=TRUE' to overwrite it. If I add this statement to crop function, it works correctly but it doesn't crop properly. Is there any solution to this? The .tiff files are already in the same working folder
@milos-makes-maps
@milos-makes-maps 4 ай бұрын
Hi, this is the problem with the terra package. The owner of terra suggests to install the latest development (GitHub) version of the package. If the problem persists please reach to the owner of terra
@mirkodelfinsoruco8686
@mirkodelfinsoruco8686 Жыл бұрын
from where you get the png map of "portugal-forest-height-2020.png)
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Hey, you can find it on the project's website that I showed in the tutorial before you load the data part
@MrMaubitch
@MrMaubitch 6 ай бұрын
Very nice video! Unfortunately, the link to download the cloud optimized geotiffs seems to be offline/not working. Waiting for it to work and try out your awesome tutorial!
@milos-makes-maps
@milos-makes-maps 6 ай бұрын
Thank you! They messed up something with the page 😔. But I found the solution. You should download this html file and open it via your browser: libdrive.ethz.ch/index.php/s/cO8or7iOe5dT2Rt/download?path=%2F&files=tile_index.html
@imranhossain934
@imranhossain934 2 ай бұрын
First of all thenk you for the wonderful tutorial. But I didn't find any map with tiles from where I can download geotiffs. The linh "cloud optimized geotiffs here" is taking me in the another page. So, it would be very nice if you can help me regarding this matter.
@milos-makes-maps
@milos-makes-maps 2 ай бұрын
Hello! Firstly, a huge thank you for the positive feedback on the tutorial-it's fantastic to know it resonated with you! I'm sorry for any trouble caused by the link issue. It appears the files have been relocated. Good news, though! You can access the interactive tile map by downloading the HTML file from this link: libdrive.ethz.ch/index.php/s/cO8or7iOe5dT2Rt/download?path=%2F&files=tile_index.html Once downloaded, simply open the file in a web browser, and you'll be all set!
@imranhossain934
@imranhossain934 2 ай бұрын
Hello Sir.. Thank you very very much for your kind help.. I successfully made the forest height map of Sundarbans Mangrove Forest in Bangladesh. It was a wonderful experience for me.. Thank you angain..
@codeessentialske
@codeessentialske Жыл бұрын
Nice work. Which code editor is this?
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Thanks! This is VSCode
@strangerr4980
@strangerr4980 7 ай бұрын
@@milos-makes-maps also we have created this in r- stusio?
@user-nc1xm6nm6x
@user-nc1xm6nm6x 4 ай бұрын
m just little confused ,is the commands used directly in r studio or did in vscode
@milos-makes-maps
@milos-makes-maps 4 ай бұрын
I'm using VSCode
@user-tm8ck3qx2b
@user-tm8ck3qx2b 7 ай бұрын
Hello sir, If I've already download the raster with the download code and want to do rest of the process later. is it possible to run the the rest of the code? or need to download again?
@milos-makes-maps
@milos-makes-maps 7 ай бұрын
Hi, can you, please, run one code chunk at a time so that we can determine where the code breaks first? Also, please make sure that the downloaded files are in your working directory
@avirals_space2917
@avirals_space2917 5 ай бұрын
Sir am getting constant error of "libs' file not found..what can i do?
@milos-makes-maps
@milos-makes-maps 5 ай бұрын
Please make sure that you create the libs object by running the code lines 6-9
@boi_ratie
@boi_ratie 8 ай бұрын
This is a lovely tutorial. I tried to replicate it on my own but i kept encountering this error (/Forests/ETH_GlobalCanopyHeight_10m_2020_N36W009_Map.tif' not recognized as a supported file format. (GDAL error 4) ) the workig directory if the same as the script and the files and i tried to reload the packages but its stil not working. Your assistance wil be highly appreciated.
@milos-makes-maps
@milos-makes-maps 8 ай бұрын
Thank you so much! I'm sad to hear that my code doesn't work for you. Can you tell me if this error occurs on Mac or Windows? Also, what is the part of the code that triggers the error?
@Gomey.
@Gomey. 8 ай бұрын
@@milos-makes-maps Hi Milos Awesome tutoring. I am running into the same issue.I am running the code on windows. If you don't mind helping out this is the exact error I get Error: [rast] cannot open this file as a SpatRaster: C:/Users/pathtofolder/ETH_GlobalCanopyHeight_10m_2020_N36W009_Map.tif.
@milos-makes-maps
@milos-makes-maps 8 ай бұрын
@@Gomey. Hey, what is the part of my script that returns this error?
@Gomey.
@Gomey. 8 ай бұрын
@@milos-makes-maps Hi Milos, its this part I think it has something to do with the terra::rast part. I also tried it by setting the full.names = F when defining he raster_files to see if without the folder directory and only the file name it would reader but that had no impact. forest_height_list
@milos-makes-maps
@milos-makes-maps 8 ай бұрын
@@Gomey. Hmmm, can you confirm that you have raster files in your working directory? Also, if you are working with a single raster file you shouldn't be using `lapply`. It's sufficient to use terra::rast("raster.tif"), where "raster.tif" is the name of your raster file
@camilaberger2980
@camilaberger2980 11 ай бұрын
For me it shows this error when try to create the forest hight rasters Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘mosaic’ for signature ‘"SpatRaster", "missing"’
@milos-makes-maps
@milos-makes-maps 11 ай бұрын
Hey, this error suggests that no raster files were passed to terra::mosaic so I wonder if you set the working directory to the same place where you downloaded the raster files. Does that help?
@camilaberger2980
@camilaberger2980 11 ай бұрын
​@@milos-makes-maps ahh did not clarify, i am sorry, with portugal it worked, but i am doing with another country (Paraguay) with one raster only, and it show the messege i sent. I already check and it is the same with portugal archives, same directory. The "forest_height_rasters" is loaded, but when i run the "forest_height_mosaic" which is the next code it didnt and shows me the that msg. I also loaded this raster in qgis and it worked fine. Do you know a code that i just use an already download raster? besides when i closed and loaded de portugal project it does not load well, it seems i have to erase the download rasters from the directory and start all again.
@milos-makes-maps
@milos-makes-maps 11 ай бұрын
@@camilaberger2980 thanks for clarifying the example! If you are working with a single raster file you don't have to turn it into a mosaic. In fact, you can just load it into terra with terra::rast.
@camilaberger2980
@camilaberger2980 11 ай бұрын
Thank you very much @@milos-makes-maps. Now it shows "Error: memory exhausted (limit reached?)" can I just cut this raster in qgis to exacly the area that i wanted bc i want just a tiny area. I unior in R, thats why the basic cuestions, i apoligize.
@milos-makes-maps
@milos-makes-maps 11 ай бұрын
@@camilaberger2980 ahh that's annoying, I had that error popping up on MacBook frequently. You can definitely cut the area in QGIS and use terra::rast to load it into R
@jdaking7648
@jdaking7648 5 ай бұрын
Where are these packages installed from?
@milos-makes-maps
@milos-makes-maps 5 ай бұрын
CRAN if it's a released version, or a GitHub repo if it's a development version
@jdaking7648
@jdaking7648 5 ай бұрын
Great, thank you sir
@technoplus6895
@technoplus6895 6 ай бұрын
after rendering i got totally pink png,why is that
@milos-makes-maps
@milos-makes-maps 6 ай бұрын
That's not good. Can you check if you downloaded the tiles and loaded them into R?
@Rohit-tx7bm
@Rohit-tx7bm 6 ай бұрын
Which programming language use hare?
@milos-makes-maps
@milos-makes-maps 6 ай бұрын
R
@Rohit-tx7bm
@Rohit-tx7bm 6 ай бұрын
Ok sir.
@johanesmachela
@johanesmachela Жыл бұрын
Greetings, and thank you for your incredible efforts! I am highly interested by this project, and I made an attempt to replicate the work by utilizing your provided code. unfortunately, I encountered an issue when attempting to run it. especially at this function forest_height_mosaic
@milos-makes-maps
@milos-makes-maps Жыл бұрын
Greetings! Thanks for your kind words and for your interest in my tutorial! Your message tells me that a missing object rather than SpatRaster was passed to terra. This would suggest that forest_height_rasters could be empty. If this is true, then you need to check if you are loading the raster files from your designated working directory. Can you, please, check if this is the case?
@johanesmachela
@johanesmachela Жыл бұрын
@@milos-makes-maps Yes its, some place there is empty.
@milos-makes-maps
@milos-makes-maps Жыл бұрын
@@johanesmachela Ok, so the next step is to make sure that the place where you downloaded your raster files is the same as your working directory in R. Can you check if they match? getwd() is the command in R to print your current working directory
@shynei6601
@shynei6601 4 ай бұрын
Hi Milos, very nice tutorial. Unfortunately, I have weird things happening.. If you, or someone else can help me please I've taken the data from France. At the step of plotting the map with ggplot, it only renders a part of the map (I have downloaded all the data I need) and shows me this warning message: " Warning message: Raster pixels are placed at uneven horizontal intervals and will be shifted Consider using `geom_tile()` instead. " I tried to use geom_tile() but it didn't work. Also, in the next step (yes, I tried even though the one before was weird), it didn't render anything (I got a white window), and gave me some weird errors/warnings: " Error: '\U' used wError: '\U' used without hex digiError: '\U' used without hex digits in character string (:4:36) Error: '\U' used without hex digits in character string (:4:36) Errorror: '\U' using (:4:36)Execution halted Executi: '\U' useded without hex digits without hex digits in character string (:4:36) in cExecution halted on halted Execution halt Execution halted iExecution halted ts in characteng (:r string 4:36) haract(Eer strinxecution hg (:4:36:4:36) d Execution halted Error in makePSOCKcluster(names = spec, ...) : Cluster setup failed. 12 of 12 workers failed to connect. In addition: Warning messages: 1: Raster pixels are placed at uneven horizontal intervals and will be shifted Consider using `geom_tile()` instead. 2: Raster pixels are placed at uneven horizontal intervals and will be shifted Consider using `geom_tile()` instead. " Thanks
@milos-makes-maps
@milos-makes-maps 4 ай бұрын
Hey, it's a pity that you can't replicate my code. You can ignore the warning message. About the long and obscure error: please update rayshader with all it's dependencies
@shynei6601
@shynei6601 4 ай бұрын
@@milos-makes-maps ​Thank you for your help, updating rayshader and all it's dependencies didn't help. However, I found that making the multicore parameter to false fixed the error for me.
How to Create 3D Terrain with Google Maps and Blender!
12:17
CG Geek
Рет қаралды 1,9 МЛН
Import Copernicus climate data via API,  process netCDF and map with ggplot2
1:33:00
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 118 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 33 МЛН
Slow motion boy #shorts by Tsuriki Show
00:14
Tsuriki Show
Рет қаралды 8 МЛН
Stunning 3D Forest Type Maps with rayshader in R
44:49
Milos Makes Maps
Рет қаралды 10 М.
How to map population Change GHSL Data in R [2024]
29:35
Milos Makes Maps
Рет қаралды 7 М.
Create stunning Urban Maps with QGIS and the QuickOSM Plugin
9:03
Open Source for Architects
Рет қаралды 13 М.
Create Stunning 3D River Basins in R using HydroSHEDS Data and rayshader
46:33
How to Create Amazing Eurostat Maps in 2024 with R and ggplot2
45:37
Milos Makes Maps
Рет қаралды 1,6 М.
Re-creating Trippy AI-Generated Terrain Contours
10:10
John Nelson Maps
Рет қаралды 15 М.
3D elevation and urban area maps with R
45:02
Milos Makes Maps
Рет қаралды 2,4 М.
Spatial Data Mining I: Essentials of Cluster Analysis
1:07:14
Esri Events
Рет қаралды 133 М.
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 118 МЛН