Methodology

The study area selected for collection of geo-tagged tweets data is of South Punjab. The map below shows the study area.




Twitter2QGIS:

After identifying the study area, we have configured freely available open source plugin “twitter2qgis” with QGIS. This plugin is still in the experimental state and requires the ‘’tweepy’’ package to be installed manually by the user. The installation process of tweepy involves number of steps and requires other packages to be installed first. Initially a .bat file is to be created using the the path for multiple variables, hence a .bat file was created and the following content was added to it:
SET PYTHONHOME=C:\Program Files\QGIS 2.16\apps\Python27
SET PYTHONPATH=C:\Program Files\QGIS 2.16\apps\Python27\Lib
SET PATH=%PYTHONHOME%;%PYTHONHOME%\Scripts;C:\Program Files\QGIS 2.16\bin;%PATH%

This file was named as pyhtonpath.bat and was run using command line (run as administrator). Then setuptools was downloaded and installed using the following command:

Finally after installing setuptools, tweepy package was installed using the following command:


This tool requires twitter access tokens and keys to pull geo-located tweets. To get these tokens and keys an app was created on apps.twitter.com and required information was retrieved.
Twitter2qgis is slow and often leave qgis in the not responding state, the tool is under experiment to be used for downloading geo-tagged tweets data for districts of South Punjab.  After getting the points data for tweets, we have used QGIS heat map generation to get an intensity visualization of the party popularity.
The results of heat map are then spatially joined with the District/Halka boundaries to assign these scores to the District/halka boundaries. The data of the required districts available on the Election commission website is documented in an excel file. The data fields added in the excel file contain the total number of voters as per the previous elections, the voting percentage and then the party ranking on the basis of votes gained.  The data collected is shown in the table below:
Digitizing Halka Boundaries:
The map was geo-referenced and district boundaries were added over the map. These district boundaries were then edited according to the map below. The figure below

Data for the required halka’s was collected form the ECP site and documented in an excel file. The excel file is shown below:



Flow chart:

No comments:

Post a Comment