home

SWire4QGIS documentation


Introduction

SWire4QGIS is a QGIS plugin which communicates with Swire, thus enabling data exchange between Stata and QGIS.


Screenshots

Screenshot thumbnail
Export numeric data from QGIS to Stata
Screenshot thumbnail
Import numeric data from Stata to QGIS

Requirements

SWire4QGIS only runs on Linux (if it must be compiled for other operating system, you may download the source code but the building process for OSs other than Ubuntu will not be documented here).

SWire4QGIS has been developed and tested for QGIS 2.14.6 but it should work for any other recent version of QGIS.

SWire4QGIS requires that SWire has been installed on Stata and the SWire server is listening on port 50000. SWire requires Stata >= 13.

The LibCurl library must have been installed in your system. Otherwise, type this command from your Ubuntu terminal:

:::bash
sudo apt-get install libcurl3-gnutls

Installation

  1. Copy the libSWire4QGIS.so.0.1 file in the QGIS plugins folder (in Ubuntu 14 it is /usr/lib/qgis/plugins/).
  2. Change the file permissions for the libSWire4QGIS.so.0.1 file by typing the following from the Ubuntu terminal: sudo chmod 644 /usr/lib/qgis/pluginslibSWire4QGIS.so.0.1.
  3. Start QGIS.
  4. Activate the SWire4QGIS plugin from the QGIS menu Plugins -> Manage and Install Plugins...

How to use

Ensure that SWire has been installed on Stata. Then start SWire in Stata, by typing the following command in Stata:

swire start

Remember that the network port on which SWire is listening must be the same of that used by SWire4QGIS, namely port 50000.

Once installed, SWire4QGIS will create the SWire4QGIS menu under the Plugins menu of the QGIS graphical user interface. There are two menu items under the SWire4QGIS menu:

  • Import from Stata...: open a modal dialog window to import data from Stata.
  • Export to Stata...: open a modal dialog window to export data to Stata.

Only numeric data importing/exporting is permitted.


Warning

Imported data and original Stata data will not numerically coincide if:

  1. the target QGIS field is not of a double precision type and
  2. the numeric values are very high.

Swire4QGIS will not report any import issue, thus please be careful!


Compilation

A compilation of SWire4QGIS requires:

  • The QGIS library, which can be installed by typing the following command from the Ubuntu terminal: sudo apt-get install libqgis-dev.
  • The messagepack-c library, which can be downloaded from https://github.com/msgpack/msgpack-c (no compilation of this library is required because it is a header-only library).
  • The LibCurl development files, which can be installed by typing the following command from the Ubuntu terminal: sudo apt-get install libcurl4-gnutls-dev.

Also see

SWire
A software interface, enabling us to query Stata for the executing of basic operations, such as reading or writing data

2016 Italian Stata Users Group Meeting, Rome 17-18 November
Abstract and slides presented at the Italian Stata Users Group Meeting 2016

SWire Web Apps Collection
A collection of web apps, interacting with Stata through SWire

SWire4js
A JavaScript library for developing SWire web applications

SWire4R
An R package enabling R to interact with Stata for exchanging data

SQuery
A web application for collecting questionnaires' responses in Stata


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.