Tuesday, September 27, 2016

Converting Shapefile to GeoJSON


Introduction


If you are like me that often produce web based maps often, you will definitely come across situations were you have to convert the most popular geospatial file format (Shapefile) into the most popular web programming language file format - JSON (thta is: GeoJSON in our case since we care more about location elements).

Before I gone to show how you will convert a shapefile to a GeoJSON, let me briefly explain what a JSON file format is and why it is important to us.


What is JSON?


JSON is a short hand for "JavaScript Object Notation". Though JSON has the name JavaScript it can be used in all different languages since most languages have libraries to parse the JSON data.

JSON is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. It is a lightweight format that is used for data interchanging. It is based on a subset of JavaScript language (the way objects are built in JavaScript). It is a much-more compact way of transmitting sets of data across network connections as compared to XML.

JSON values can consist of: objects (collections of name-value pairs) arrays (ordered lists of values) strings (in double quotes) numbers true, false, or null. JSON is language independent.


What are JSON files?


JSON files are the files which contain JSON data. They are saved with a file extension:  .json

Conventions used by JSON are known to programmers, which include C, C++, Java, Python, Perl, etc. For instance, in Python programming the awareness of the built-in data structures such as Tuple, List, and Dictionary will help you understand JSON/GeoJSON object.



What does it look like?


A simple json structure may look like this:-

"author":
{
"name" : "Umar Yusuf",
"age" : "23",
"gender" : "male",
"url" : "http://www.UmarYusuf.com"
}

Storing JSON: data as a simple example, information about me might be written in JSON as above.

Storing JSON Data in Arrays: a slightly more complicated example involves storing information about two people. To do this, we enclose multiple objects in square brackets, which signifies an array. For instance, if I needed to include information about myself and my brother, it will look like this below:-

[{
"name" : "Umar Yusuf",
"age" : "23",
"gender" : "male"
"url" : "http://www.UmarYusuf.com"
},
{
"name" : "Musa Kallamu",
"age" : "37",
"gender" : "male"
"url" : "http://www.mk.com"
}, ...]


Nesting JSON Data: Another way to store information about multiple people would be to nest objects. To do this, we would create something similar to the following:

{
"Umar":{
"name" : "Umar Yusuf",
"age" : "23",
"gender" : "male"
"url" : "http://www.UmarYusuf.com"
},

"Musa":{
"name" : "Musa Kallamu",
"age" : "37",
"gender" : "male"
"url" : "http://www.mk.com"
}, ...

}


Uses of JSON


~ It is used while writing JavaScript based applications that includes browser extensions and websites.
~ JSON format is used for serializing and transmitting structured data over network connection.
~ It is primarily used to transmit data between a server and web applications.
~ Web services and APIs use JSON format to provide public data.
~ It can be used with modern programming languages.

Saturday, September 24, 2016

Spatial Analysis of Nigeria 2015 Presidential Election Result Using Tableau

Introduction


This is another spatial version of analysis on the "2015 Nigerian Presidential Election Result using python programming language".

Unlike the way we performed the spatial in QGIS with two data sets (Shapefile and CSV files), using Tableau the approach is different.

Spatial and Non-spatial (Attribute) Datasets


With Tableau, you just need to connect to an attribute dataset and the spatial information is generated on the fly as long as it contains some fields/columns identify by Tableau as have geographic role.

The attribute dataset of the 2015 presidential election result from INEC website. Convert is to data source format recognized by Tableau (e.g: csv, excel, database, sql, sas etc). In this case, am converting it to a csv file format.


Friday, September 23, 2016

Spatial Analysis of Nigeria 2015 Presidential Election Result Using QGIS


Introduction


This is the spatial version of analysis on the "2015 Nigerian Presidential Election Result using python programming language".

In this spatial analysis, I will analyze and visualize the “Presidential Election Result” dataset on a map of Nigeria showing individual states boundary. Basically that is what spatial analysis is all about.



Let’s get started…

Friday, September 16, 2016

Research Topics in Surveying and Geo-Informatcs

Hello there,

I often get such question like: How to get project or research topics related to these fields -  land surveying, Surveying and Geo-Informatics, Geomatics Engineering, Geo-spatial Information System (GIS), Remote Sensing, Geodesy etc.

Today, I decided to put up a blog post in an attempt to answer this question often asked by final year students looking for project/research topics related to the fields mentioned above for their final year research project.

I will expose all I know in GIS student project ideas, GIS case studies, GIS projects, and GIS uses to you.

Friday, September 9, 2016

Creating Custom Tableau Maps from existing ShapeFile using QGIS

*** The newer versions of Tableau 10.2 and above supports reading Geospatial files directly. This article is only valid for older versions ***

For those who don't know Tableau and QGIS, here is quick introduction.

Tableau Software is an American computer software company headquartered in Seattle, Washington. It produces a family of interactive data visualization products focused on business intelligence. Tableau can help anyone see and understand their data. Connect to almost any database, drag and drop to create visualizations, and share with a click.



QGIS is a cross-platform free and open-source desktop geographic information system (GIS) application that provides data viewing, editing, and analysis. QGIS is a user friendly Open Source Geographic Information System (GIS) licensed under the GNU General Public License.

Monday, September 5, 2016

Web-based Mapping and Statistics of Nigerian Presidential Election (2015)

Hello,

Today I will use web-based mapping and Statistical techniques to visualize and communicate some important details on the 2015 Nigerian Presidential Election Data.

I will visualize and communicate the following: Number of Accredited Voters Map, Number of Rejected Voters Map, Number of Valid Voters Map, Population Map, and Chart - Population and Accredited Voters all these will be the form of Story Map of 2015 Nigeria Elections. Also the  2015 Elections Population and Accredited Voters chart will be compared with the geographical map.



Result Map and Statistics



Voters Map and Statistics






Analysis of Nigerian Presidential Election Result (2015) using Python Programming Language

Hello,

More than a year after the "Nigerian Presidential Election Result - 2015" was released by Independent National Electoral Commission (INEC - the body that Conducts elections into elective offices in Nigeria), no single analysis of the result was performed and found online in Python Programming Language.

So, I decided to fill this space for the Python programmers. After all, Python is the most widely used Programming Language in the field of Data Science, Big Data and Statistical Analyses. Python is closely chased by R, Matlab, SAS, Julia, Java, and Scala when talking about the best programming languages for crunching data in the field of Data Science (Source).

The Nigerian election is the largest election in West-Africa and largest election among all black nations in the world.

The Presidential Election Result was announced on: Saturday, March 28 to March 29, 2015 by Professor Attahiru Jega the then Chairman of INEC. The result summary and declaration where made available for download on the INEC website.