Code Monkey home page Code Monkey logo

population_distributions's Introduction

Population distributions and densities

Population densities:

annotated population densities of several cities

Population distributions:

population distribution of New York and London

Projections

The input data for the most part is in WGS 1984 co-ordinates. That is, latitude and longitude on a spheroid approximation of the earth. This spheroid very closely resembles a sphere, with the z radius about 297/298 times smaller than the x and y radii. (The x and y radii are equal on a spheroid.)

Plotting these directly results in the equirectangular projection. This projection preserves lines of latitude but stretches apart lines of longitude. At the extreme, the poles are stretched from a single point to a line as long as the equator. Shapes will appear stretched in the x-direction. This stretching factor can be calculated as np.cos(latitude) where latitude is in radians.

For small regions this can be corrected by assuming a single stretch factor e.g. for the middle line of latitude in the region of interest.

tmerc

Source: pygis.io/docs/d_understand_crs_codes.html.

A more robust method is to use a transverse mercator projection. This wraps a cylinder around the earth. It then (1) projects points on to this cylinder and (2) stretches them out in both the x and y direction so that the mapping is conformal. That is, the object retains its shape. The central longitude directly on the cylinder is fully preserved. A third step is often added to convert this spherical projection to an ellipsoid projection.

Note that in this projection the units are not earth distances. Rather, they are earth distances multiplied by some stretch factor. However very close to the central longitude this stretch factor is approximately 1, so for a small region about it they are approximately earth distances.

Set up (optional)

Download data to the ./data folder.

Create Conda environment:

conda create --name pygeo --python=3.9

Install packages in the requirements.txt file.

Set up Conda Kernel:

conda activate pygeo
python -m ipykernel install --user --name=pygeo
conda activate pygeo
jupyter notebook

Use with Jupyter Notebook:

conda activate pygeo
jupyter notebook

Data Sources

Country and administrative boundaries from https://www.geoboundaries.org/. Runfola, D. et al. (2020) geoBoundaries: A global database of political administrative boundaries. PLoS ONE 15(4): e0231866. https://doi.org/10.1371/journal.pone.0231866

Country populations from https://hub.worldpop.org/. WorldPop (www.worldpop.org - School of Geography and Environmental Science, University of Southampton; Department of Geography and Geosciences, University of Louisville; Departement de Geographie, Universite de Namur) and Center for International Earth Science Information Network (CIESIN), Columbia University (2018). Global High Resolution Population Denominators Project - Funded by The Bill and Melinda Gates Foundation (OPP1134076). https://dx.doi.org/10.5258/SOTON/WP00675

City of Johannesburg administrative regions from https://data.metabolismofcities.org/dashboards/johannesburg/.

population_distributions's People

Contributors

liorsinai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.