Mapping uninhabited areas with R

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 ก.ค. 2024
  • In this tutorial, I will show you how to use the Global Human Settlement Layer (GHSL) data to map uninhabited areas for any place on planet Earth with R, terra, and ggplot2.
    0:00 Prologue
    01:10 Intro
    01:44 Load libraries
    03:46 GHSL data
    05:35 Download GHSL data
    06:43 Load GHSL data
    07:55 Australia shapefile
    09:13 Crop GHSL with Australia shapefile
    10:12 Australia raster to dataframe
    10:59 Inspect dataframe
    11:29 Change column name
    13:22 Map uninhabited areas
    20:31 Final map
    20:50 Closing
    Check the full code in my GitHub repo:
    github.com/milos-agathon/map-...
    Follow my work on Instagram:
    / milos_makes_maps
    Let's connect on Twitter:
    / milos_agathon
    If you like my work, consider buying me a coffee:
    www.buymeacoffee.com/milospop...
    Music credits:
    ---------------------------------
    "Danlsan - Darling" is under a Free To Use on TH-cam license
    Music promoted by BreakingCopyright: bit.ly/b-darling

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

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

    Another banger tutorial!

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

      Thank you, I'm happy you like it! ☺️

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

    Excellent tutorial with a fascinating dataset!

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

      Thank you for your kind words. I'm happy you enjoyed the tutorial and found the dataset fascinating. I appreciate your feedback and support. I’m always looking for new ideas and challenges for future tutorials. If you have any topics or datasets that you would like me to explore, please let me know. I’m open to suggestions. Happy coding!

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

    Was waiting for this 😍😍

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

      Awesome! It's finally here! Enjoy!

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

    Excellent! Definetly going to try this.

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

      Thank you for your support and enthusiasm, Victor. It motivates me to create more tutorials like this. If you have any suggestions or requests for future topics, please let me know. I’m always open to new ideas and challenges. 😊

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

    Excellent, my GIS skills are getting better & truly standing on the shoulders of giants(Milos) makes a big difference

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

      my internet connection was a bit slow this morning so my connection was timing out. I have to put this line of code options(timeout = max(600, getOption("timeout"))) before the download.file() method.

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

      I'm happy that you resolved the issue!

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

      Thank you for your amazing comment. I'm honored that you consider me a giant in this field. I’m curious to see your final map!

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

    Simply awesome and super easy. I made it for Pakistan to get it insight. I hope you ll not mind for using your codes. Thanks

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

      Thank you for your kind words! Not at all, this tutorial and its code are meant for R enthusiasts like you

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

    this is great!

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

      Thanks! I hope it helps you!

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

    Great. Thank you alot.

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

    😮 Neat

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

    ¡Great!

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

    waiting for new tutorial😊😊😊😊

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

    Hello Milos, I would like to thank you for your tutorials for I have learnt a lot from them. but how can I calculate such area?

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

      Thank you! You can calculate the area size of uninhabited areas using terra package. First, filter only raster values that are equal to 0. Let's say your original raster file is called ras. Then you should run: ras_new 0, NA, ras). Second, compute the area size of each cell in square kilometers
      ras_new_area

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

    What a wonderful tutorial. I look forward to exploring your others. I have a question I suspect there is an easy answer to, but I am stuck. I used your tutorial and code as template, and attempted to make a similar uninhabited areas map for Argentina. However, when I view the output the country appears very distorted (stretched horizontally). I can confirm that both the Spat Raster object and the country border vector are in the same projection (WGS 84), so I do not *think* it is a projection issue. But what I see is definitely not how Argentina appears on WGS84-projected maps...
    Thanks!

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

      Thank you for your kind words! I suspect that the map of Argentina is stretched because WGS84 is not great with areas closer to the poles. Do you know what is the standard coordinate reference system for Argentina?

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

      @@milos-makes-maps Thanks for replying. I have tried to reproject the raster into a more appropriate projection, bu still it looks very distorted 😕 I would love to understand where I am going wrong. Here is what I did after the point of creating the get_country_borders() function:
      country

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

      @@camsnouse Ah I see what you mean. I think that you'll get a better result if you use the South America Equidistant Conic projection:
      +proj=eqdc +lat_0=-32 +lon_0=-60 +lat_1=-5 +lat_2=-42 +x_0=0 +y_0=0 +ellps=aust_SA +units=m +no_defs

  • @darioezequieldiaz5090
    @darioezequieldiaz5090 9 หลายเดือนก่อน

    Hello! I am from Argentina. Query: where did you get the source of population data by area? from INDEC? of the 2010 or 2022 census?

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

      Hello, it's all explained in the video: Global Human Settlement data

    • @darioezequieldiaz5090
      @darioezequieldiaz5090 9 หลายเดือนก่อน

      @@milos-makes-maps I will consult Global Human Settlement data, which is the source of data collection, because I believe that the only official statistics organization in Argentina is the INDEC, which carries out the population census. Thank you. Greetings

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

    sir ,in here i have a question .how do you say 0(value) is inhabitant(no settlements).what is indicated by value column .because all the process is based on this. if it is grateful ,you can say concise answer.

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

      Hello, the value column shows the estimated number of people, according to GHSL. That's why we compute the presence of uninhabited areas based on this column

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

      @@milos-makes-maps sir i got three different map of year 2000,2010 and 2020.but all map are same in detailed .i am confusing about that

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

      @@sandunpriyankarasomarathna9281 There is data for 2020 and every five years preceding and succeeding it. Did you mean 2015, 2020 and 2025?

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

    sir .I have a request, can you do the kind of map which show the atmospheric pollution in particular country in particular year .and how it change the across the country. Because this topic is very common in these days

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

      Hello, I've created one on CO2 emissions but it's not about making a time lapse map so I might make one on animating air pollution. Thank you for the idea!

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

      @@milos-makes-maps thank you sir

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

    sir,i am doing gis project using r programing.i have to face some technical issues some are solved .can i cantact you through email to find out some solutions for that

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

      Hi, I’m sorry to hear that you have some technical issues with your project. The best way would be to open a GitHub repo and store your working code there, and send me an email with a description of what you want to achieve and the link to the repo. This would be the best mode of collaboration for me

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

      @@milos-makes-maps okay sir.i will do that