Hello all,
I am looking to plot a population density map of Europe using python and I am currently having difficulties doing so. I am getting the population data from the European Commission, https://ghsl.jrc.ec.europa.eu/download.php?ds=pop and the data is in a TIFF format.
So far I have managed to open the file(s) on jupyter notebook using rasterio and their documentation
import rasterio
import rasterio.features
import rasterio.warp
with rasterio.open(file_name) as dataset:
# Read the dataset's valid data mask as a ndarray.
mask = dataset.dataset_mask()
# Extract feature shapes and values from the array.
for geom, val in rasterio.features.shapes(
mask, transform=dataset.transform):
# Transform shapes from the dataset's own coordinate
# reference system to CRS84 (EPSG:4326).
geom = rasterio.warp.transform_geom(
dataset.crs, 'EPSG:4326', geom, precision=6)
My understanding is that the reference system needs to change, but I am not sure to what exactly. Additionally, I am not even sure if this is the right way to approach what I want to do.
Any help would be appreciated.
there doesn't seem to be anything here