Saturday, September 22, 2018

Map - Evolution of Nigerian States










Sunday, September 16, 2018

Map of the Six Geopolitical Zone in Nigeria showing total number of registered voters

There are Six Geopolitical Zone in Nigeria as listed below. The six geopolitical zones of Nigeria is a major division in modern Nigeria, created during the regime of president General Sani Abacha. Nigerian economic, political and educational resources are often shared across the zones (source wikipedia).



North Central (loosely known as Middle Belt):

  • Benue
  • Kogi
  • Kwara
  • Nasarawa
  • Niger
  • Plateau
  • Federal Capital Territory


North East:

  • Adamawa
  • Bauchi
  • Borno
  • Gombe
  • Taraba
  • Yobe


North West:

  • Jigawa
  • Kaduna
  • Kano
  • Katsina
  • Kebbi
  • Sokoto
  • Zamfara


South East:

  • Abia
  • Anambra
  • Ebonyi
  • Enugu
  • Imo


South South:

  • Akwa Ibom
  • Cross River
  • Bayelsa
  • Rivers
  • Delta
  • Edo


South West:

  • Ekiti
  • Lagos
  • Ogun
  • Ondo
  • Osun
  • Oyo

Friday, September 14, 2018

Quick Python Guide to Extracting Data from MyFantasyLeague.com API

Introduction to API
Many organizations uses the Application Program Interface (API) to allow developer access some of their data. Access to data set via API is usually controlled by using the "API Key or client ID" which can be obtain by registering for free or at some cost.

A data set that changes quickly is better served through an API instead of a static database. To access the API data you have to send request to the remote server where the data lives. In most cases, an API data lives on the remote server in XML or JSON format.

To learn more about specific API structure make sure you take a look at it's documentation which is usually made available by the provider.


MyFantasyLeague.com API
In this post, we will take a look at the open data on MyFantasyLeague.com API. Specifically, we will send request to get the "players" data. The process discussed here will work for any request type with little or no modification.

First, before you continue I recommend you read the developer API page.

Step 1: Identify where the data lives and get its request url
From the request test page, you will that the players' data lives on this url below:-
XML = http://www03.myfantasyleague.com/2018/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=0


JSON = http://www03.myfantasyleague.com/2018/export?TYPE=players&DETAILS=&SINCE=&PLAYERS=&JSON=1


Step 2: Get the url and parse it into python
Now that we know where the data we needed is located, we parse it into python. I prefer using JSON, so I will use the JSON url to collect the data into pandas data frame for further processing.


Note that you will need to identify the JSON element root and child to get hold of the data in pandas. To easily identify the element roots, use an online JSON reader such as this...



If everything was successful, the above script should produce the dataframe table below:-





Step 3: Do something useful with the dataframe data. You can save it to a database or CSV file.


That is it!

Sunday, September 2, 2018

Simple Map Animations using QGIS and GIMP

Hello there,
It is no longer new that most aesthetically pleasing maps out there have some of it elements accomplished with photo or graphics editing software.

In this post, you will see the important of having a graphics editing tool in your GIS tool set. We will use QGIS to generate the maps and then use GIMP to animate the maps for to present the map to our potential client.

Have a feel of what an animated map is below. It is the map of edo state, Nigeria displaying various levels of details on a single GIF image file.



Animated maps are good for showing time series data. Basically, this may involves illustrating the changing of same object over time in the same area or the simultaneous movement of different objects across an area over time.