Create Eye-Catching 3D Elevation Maps with a Sleek Inset Map
ฝัง
- เผยแพร่เมื่อ 6 ก.ย. 2024
- In today's tutorial, we're diving deep into the realm of 3D elevation maps with inset maps, also known as study area maps. We'll harness the power of ggplot2 and rayshader in R to transform your data into stunning, high-definition 3D landscapes.
Check the full code in my GitHub repo:
github.com/mil...
Follow my work on Instagram:
/ milos_makes_maps
Let's connect on X:
/ milos_agathon
If you like my work, consider buying me a coffee:
www.buymeacoff...
Polyhaven HDRI file
polyhaven.com/...
Music credits:
---------------------------------------------------------------------------------------------------
Music By: massobeats - midnight (lofi aesthetic music)
Original upload HERE - • massobeats - rose wate...
Thank you so much for the tutorial! I was wondering how to put certain points and visualize those on the map? I'm using this map to show a type locality for a particular species and I want to put those coordinates as points on the map. Thank you for your help!
My pleasure! You could add point coordinates using the sf package like I did in this intro tutorial: th-cam.com/video/iDURRHzM2aA/w-d-xo.html. You might face issues with the rendering stage because of two layers. Let me know how it goes
@@milos-makes-maps Thank you so much, I'll try it out now.
Thank you so much for the tutorial! You explained everything so well.
Excellent tutorial. Thank you for sharing.
Thank you very much 🙏🏼!
Error in plot_3d(., (t(1 - mapheight)), zscale = 1/scale, triangulate = triangulate, :
unused argument (window.size = c(699.5, 764))
I'm having a hard time with this line of code,
# 5. RENDER SCENE
> #----------------
> h w rayshader::p lot_gg(
+ ggobj = map,
+ width = w / 500,
+ height = h / 500,
+ scale = 50,
+ solid = FALSE,
+ shadow = TRUE,
+ shadowcolor = "white",
+ shadowwidth = 0,
+ shadow_intensity = 1,
+ zoom = .7,
+ phi = 87,
+ theta = 0,
+ window.size = c(w /4, h /4)
gives me the following error, I've tried with different values that I don't know
Sorry, I made a typo: it should be windowsize. I changed it in my GitHub repo now
@@milos-makes-maps Thanks Milos, check these details in code as well.
Country and Region Polygons: Here there is a small typo. Regions_sf was defined but then region_sf was used instead of regions_sf. Also, there is a typo in the function sf::st_geometry(region_sf), where it should be sf::st_geometry(regions_sf).
2D Map: Here, I think the pallete argument should be palette in the hcl.colors function.
Object Rendering: There seems to be a typo in the terrra::project(crs_lambert) function, which should be terra::project(crs_lambert).
Inset Map: Here, in the call to geom_sf() there is a missing comma in linewidth = .1, which should be linewidth = 0.1.
after that: everything works great. My congratulations for your work.
@@elisaurysuarez5927 thank you for your support and for flagging these issues!
Thank you for all your posts. I try almost all of them by myself. It makes my job better than ever. But I get an error with the codes of this tutorial; when I try step # 5. RENDER SCENE I receive an error message as "Error in png::readPNG(colormaptemp) : unable to open C:\Users\BEYCAN~1\AppData\Local\Temp\RtmpUnrRo5\file2740da25e7.png". I look up to the temp folder and there was not such an png file. What is the possible mistake I have done?
Hey, could you, please, set a working directory and check if that helps fix the error?