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 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. API
In this post, we will take a look at the open data on 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:-


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.

Thursday, August 23, 2018

Cartographic Map Layout Designs


An important characteristic of maps is that they need to be both functional and aesthetically pleasing. Therefore, designing a quality map is more than just a scientific process, it takes your creativity, artistic and design skills to get the job done.

The craft of map making is called cartography, which is both the art and science of map making.

Well prepared map should contain the following elements on its map layout design:- map body, legend, title, north arrow (directional indicator), labels, scale, grid/graticule lines, citation, border and inset map.

Map Elements

1~ Map body: This is usually the largest element on a map layout. It is the primary focus on a map layout as it shows/display the geographical message and purpose of the map.

2~ Legend: This is the map element that lets the map reader know what each symbol on the map stands for. It help in understanding what information is been communicated on the map.

3~ Title: This is usually the largest text of the map and provides a short, descriptive, statement about the purpose of the map, and may include  other pertinent information, such as the timeframe for which the map applies.

4~ North arrow (directional indicator): This is the map element that tells the map reader the North, South, East and West directions on the map.

5~ Labels: These are textual elements written to further explain what an object is on the map. Most at time, map user will need explicit information apart from the on on the legend, so the "Labels" are there to help out. Often, it is in the attribute table of the features.

6~ Scale: This is the ratio of measurements on the map to that on the true ground. It is usually displayed in linear graphic or written text.

7~ Grid/Graticule lines: There are references a coordinate, or measurement system, that the map user can use to derive the location, coordinates.

8~ Citation: This is also know as "Metadata". It is the documentation for the map and the data displayed on the map. Metadata should include items such as the date the map was created, the author of the map, and data sources for the data shown on the map body.

9~ Border/Neat line: This is a frame for the map which typically surrounds the entire map. It separate the map from the surrounding page or elements.

10~ Inset map: This is a smaller map body that shows from which the main map body was extracted from. It help in making sense of where the main map is located especially for unfamiliar maps.

Sunday, August 19, 2018

Transforming Nigeria Minna Coordinates (epsg: 4263) to WGS 84 (epsg: 4326) using QGIS


Different countries have different local coordinate geographic reference systems (CRS), Nigeria is not an exception. One of the most developed and used local geographic CRS in Nigeria for general mapping is the "Minna  (epsg: 4263)".

EPSG - "European Petroleum Survey Group" is the organization in charge of maintaining different datum, coordinate reference systems and coordinate transformations around the world which may be global, regional, national or local in application. It is also worthy to know that the organization is also called: "International Association of Oil and Gas Producers" (IOGP).

A search on for "Minna" reveals both geodetic and projected CRS. Our focus in this article is on the newest Minna geodetic (geographic) datum with EPSG code 4263, that has it measuring units in degrees as seen below.

Note that there is a deprecated version of the Minna datum with EPSG code as: 62636405

"Minna" geodetic datum was first derived from the "Nigerian National Coordinates System" which is no longer in use. "Minna" geodetic datum is suitable for use in Nigeria - onshore and offshore. "Minna" references the Clarke 1880 (RGS) ellipsoid and the Greenwich prime meridian. Minna origin is Fundamental point: Minna base station L40. Latitude: 9°38'08.87"N, longitude: 6°30'58.76"E (of Greenwich). Minna is a geodetic datum for Topographic mapping.

It has the following Extent: 2.66°E, 1.92°E, 14.65°N, 13.90°N (upper long., lower long., upper lat., lower lat.).

Friday, August 10, 2018

Getting Google Maps API key in 2018

If you are an old developer who uses the Google Cloud Platform Console developer's tools such Google Maps API key to power application, you will notice that getting a copy of the maps API key has slightly changed in the month of July, year 2018.

Unlike in previous years, when signing up for a copy of the key is just a matter of having a Google account and then putting up a simple request. Today, Google do request for credit card information before the sign-up process is completed. So, the big question now is: Is there no more FREE quota for the Google Maps API key anymore?

Creating a Google Maps API Key
Even though, Google now requests for your credit card information before the sign-up for a key there is still the free quota usage on the API key as usual. Google says: the reason why it request for the credit card information before the sign-up, is to make sure bots/robots don't sign-up for the keys. Also, there is no auto charge on your card when you use up the free trial/quota on your key.

Before you are charged, you will have to manually upgrade your key to a paid plan.

Saturday, July 28, 2018

How to Extract Accurate Point Coordinates and Heights from Google Earth

In this post, we will use free software to extract height/elevation/altitude of points above sea level for any location in the world from DEM (digital elevation model) databases. This is fairly good data for drawing contour maps, draw a profile of a track or to colorize points by height above sea level.

The sources of the elevation data is from a DEM (digital elevation model) databases as explained below:-

DEM data sources
USGS: NED The U.S. Geological Survey's excellent National Elevation Dataset covers the United States, Canada, and Mexico. 1 arc-second (~30-meter) horizontal resolution is available in most areas (NED1). For Alaska, 60-meter data is also available (NED2). 
NASA: SRTM1 NASA's SRTM1 database (from the Space Shuttle Radar Topography Mission) has a resolution of about 30 meters. Previously, SRTM1 data was only available for the United States (and was not very useful because NED1 is generally better), but recently NASA has released SRTM1 tiles for the entire world. GPS Visualizer's server does not contain the full global dataset, but it does contain all of Europe, Japan, South Korea, and Taiwan, as well as parts of Australia, New Zealand, and South Africa. Additional locations will be installed upon request. 
ASTER: The ASTER GDEM is a joint product of NASA and the Japanese Ministry of Economy, Trade, and Industry (METI). ASTER has very good 30-meter coverage of the entire world, but the awkward download process and the massive size of the database make it impractical to store all of it on ASTER files for Iceland are available, however, since none of the other 30-meter databases cover that area. (As with SRTM1 data, additional files can be added upon request.) 
NASA: SRTM3 NASA's SRTM3 dataset includes 90-meter resolution for the entire world.

Monday, July 23, 2018

GIS Base map with Web Map Service (WMS)

Web Map Service (WMS) is a convenient way for an organization to publish or share spatial datasets online that can be readily used in GIS. WMS is a popular standard for publishing maps on the internet.

WMS is hosted on a remote server. Similar to a website, you can access it as long as you have a connection to the server. WMS is a standard protocol that serves geo-referenced map images using data from a GIS database.

With WMS you have access to a live service that will automatically refresh its view if you pan or zoom on the map. So, you always have access to the latest and upto date published data.

WMS are perfectly use as background maps for GIS project. It can be used on web, mobile and desktop GIS applications. All you need is the WMS getURL (GetMap or GetCapabilities) from any of the organizations that publish or share spatial datasets online.

Some WMS organizations are:-
1~ USGS:
2~ Boundless Geo:
3~ Mundialis:
4~ Terrestris:
5~ Geofabrik:
6~ The Hug:
7~ Omniscale:
8~ WhereGroup:
9~ Sinica:

Friday, July 20, 2018

Difference between GeoJSON and TopoJSON

In the Geospatial industry, data handling and conversion is a vital skill especially when data are been moved from on platform to another.

Some data formats work better on one platform than another. For example, data in shapefile format are more flexible on desktop apps than on web apps. If you are looking for an excellent data format to use on the web, then "GeoJSON and TopoJSON" data formats are your best option. But what is the difference between "GeoJSON and TopoJSON"?

In this post, I will attempt to differentiate the two powerful web based geospatial data formats (GeoJSON and TopoJSON).

GeoJSON is an open standard format designed for representing simple geographical features, along with their non-spatial attributes. Both GeoJSON and TopoJSON are based on JSON, the JavaScript Object Notation.

As extracts from Noah Veltman of and Mike Bostock (and other contributors to the TopoJSON extension) repectively:-

GeoJSON and TopoJSON are two web-friendly file formats for geographic data.
A GeoJSON file is a text file with a list of features and, for each one, a bunch of latitudes and longitudes describing its geometry.
A TopoJSON file is similar, but instead of storing the latitudes and longitudes directly, it describes the topology (geometrical properties and spatial relations of figures) of a group of features, meaning the borders between them. TopoJSON files are usually much smaller, but require a little bit of extra processing in the browser when you want to display one on a map, and can potentially lose details from the original latitudes/longitudes.

TopoJSON is an extension of GeoJSON that encodes topology. Rather than representing geometries discretely, geometries in TopoJSON files are stitched together from shared line segments called arcs. TopoJSON eliminates redundancy, offering much more compact representations of geometry than with GeoJSON; typical TopoJSON files are 80% smaller than their GeoJSON equivalents. In addition, TopoJSON facilitates applications that use topology, such as topology-preserving shape simplification, automatic map coloring, and cartograms.

The advantage of TopoJSON over GeoJSON is size and encoding of topology. So, if the file size or topology of feature is paramount to you, use TopoJSON instead of GeoJSON.