Create Stunning 3D River Basins in R using HydroSHEDS Data and rayshader

Publicado 2023-11-26
In this video, you will learn how to use HydroSHEDS data, which is a high-resolution global dataset of hydrographic features, such as river networks, watersheds, and drainage basins to create a 3D elevation and river basin map of Poland, a country in Central Europe with diverse landscapes and hydrology.

Chapters

0:00 Intro
00:43 Packages
03:07 Turn off spherical geometry
03:22 Poland boundaries
04:50 Download rivers
06:06 Unzip rivers
08:19 Query
10:36 Load rivers
11:14 Plot rivers
11:33 Overlay Poland
12:28 Get river basins
16:44 Clip rivers with basins
17:59 Assign color palette to rivers
23:05 Assign color palette to basins
25:12 Assign river width
28:59 Digital elevation model
30:51 Render scene
40:43 Render object
45:41 Looking ahead

Check the full code in my GitHub repo:
github.com/milos-agathon/3d-river-basin-map

Follow my work on Instagram:
www.instagram.com/milos_makes_maps

Let's connect on X:
twitter.com/milos_agathon

If you like my work, consider buying me a coffee:
www.buymeacoffee.com/milospopovic

HCL-based color palettes:
blog.r-project.org/2019/04/01/hcl-based-color-pale…

Music credits:
---------------------------------------------------------------------------------------------------
massobeats - honey jam
Original upload HERE -    • massobeats - honey jam (royalty free ...  

Todos los comentarios (21)
  • Thank you so much for the clear and spectacular tutorials. I created the river basin map of Afghanistan using the instructions with some modifications. It turned out to be a piece of art 🖼️ so thanks again. Keep doing what you do.
  • @AliMunirFarooqui
    Hi Milos I am new to R programming and have been following along your tutorials for past few weeks and throughly enjoying the experience , just a quick question which IDE are you using? because the help files popups look quite helpful in this one , it doesn't appear on Rstudio
  • @koubeen16
    It was very benefits didn't know that R can do this much ! Thank you I Have a question where do I get the lambert projection transformation? Again thank you very much
  • @Hamzahnahmad
    Sir, may i ask what apps you used to create this map? is it Visual Code Studio or RStudio? I'm from Indonesia and i'm planning on doing what you're doing but with watershed around my hometown.
  • @serhatcetin7836
    Hello Milos. Do we need to write the places written as "##########" at the beginning of the video and as it progresses? This confused me a little. Thanks.
  • Hello Milos, my computer did not do very well with the rendering, what capacity is needed and I assume that if a smaller area is used the rendering will be less complicated
  • The Final map you posted on this video doesn’t looks like on R studio! How did you produced it???
  • Hey Milos I love your vids they explore exactly what I love to do in R! I was working through this video and got stuck around step 3 when creating the country_basin object. Heres what I have: country_basin <- sf::st_read( "hybas_eu_lev04_v1c.shp" ) |> sf::st_intersection(country_sf) dplyr::select(HYBASE_ID) This is the output: Reading layer `hybas_eu_lev04_v1c' from data source `/Users/tomascontreras/hybas_eu_lev04_v1c.shp' using driver `ESRI Shapefile' Simple feature collection with 240 features and 13 fields Geometry type: MULTIPOLYGON Dimension: XY Bounding box: xmin: -24.54232 ymin: 12.59131 xmax: 69.55452 ymax: 81.85898 Geodetic CRS: WGS 84 Error in wk_handle.wk_wkb(wkb, s2_geography_writer(oriented = oriented, : Loop 69 is not valid: Edge 1870 has duplicate vertex with edge 1874
  • @0611131civil
    Dear Milo. What are teh system requirements. and what is the processing time.
  • @philtaylor4071
    Hi Milos, really great tutorial thank you. I have run through it, but at the render scene stage, R returns this error Error "in grDevices::png(filename = tempoverlay, width = width, height = height, : unable to start png() device" Any clue toi how I should trouble shoot this?
  • @rollas260
    Bom dia, Me perdoe o amadorismo, mas vc está usando o R Studio? ou é em Python? qual software digito esses códigos? grato desde já.