Sunday, August 28, 2016

Embedding MatPlotLib figure in wxPython GUI


wxPython comes with a simple plotting library called PyPlot which is an improvement over wxPlotCanvas, which is now deprecated. PyPlot features include zooming, legends and a grid. Possible graphs: scatter, line, and bar graphs.

So why do we worry to embed matplotlib if wxPython has a plotting by defualt? The simple answer is because of the rich features available in matplotlib library.

I will demostrate a minimal approach to embed MatPlotLib figure into a GUI based on wxPython classic (for Python 2.7.12). This article could also be used for Python 3 on wxPython Phoenix with little modifications. The final result is shown below:-

MatPlotLib figure is a GUI with little controls/widgets, so python programmers often embed the figure into a richer GUI libarary such as wxPython, TkInter, PyQt/PySide etc in order to obtain the most advantage of a GUI application. In this article, am going to use the wxPython GUI libarary.

Wednesday, August 24, 2016

Coordinates Convertion, Downloading Images, and Web mapping with El-shayal GIS software


El-shayal is GIS software developed by group of Arabian (Egyptian) developers - Mohamed Elshayal, Salsabeel Mohamed Elshayal and Yaseen Mohamed Elshayal. It is freely available for download at this blog address:

I have been using the two major leading GIS software; ArcGIS in the commercial category and QGIS in non-commercial (open source) category. But there are some GIS tasks that I often referred to El-Shayal GIS software for completion instead of ArcGIS or QGIS simply because El-Shayal GIS software does it easily or even better than ArcGIS and QGIS.

The GIS tasks I am talking about are discussed below, and strongly recommend you to check them out in the El-Shayal GIS software:-

1) Coordinates Convertion
2) Downloading Images from Google Earth
3) Converting Shapefiles into a HTML Website (Web mapping)

I will only compare the above features of El-shayal GIS software to that of QGIS. This is because ArcGIS is already of this contest in that it is not freely available to use and here we are looking at software that deliver full featured GIS tasks at no cost.
I am using the latest versions of both El-shayal GIS software and QGIS at the time of writing. That is: El-shayal GIS software version 16.007d and QGIS version 2.16.0.NØdebo

Let’s get started…

Thursday, August 18, 2016

Data Srapping, Analysis and Visualization with Python

Hello there,

From the title of this post, you should already know that we are about to explore the concepts of Data Science. That is to say: we are going to mung for data, clean the data and try to derive meaningful information from the dataset.

In other for us to be comfortable in carrying out the above task, we need some kind of Hacking skills, Math & statistics knowledge and Substantive expertise in the data we intend to use.

Ok, don't worry am going to keep things simple so everyone can follow along. And the dataset we are going to use is ready available for the public (so no much hacking to get the dataset!).

Dataset and Python libraries

The dataset we are going to use is the "Birthday list" on home page (i.e: NairaLand Forum Members' Birthday Data). We will attempt to answer some useful questions on the dataset.

Monday, August 15, 2016

How to learn GIS Programming with Python by self-taught


Let me guide you on how to learn GIS Programming with python by yourself (self-taught).

Self-taught GIS programmers often use Python, JavaScript, SQL, VB.NET, C++, R, Java, C, HTML, CSS etc… in that order for their day to day GIS workflow ( The focus in this article is going to be on Python Programming Language. Python has gained a lot of visibility as the primary scripting language for the big players in GIS industry: ArcGIS and QGIS.

There are several places you can learn GIS Programming with Python which I broadly classified them into any othe following:-
1) Attending a Formal School (Degree, MSc., PhD.)
2) Certification courses/trainings/workshops
3) One-on-one mentoring
4) Self-taught - read and study Books, Videos, Tutorials

If you are like me, who uses the 4th option, then this article will help you achieve your goal of being a GIS Python Programmer.

So you prefer to self teach yourself GIS Programming? I know so many questions will be ringing in your mind at the moment. Don't worry, I am going to shear with you the best way to master Python for developing geospatial applications. In this post I will try to quickly summarize what is the best way to go in my opinion. It will also show GIS people who are interested in learning more about Python how easy it is to get started, and how useful Python can be to their specific needs.

Sunday, August 14, 2016

Data Science Common Terminologies Defined

Dear Potential Data scientist,
Usually if you are starting out with a new technology, it is good to get familiar with its vocabularies and Data science is not an exception. This will help you in the long run in understand of the new field of learning.

Here are the definitions of some very useful Vocabularies or Word Lists or Glossary in the field of Data Science and its related technologies.

According to WikiPedia: Data science is an interdisciplinary field about processes and systems to extract knowledge or insights from data in various forms, either structured or unstructured, which is a continuation of some of the data analysis fields such as statistics, data mining, and predictive analytics, similar to Knowledge Discovery in Databases (KDD).

Monday, August 8, 2016

GIS Programming with Python and QGIS - Part 2

Now that I have introduced you to GIS Programming with Python and QGIS Python Console in part 1 (read part 1 here), lets dive deeper here in part 2.

In this article, am going to run you through some important basics of python GIS programming on the QGIS Python Console. This tutorial will serve as a quick crash course on geoprocessing with Python programming language. It focuses on what Geospatial scientists need. Is also a quick introduction to Python.

Since this tutorial is for the purpose of Geospatial Information System, am going to keep this basic python introduction closely involved with GIS concepts and terminologies. For example to demonstrate the use of print statement the (print() function in python 3), instead of typing {print ‘Hello World’}, I will type {print ‘Hello GIS’}. I hope you got the gist.

The primary difference between conventional programming and this GIS programming we are learning is: "the ability to relate spatial or positional elements (usually in the form of Latitude and Longitude) to GIS programming". So the goal of GIS programming is for you to be able to write script for automating and manipulating a series of spatially related tasks.

This article gives you an overview of what is available in the Python programming universe to help you with GIS programming and integrating with QGIS tools.

Now fire up your QGIS and open the Python Console.

Sunday, August 7, 2016

Analyzing Level Field Table/Book with Python


Let me try something new on level survey tabular data apart from the traditional reduction of the reduced levels from the observed Back-sight, Intermediate-sight and Fore-sight.

I know this is never a common task among surveyors. Nevertheless, am going to talk about it today. Am going to perform some unusual statistical analysis on a levelling table using python packages called numpy, pandas and matplotlib.

Levelling is the measurement of geodetic height using an optical levelling instrument and a level staff or rod having a numbered scale.

To determine the difference in level between points on the surface of the ground a 'series' of levels will need to be carried out.