How to map population Change GHSL Data in R [2024]

  Рет қаралды 7,610

Milos Makes Maps

Milos Makes Maps

Күн бұрын

Пікірлер: 36
@ShubhamKumar-mc3ud
@ShubhamKumar-mc3ud 10 ай бұрын
You are doing an awesome job. Love it.
@emanuelagu5392
@emanuelagu5392 8 ай бұрын
This is awesome, @milos-makes-maps! Thanks for the tutorial. Can GAMD boundary files be loaded in R through a function such as giscoR()? I'd like to try out how the map looks with those boundaries instead of the ones from the GISCO database.
@milos-makes-maps
@milos-makes-maps 8 ай бұрын
Thanks! You can use geodata package, which has a function called gadm. Using this you can access administrative subnational levels for any country in the world
@emanuelagu5392
@emanuelagu5392 8 ай бұрын
Thanks, Milos! I'll try this command. I've been manually downloading the GADM shapefiles so far, but I rather prefer to load the files (either as shapefiles or geopackages).
@lbarq
@lbarq 11 ай бұрын
Thank you for this amazing tutorial. Always learning from you.
@milos-makes-maps
@milos-makes-maps 11 ай бұрын
Thank you for your kind words, Luis! I'm happy that my tutorials help you learn!
@bkenminator
@bkenminator 8 ай бұрын
I've tried a few of your tutorials recently and have found them to be excellent and easy to adapt for other countries/regions. I'm wondering whether you would be able to explain how the get_categories function doesn't throw an error when you feed its results into as.factor() method? When I call get_categories(pop_change) it gives me a spatial raster object which as.factor won't accept. Thanks!
@GOATMENTATOR
@GOATMENTATOR 11 ай бұрын
All I have ever coded is two pretty basic graphs in R. Let's see if I can manage to replicate this for my country based on your video :D
@GOATMENTATOR
@GOATMENTATOR 11 ай бұрын
Ok I did it, but I am going to be honest - there is no art in copying your code without understanding pretty much anything :D
@milos-makes-maps
@milos-makes-maps 11 ай бұрын
Hahaha, I'll take it as a compliment! Well done, btw
@rparis729
@rparis729 11 ай бұрын
Thanks for the tutorial, really nice and clear! I would just make a remark, aren't the uninhabited places actually places without changes? I mean, it can be inhabited but if there were no pop changes the result would be also 0... anyway, just conceptual, and not really related to the tutorial itself... thanks again
@milos-makes-maps
@milos-makes-maps 11 ай бұрын
That's a great point and it definitely makes sense to also label them "places without population change"
@emanuelagu5392
@emanuelagu5392 8 ай бұрын
Hi @milos-makes-maps, I'm using your script to draw the map for the US. What projection and/or rearrangement for Alaska and Hawaii would you suggest using in this case? Without using Lambert, the ggsave() ends in error because the US map exceeds 50 inches (and getting rid of the width and height parameters, or using limitsize = FALSE yields a map with disproportionate and dislocated title size). Thank you!
@emanuelagu5392
@emanuelagu5392 8 ай бұрын
I have made some changes to your script to generate a map of the United States. The map has been successfully generated, but I need to adjust the projection in the shapefile to move Alaska and Hawaii to the southwest corner. Can you guide me on how to do this using the same shapefiles that you use for the European Union maps? Thank you.
@brianmccormick8384
@brianmccormick8384 10 ай бұрын
wonderful stuff thank you. Now, to work out how to export it as a shapefile!
@milos-makes-maps
@milos-makes-maps 10 ай бұрын
Hey Brian, you made a really nice map of the population change for Germany 👏🏻. Thanks for sharing it on X! Do you mean to transform the population change raster into a shape file?
@emanuelagu5392
@emanuelagu5392 8 ай бұрын
Hi @milos-makes-maps, I still need help adjusting the projection for countries whose territories extend over several meridians and parallels (mostly because their territories include islands), such as France, Spain, Portugal, and the US. The maps for those countries end up being distorted. Any hint will be welcomed! Thanks.
@andreidoanca4262
@andreidoanca4262 11 ай бұрын
cool tutorial
@milos-makes-maps
@milos-makes-maps 11 ай бұрын
Thanks! Glad you enjoyed it!
@IrakliKavtaradzepsyche
@IrakliKavtaradzepsyche 9 ай бұрын
DO you think it's possible to create a base map layer, then overlay population density layer and turn the second (density) layer into 3D with ray shader but keeping base map layer 2D at the same time?
@milos-makes-maps
@milos-makes-maps 9 ай бұрын
That sounds like a great idea for another tutorial 😃
@IrakliKavtaradzepsyche
@IrakliKavtaradzepsyche 9 ай бұрын
@@milos-makes-maps I hit the deadens while searching it and I don't think it's possible in ray shader but I'll be happy to be wrong ))
@samuelbrown9634
@samuelbrown9634 10 ай бұрын
can you please help with this error " w h
@milos-makes-maps
@milos-makes-maps 10 ай бұрын
Hey, this means that pop_change_cats object wasn't created in the first place. Can you traceback to see why?
@samuelbrown9634
@samuelbrown9634 10 ай бұрын
Yes I have severally, I even copied the code on github and pasted into the console, I had the same output, I don't know what I'm missing.
@samuelbrown9634
@samuelbrown9634 10 ай бұрын
I'm using the R console
@milos-makes-maps
@milos-makes-maps 10 ай бұрын
@@samuelbrown9634 what happens when you run this line: pop_change_cats as.factor()
@RioReads
@RioReads 9 ай бұрын
Can we make such maps for a predicted population of a plant species?
@milos-makes-maps
@milos-makes-maps 9 ай бұрын
Does the format of the data correspond to the population data?
@RioReads
@RioReads 9 ай бұрын
​@@milos-makes-maps As a result after running the model, you get a .tif file indicating the predicted species population in a region. Can I connect with you on a better platform for some details like mail or something?
@JorgeFilipeITV
@JorgeFilipeITV 5 ай бұрын
> country_pop_rasters
@milos-makes-maps
@milos-makes-maps 5 ай бұрын
It seems like you're encountering an error with the `terra::crop()` function in R, which suggests that the extents of the raster (`pop_rasters`) and the vector (`country`) do not overlap. This is required for the crop operation to work correctly. Here's how you can troubleshoot this issue: 1. Check Projections: Ensure that both the raster and vector data have the same coordinate reference system (CRS). You can use `terra::crs(pop_rasters)` and `terra::crs(country)` to check the CRS of both datasets. 2. Examine Extents: Compare the extents of the raster and vector data using `terra::ext(pop_rasters)` and `terra::ext(country)`. They must overlap for the crop to succeed. 3. Transform if Necessary: If the CRS differs, you may need to transform one of the datasets to match the other using `terra::project()`.
@reksakridawasesa4350
@reksakridawasesa4350 8 ай бұрын
Hi Milos, I've had this error: > get_country_borders country_pop_rasters
@bkenminator
@bkenminator 8 ай бұрын
The first one might be caused by using the wrong code - I think the ISO code for Bangladesh is just "BD". That may also solve your second issue of the CRSs not lining up. If not, you can go through and check the CRS of the country vector and those of the rasters and reset them accordingly prior to cropping.
@milos-makes-maps
@milos-makes-maps 8 ай бұрын
I managed to get the country boundaries using your code, but can you show us the contents of pop_rasters file?
3 easy ways to map population density from gridded raster in R
35:42
Milos Makes Maps
Рет қаралды 3 М.
How to Create Amazing Eurostat Maps in 2024 with R and ggplot2
45:37
Milos Makes Maps
Рет қаралды 2,1 М.
This mother's baby is too unreliable.
00:13
FUNNY XIAOTING 666
Рет қаралды 39 МЛН
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 325 М.
Create Stunning 3D River Basins in R using HydroSHEDS Data and rayshader
46:33
How I animate 3Blue1Brown | A Manim demo with Ben Sparks
53:41
3Blue1Brown
Рет қаралды 591 М.
Mastering Dot Density Maps in R: Population Insights Unleashed
36:00
Milos Makes Maps
Рет қаралды 1,5 М.
Comprehensive Course on Python's Matplotlib
57:35
TheDataProf
Рет қаралды 8 М.
Stunning 3D Forest Type Maps with rayshader in R
44:49
Milos Makes Maps
Рет қаралды 11 М.
Custom Transformer Shatters All Voltage Records (ft. 3D Printing Nerd)
21:23
3D elevation and urban area maps with R
45:02
Milos Makes Maps
Рет қаралды 4 М.
NSA Releases Internal 1982 Lecture by Computing Pioneer Rear Admiral Grace Hopper
1:29:36
The Black Vault Originals
Рет қаралды 252 М.
How to Create Amazing Precipitation Maps with R in 2D and 3D
35:56
Milos Makes Maps
Рет қаралды 2,7 М.
The Oldest Unsolved Problem in Math
31:33
Veritasium
Рет қаралды 11 МЛН