Code Monkey home page Code Monkey logo

migrationsmap.net's Introduction

MigrationsMap.net

This is the code of the site http://madewulf.github.io/MigrationsMap.net/ (previously at: http://migrationsmap.net), including the scripts used to generate the JSON data files.

The code is under MIT license.

Don't hesitate to contact me at [email protected], or via twitter: http://twitter.com/madewulf if you have any question.

Data Generation Process

The map has been generated using four data sources:

  • A csv file: global_migrant_origin_database_version_4.csv, containing all the migrations number from country to country. It is really just a matrix of country-to-country migrations number, addressable by country code.
  • world.json, a geojson file containing the borders data of all countries in the world, addressable by the countries full English name
  • The world bank data, which provide indicators, like AIDS prevalence, for every country in the world, addressable by year and country code.
  • The google geolocation API, to find out the "central" coordinates of a country (the point to which arrows will be pointing when pointing to a country)

Here is the process used to generate the json data files used by the map:

  1. Run functions (mainly, geolocalize_the_world and load_matrices) from parser.py, which, from global_migrant_origin_database_version_4.csv (provided), will generate two files:

    • code_to_name.json: a json object allowing to find the full English name of a country corresponding to a country code in ISO 639 format (ex: BEL -> Belgium)
    • geoloc.json: a json object containing the dump of all geolocalization requests sent to Google. Beware, since Google was not able to geolocalize correctly some name (for example, Georgia result is the US state, not the Country), the file has been edited manually a bit, and rerunning the function will reintroduce the errors.
  2. Run arrowcomputer2.py, which, from the matrixes of migrations data generated by parser.py from the csv file and the coordinates in geoloc.json, will generate two file per country in the 'generated' directory. Those file contains ten svg paths, one per "arrow" to be drawn on the map when clicking on the country, each one associated with the corresponding migrations number. There are two files per country: one for the incoming migrants and the other for the outgoing migrants, called for example for the USA: inUSA.json and outUSA.json. Arrowcomputer2.py also generates in the process the file code_to_coordinates.json, which is a json object/dictionary allowing to find for each country code, the corresponding central coordinates. (the map size specified in geojsontosvg.py is used to compute the size and positioning of the arrows).

  3. Run geojsontosvg.py, which, from world.json and a map size (specified directly in the file), will generate the file world_svg_paths.json, which is a json object allowing to get, for each full English country name , the borders in as svg paths. The projection is an equirectangular one (if I understood correctly).

  4. Run associate_map_to_db.py, which is a lousy interactive script allowing to solve the problem of the full English country names that are not matching exactly in the data coming from the csv files and the world.json file. For example, Myanmar is referred as Burma in one of the file and United States is not an exact match for United States of America. This script will generate the file reconciliation.json, which matches the problematic country names with the corresponding country code.

  5. Run jsoncsvunifier.py which, from world_sv_paths.json and reconciliation.json will generate the final borders-as-svg file : world_svg_paths_by_code.json, which is a json object allowing to get, for each country code, the borders in as svg paths.

  6. Run worlBankDataGetter.py (I know, I should definitely enhance my file naming conventions), to download the indicators data from the world bank api and store them in json files : GDP per capita (GDP.json), mortality under five (UNDER-FIVE-MORTALITY.json), tuberculosis prevalence (TUBERCULOSIS.json), HIV prevalence (HIV.json) and population size (POP.json)

To run those python scripts, you will need to install the python Requests library first.

migrationsmap.net's People

Contributors

madewulf avatar

Stargazers

ruban link avatar  avatar  avatar  avatar Angelos Chouvardas avatar Cat  avatar rodrigotrovao avatar Janice Ngiam avatar YC L avatar  avatar  avatar Victor Demin avatar Gianr Lazz avatar Gualberto Vannini avatar Harry avatar  avatar Zhenzhen Zhao avatar Nancy avatar  avatar ireinstein avatar  avatar Isnaeni Hidayat avatar Bridie Pearson-Jones avatar Erdong avatar Viacheslav Vasiliev avatar Gustavo Lacoste avatar Yuri Vikentiev avatar George Baptista avatar TiX avatar Jernej avatar Ian Flores Siaca  avatar Dmytro Chornyi avatar  avatar ahimsauzi avatar Trevor Owens avatar Manfredi Giordano avatar Narendran Thangarajan avatar Jasper Brener avatar Angus H. avatar Serge Stinckwich avatar Nidhal Selmi avatar  avatar GUCCHAN avatar Nigel avatar Kwamena Appiah-Kubi avatar Giacomo Giudice avatar Kengur avatar Akasuki Nakamura avatar Andy Lee avatar Donsen Hong avatar Malek Cellier avatar Alin Mechenici avatar pingpingya avatar  avatar Ibnu Hajar avatar Boris Köster avatar Stjepan avatar  avatar Pana avatar JT5D avatar Jose Carlos Pajuelo  avatar Amiruddin Nagri avatar Nelson Young avatar Sarah M Reidy avatar  avatar Antonio Caputo avatar Nicolas Embleton avatar Alexander Tsvetkov avatar Christian Benseler avatar Ngo Hung avatar Jianlin avatar Konrad avatar Fırat Gelbal avatar  avatar Lawrence Hans Matjeni avatar  avatar  avatar George Pilitsoglou avatar 'Kayode Akanni avatar Michael Wiss avatar Jonathan Webster avatar Alice avatar Anupam Chandra avatar Marco Bonomo avatar Cristian Giordano avatar Hernán Silva avatar Miloš Jovanović avatar Emir Uz avatar Rouffi avatar 姚文强 avatar Christian Krause avatar Praveen Vedanth avatar Jason Loftis avatar  avatar Luca De Vitis avatar Roberto Santana avatar Rich Kuo avatar David Lemayian ✨ avatar Aaron Williams avatar  avatar

Watchers

 avatar Kwamena Appiah-Kubi avatar Jason Lewis avatar James Cloos avatar  avatar Karl Noelle avatar Ibnu Hajar avatar Donsen Hong avatar Sarah M Reidy avatar Rafael Rebeca avatar Jasper Brener avatar Sabar Suwarsono avatar Matteo De Stefano avatar  avatar Ian Flores Siaca  avatar Janice Ngiam avatar

migrationsmap.net's Issues

MigrationsMap.net website out of scope

Hey @madewulf,

Looks like the domain name MigrationsMap.net is now owned by some chinese person/firm. Is the former website content still available somewhere? If it's the case, would be great to at least indicate the new location in this repository description.

Ano dos dados

Antes de mais parabéns por esta aplicativo.
Queria saber a que ano são os dados das migrações?
Obrigado

new

My name is Luis, I'm a big-data machine-learning developer, I'm a fan of your work, and I usually check your updates.

I was afraid that my savings would be eaten by inflation. I have created a powerful tool that based on past technical patterns (volatility, moving averages, statistics, trends, candlesticks, support and resistance, stock index indicators).
All the ones you know (RSI, MACD, STOCH, Bolinger Bands, SMA, DEMARK, Japanese candlesticks, ichimoku, fibonacci, williansR, balance of power, murrey math, etc) and more than 200 others.

The tool creates prediction models of correct trading points (buy signal and sell signal, every stock is good traded in time and direction).
For this I have used big data tools like pandas python, stock market libraries like: tablib, TAcharts ,pandas_ta... For data collection and calculation.
And powerful machine-learning libraries such as: Sklearn.RandomForest , Sklearn.GradientBoosting, XGBoost, Google TensorFlow and Google TensorFlow LSTM.

With the models trained with the selection of the best technical indicators, the tool is able to predict trading points (where to buy, where to sell) and send real-time alerts to Telegram or Mail. The points are calculated based on the learning of the correct trading points of the last 2 years (including the change to bear market after the rate hike).

I think it could be useful to you, to improve, I would like to share it with you, and if you are interested in improving and collaborating I am also willing, and if not file it in the box.

If tou want, Please read the readme , and in case of any problem you can contact me ,
If you are convinced try to install it with the documentation.
https://github.com/Leci37/LecTrade/tree/develop I appreciate the feedback

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.