Making crisp spike maps with R

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ธ.ค. 2024

ความคิดเห็น • 57

  • @victorhm21
    @victorhm21 ปีที่แล้ว +2

    This is fantastic!! Thank you for putting in the time to share this with us.

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      You're welcome! Thanks for the nice feedback. It gives me the fuel to create more content

  • @Aaqib..
    @Aaqib.. ปีที่แล้ว +5

    I follow you on twitter and the maps and visualisations are amazing, i had no idea but that you have a TH-cam channel too🤩

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว +1

      Hi Aaqib, thanks for following my work and for your kind words! I've recently opened the TH-cam channel 😁

  • @lbarq
    @lbarq ปีที่แล้ว +1

    Amazing. Great tutorial. I'm looking forward to your next video, as a suggestion, the forest density of a country, using rayshader package.🙂

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว +1

      Thanks for your support and I'm happy that you find it useful! The forest map is definitely on my to-do list 😁

  • @bjmoreno100
    @bjmoreno100 ปีที่แล้ว +1

    You have a very nice tweak of R

  • @AleksPopovic
    @AleksPopovic ปีที่แล้ว +1

    Very interesting tutorial Milos!

  • @mahatmaalimibrahim6631
    @mahatmaalimibrahim6631 ปีที่แล้ว +1

    great as usual. Thank you.

  • @edodanilyan
    @edodanilyan 7 หลายเดือนก่อน +1

    Fantastic tutorial, thank you. I am wondering how to overlay a shp file containing border and the name of the cities etc with this type of map?

    • @milos-makes-maps
      @milos-makes-maps  7 หลายเดือนก่อน

      Thank you! I think you could try out my tutorial on mapping 3D river basins where I pass shapefile to rayshader:
      th-cam.com/video/fIOCVCxh2B8/w-d-xo.html
      Let me know how it goes!

  • @weitzun9691
    @weitzun9691 6 หลายเดือนก่อน +1

    Hey Milos, if I want to replicate the other country, besides change the ISO 2 code (line 28) , the Lambert Projection (line 47) also need to be changed as well right ?

    • @milos-makes-maps
      @milos-makes-maps  6 หลายเดือนก่อน

      Hey, you should change the projection if you are working on a map of a non-European country. I usually go for country-specific projections at epsg.io. You can find more about it here: th-cam.com/video/piswxAEwnYo/w-d-xo.htmlsi=FMwY9ueNwQFVVAiI
      Jump to 13min55sec

  • @rigocaruso
    @rigocaruso ปีที่แล้ว +1

    Hi Milos! Thanks for this series of videos, I'm learning a lot of stuff.
    One question about this one, basically due to my little knowledge of functional programming: what are you asking R to do exactly with these two lines of code?
    width_ratio

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว +1

      Hey, thanks for your question! I'm happy that you are in exploring R for data visualization. In this specific function called get_raster_size we calculate the height and width of the raster based on the distance between the minimum and maximum latitude/longitude points. Based on the width and height, we calculate their ratios and store both measures in a list. The first element of the list is width_ratio and the second is height_ratio. The reason why I call the function with appended [[]] is to take a member of the list. This is how you access list members. If you pass the number like this [[1]] that means you grab the first member of the list. Hope this clarifies my code!

    • @rigocaruso
      @rigocaruso ปีที่แล้ว +1

      Unfortunately I get an error message when trying to launch the render_highquality() function:
      Error in rayvertex::validate_mesh(mesh) :
      !any(is.na(normals)) is not TRUE
      Any idea why this happens?

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      Can you update rayshader, rayrender and rayvertex?

    • @rigocaruso
      @rigocaruso ปีที่แล้ว

      @@milos-makes-maps I did, but I still get the error message :(

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      @@rigocaruso hmmm, I ran out of ideas so it would be good to open the issue in the rayshader or rayvertex GitHub repo

  • @lutzbenson
    @lutzbenson 11 หลายเดือนก่อน +1

    Thanks a lot for this fantastic tutorial!
    I tried to adapt your code for a part of Switzerland, the canton of St.Gallen. Unfortunately, I always get the folloowing error message:
    Error in rayrender::obj_model(cache_filename, x = -bbox_center[1], y = -bbox_center[2], :
    unused argument (texture = TRUE)
    Do you have any idea what my be the reason? Is it possible that's because I used another projection? I switched the projection of the Kontur data to Swiss National System (d.pop_ch

    • @milos-makes-maps
      @milos-makes-maps  11 หลายเดือนก่อน

      Hey, please install the most recent dev versions of rayshader and rayrender.
      remotes::install_github("github.com/tylermorganwall/rayshader")
      remotes::install_github("github.com/tylermorganwall/rayrender")

    • @lutzbenson
      @lutzbenson 11 หลายเดือนก่อน +1

      Thanks! After switching from R 4.2 to 4.3 and doing the remote installations it worked. 🙂

    • @milos-makes-maps
      @milos-makes-maps  11 หลายเดือนก่อน +1

      @@lutzbenson Fantastic! Enjoy R and make some cool maps 😎

  • @tamarac3843
    @tamarac3843 ปีที่แล้ว +2

    Great tutorial - very comprehensive yet clear! I really appreciate the time and effort that you're putting into making these tutorials :)
    I've managed to create the map of Germany using your tutorial, and wanted to try my hand at making another map for France. However, when following the tutorial and I get to the 'get_population_data()' section of the code, I keep getting this error message 'Error: Path exists and overwrite is FALSE'. I'm not sure what I'm doing wrong, or what the work around is, so if you have any suggestions, then that would be great!
    Thanks in advance!

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว +1

      Thanks a lot for your feedback & encouragement! About the error: you are most likely getting this error because you provide the same file_name to R. Trying naming it france-population and let me know if it works!

    • @tamarac3843
      @tamarac3843 ปีที่แล้ว +1

      Hi @@milos-makes-maps just wanted to update you and can confirm that this was the issue I was facing!
      I have just one other question - in the code I'm setting the background to be white, but when I export the map and save it, the background is no longer white and is an off grey colour. I'm not sure why it's coming out like this but it's making it harder to see the colours and spikes. Do you have any ideas? I was following your code as well.

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      Hi @@tamarac3843, happy that it worked out for you in the end! You are absolutely right that the background comes out darker even when you use white background. It happened to me many times (and still happening from time to time 😁). That's because of the way rayshader renders the scene. Your background will always be lighter or darker depending on the intensity of your scene lights. so, try to increase the light intensity and see where it takes you!

  • @Geotechdev
    @Geotechdev ปีที่แล้ว +1

    Thanks for the amazing work.
    My question est literally basic.
    What's the software you're using?
    I can't guess.
    Thanks for all the work

    • @Geotechdev
      @Geotechdev ปีที่แล้ว +1

      The thing is that I'm new to R :)

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      Thanks for your kind words and I'm glad that you chose R 😁. I run R in VSCode. If you are interested in setting up R in VSCode for Windows, I have a tutorial for you: th-cam.com/video/k79H8EeR5Jo/w-d-xo.htmlsi=y6heQ6VmY0sdGaMk

  • @stevecarufel8353
    @stevecarufel8353 10 หลายเดือนก่อน +1

    It seems R/my computer is unable to load the very first ggplot() call - I don't have a powerful machine but I thought it would do? Does everyone have a big powerful pc here? Only have an Intel i5 8th gen, 8 gb ram and the stock graphics card...
    Edit : finally rendered (the first one) but needed quite some time

    • @milos-makes-maps
      @milos-makes-maps  10 หลายเดือนก่อน +1

      Rendering with rayshader takes quite some time especially on less powerful machines

  • @arham_mtl
    @arham_mtl ปีที่แล้ว +1

    Great tutorial! Amazing work. I am seeing this error when I am trying to export/render the graph with lighting. Any ideas why?
    Error in rayvertex::validate_mesh(mesh) :
    !any(is.na(normals)) is not TRUE
    >

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว +1

      Thanks, much appreciated! I used to get that error until recently, too, but then I updated rayshader and its dependencies and the error is no more

  • @abdulrashidhassan7649
    @abdulrashidhassan7649 ปีที่แล้ว +1

    Hello Milos, nice Tutorial, please would this work if I want to try for the European LAU level

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      Hi Abdulrashid, I haven't tried it on the LAU data yet. Can you, please, give it a try and let me know how it goes?

  • @HritikaParekh
    @HritikaParekh ปีที่แล้ว +1

    Great video, thanks for this! However, while running "pop_sf

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      Hmmm, check if you defined your crs beforehand

  • @danielfallas3112
    @danielfallas3112 ปีที่แล้ว +1

    How can I put labels and titles on the map?

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      Hey, I cover that in this tutorial: th-cam.com/video/peLyCb0sN4k/w-d-xo.html

  • @bkryasim
    @bkryasim ปีที่แล้ว +1

    Can it be applied to show refugees and IDPs in a country? Or it needs more info

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว +1

      Yes, you can use my tutorial to create spike maps of refugees and IDPs as long as the data is in shapefile format

  • @arieldome530
    @arieldome530 ปีที่แล้ว +1

    Hello may I ask about something, I always got this error message when i about to export the image. What do you think is the main problem for this? Is it on my Mac or idk, thank you for your help.
    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  ปีที่แล้ว

      Hey Ariel, thanks for reaching out to me with this error message. I remember this error message from my Mac, too. It disappeared when I updated both the rayshader and rayrender packages. Did you try that step?

    • @arieldome530
      @arieldome530 ปีที่แล้ว +1

      @@milos-makes-maps will try to update both of them after i finish studying my lectures and school homeworks. Thank you so much! Looking forward for another amazing tutorials from you. As a student, it was so very helpful for me!!!

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว

      @@arieldome530 Fantastic! I'm happy that my tutorials are helping you navigate the GIS waters in R!

    • @arieldome530
      @arieldome530 ปีที่แล้ว +1

      @@milos-makes-maps yes i will!!! I will also follow you on your socials.

    • @arieldome530
      @arieldome530 ปีที่แล้ว

      @@milos-makes-maps hi, i sent you a dm on Twitter to show to you the result of the map that i created.

  • @kunalbali810
    @kunalbali810 ปีที่แล้ว

    Nice tutorial. What should be crsLAEA for the Indian region?

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว +1

      Thanks! For India, I would first try crsLAEA

    • @HritikaParekh
      @HritikaParekh ปีที่แล้ว +1

      @@milos-makes-maps Had the same question, thanks! Where do you get these estimated from?

    • @milos-makes-maps
      @milos-makes-maps  ปีที่แล้ว +1

      @@HritikaParekh Hi, I just googled CRS for India and found the suggestion on stackexchange or stackoverflow

  • @matej6418
    @matej6418 ปีที่แล้ว

    Ppl still use R in this day and age?