-
Book Overview & Buying
-
Table Of Contents
QGIS Python Programming Cookbook
By :
Cloud services have become common and geospatial maps are no exception. This recipe uses a service named geojson.io, which serves vector layers online, which you can upload from QGIS using Python.
For this recipe, you will need to install the qgisio plugin using the QGIS Plugin Manager.
You will also need a shapefile in a geodetic coordinate system (WGS84) from https://geospatialpython.googlecode.com/svn/union.zip.
Decompress the ZIP file and place it in your qgis_data directory named shapes.
We will convert our shapefile to GeoJSON using a temporary file. We'll then use Python to call the qgisio plugin in order to upload the data to be displayed online. To do this, we need to perform the following steps:
from PyQt4.QtCore import * from PyQt4.QtGui import * from qgis.core import * from tempfile import mkstemp import os from qgisio import geojsonio
Change the font size
Change margin width
Change background colour