Monday, February 26, 2018

Export Shapefile Attribute to Text File using PyQGIS

Hello there,

Lets use QGIS python scripting (PyQGIS) to create a text file of attributes from a shapefile.

Here I loaded onto QGIS a point layer representing capitals of Nigeria states with four attributes namely: "State_name", "Capital", "Area" and "Population".

Open the python console and with the point layer selected on the layers panel, enter the code below on the console to create an active layer object.
layer = iface.activeLayer()

Wednesday, February 14, 2018

Deploying python Flask web app on Amazon Lightsail

Hello there,

Let me start off this with this question "What is Flask and Amazon Lightsail"?

Chances are you already know what a Flask web framework is (a light weight python web framework), so I will only give a brief on Amazon Lightsail before we deploy a simple flask app on it.

Amazon Lightsail is a Virtual Private Servers (VPS) which enables you to easily set up servers on the Amazon Web Services (AWS) cloud. It is also a fast and simple VPS hosting service from Amazon.

Alternatives to Amazon Lightsail include Heroku, DigitalOcean, Linode, Microsoft Azure etc

How to deploy Flask applications on a Virtual Private Server (VPS) running Ubuntu OS, Apache server, and WSGI

Step 1: Use your existing Amazon account or sign up for a new to subscribe for a LightSail VPS service. You can get this for as low as $5 per month.

Step 2: By now you should have you flask app fully developed and ready for deployment. My app is a simple one that doesn't require a database, so I will skip and for of database configuration.