Blog

Viewing posts for the category QGIS

Show only features within current Atlas feature - QGIS 3

Posted by: Admire Nyakudya | in QGIS | 3 months, 1 week ago | Comments

In our endless endeavour to spread QGIS, I was invited to conduct QGIS training at the Surveyor General Department in Swaziland.

Creating a live, topic specific mirror of OpenStreetMap in PostGIS

Posted by: Tim Sutton | in Docker, PostGIS, QGIS | 3 months, 3 weeks ago | Comments

Introduction

In this article, we will do a walk-through of creating a live mirror of OSM for a specific country or region and for a specific set of OSM features. For this example, we will fetch all building data for Angola into a PostGIS database, and update that database with new features as they arrive in OSM. Providing an OSM mirror in this way is a powerful tool to pair the power of OSM with the power of QGIS and PostGIS. Now you will be able to do offline analysis of the data in OSM. How does this all work? Here is a little diagram that illustrates the underlying architecture (click for a larger version):

How to make beautiful lollipop call out labels in QGIS

Posted by: Tim Sutton | in QGIS | 4 months, 2 weeks ago | Comments
Call out labels are a handy cartographic instrument for attaching labels to features on the map where you want the label to be offset from the feature being labelled. It allows you to prevent the map becoming overcrowded. I call the variant I describe here 'lollipop' labels because the 'callout line' is rendered with a decorative ball at the end.
Generating the callout geometry

I am using logic like this to make callout labels using a geometry generator:
make_line(
closest_point($geometry,
make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" )),
make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" )
)
The line runs from the closest point along the edge of the polygon to the bottom left corner of the label box. With this configuration it works well when my ‘lollipop’ callout label is north-east of the polygon being labelled:
But doesn’t work when the label is e.g. south-west of the polygon as the label falls over the call out line:

Using NOTIFY to automatically refresh layers in QGIS

Posted by: Tim Sutton | in PostGIS, QGIS | 4 months, 3 weeks ago | Comments

One of the most brilliant but little-known features of QGIS is the ability to trigger layer refreshes and events in response to notifications from PostgreSQL. This was developed by the wizards from Oslandia and is easily added to any existing table in your PostgreSQL database - including PostGIS tables. This feature was added in version 3.0 (see https://qgis.org/en/site/forusers/visualchangelog30/#feature-trigger-layer-refresh-or-layer-actions-from-postgresql-notify-signal). Take for example this simple table:

How to easily add South African and Namibian toposheets as XYZ tiles to QGIS

Posted by: Tim Sutton | in QGIS | 7 months, 2 weeks ago | Comments

Thanks to the great work of Grant Slater and the OpenStreetmap team, there are freely available XYZ tilesets for South Africa and Namibia 1:50 000 series toposheets which can easily be added to QGIS. Here is the general procedure to add a layer:

Adding elevation to a line from a DEM in PostGIS and maintaining accurate measures

Posted by: Gavin Fleming | in PostGIS, QGIS | 1 year ago | Comments

This is the second in a three part series on the behind-the-scenes GIS work that can go into planning a complex event, in this case the Cape Town Marathon.

How to create a point distance marker layer along a line in PostGIS

Posted by: Gavin Fleming | in GRASS GIS, PostGIS, QGIS | 1 year ago | Comments

This is part 1 of a 3-part series.

QGIS, InaSAFE, OpenStreetMap, and GeoNode in Understanding Risk 2018

Posted by: Ismail Sunni | in Conference, GeoNode, InaSAFE, QGIS | 1 year, 2 months ago | Comments

Some QGIS 3 Browser Improvements - Small Things Matter

Posted by: Admire Nyakudya | in QGIS | 1 year, 5 months ago | Comments

Well, QGIS 3 has been out for a couple of weeks now with lots of new functionality. While you are still feeling your way around all the new features I thought I could highlight some of the improvements to the browser panel that will make you fall further in love with QGIS. 

A new plugin to manage land (survey) parcels in QGIS

Posted by: Admire Nyakudya | in QGIS | 1 year, 6 months ago | Comments

Kartoza releases the CoGo Plugin for QGIS

Kartoza recently published the CoGo Plugin (aka Parcel Plugin) in the QGIS plugin repository. This plugin expands the group of plugins designed to manage SDI (Spatial Data Infrastructure). CoGo ('coordinate geometry') refers to its ability to handle both types of coordinates used in land surveying, namely cartesian coordinates (x,y; long/lat) and polar coordinates (bearing and distance).

Changing the line direction of line features using the geometry generator in QGIS

Posted by: Admire Nyakudya | in QGIS | 1 year, 10 months ago | Comments

I have been playing around with roads layers and wanted to change the line directions for some of my features. I looked around for solutions to do this in QGIS and saw that I could use the swap vector direction plugin in QGIS or ST_reverse in PostgreSQL. But I wanted to find a non destructive way to do this as I did not want to alter my data. I decided to try the geometry generator in QGIS.

How to resolve issues with QGIS 3 Processing Dialog Layouts on MacOS

Posted by: Tim Sutton | in QGIS | 1 year, 10 months ago | Comments

If you are using QGIS 3 master builds on MacOS and encounter issues with the display of processing dialog layouts like this:

Create a custom reference grid in QGIS composer

Posted by: Gavin Fleming | in QGIS | 1 year, 10 months ago | Comments

If you need to create a reference grid like this for your map, here's a simple method.

Report back on the first QGIS User Conference in Nødebo, Denmark

Posted by: Gavin Fleming | in Education, QGIS | 4 years, 2 months ago | Comments

I finally have some time to sit down and write up some thoughts on the QGIS User Conference and Developer Meeting (aka Hackfest) that we just held in Nødebo, Denmark. First up I need to thank Lene Fischer, who was the organiser and wowed us all with her relaxed and competent organisational approach to the conference. Thanks also to the University of Copenhagen School of Forestry - they sponsored the event by providing the venue and accommodation - and the venue was absolutely awesome with little cottages in the forest and all sorts of interesting diversions scattered around the forest. Lene gave me a list of names of people who helped to organise the event - I am sorry I have only got your first names but a very big thank you to you all!

How to run a Linux GUI application on OSX using Docker

Posted by: Gavin Fleming | in Docker, QGIS | 4 years, 3 months ago | Comments

Ok so here is the scenario:

Generating an XYZ ASCII file from a QGIS raster

Posted by: Gavin Fleming | in FOSSGIS, QGIS | 4 years, 5 months ago | Comments

Someone wrote to me asking if it would be possible to generate an XYZ ASCII file from a single band raster layer in QGIS. No doubt there are more efficient ways (this approach is pretty slow but it works), but I thought it would be fun to show how you can iterate over a raster, writing out the value of each cell into a text file (along with the centroid coordinates for that cell).

How to create a QGIS PDF report with a few lines of python

Posted by: Gavin Fleming | in FOSSGIS, QGIS | 4 years, 5 months ago | Comments

Sometimes you want to automatically generate a report to reflect the latest state of your data. For example you may be capturing spatial data into a PostGIS database and want a snapshot of that every few hours expressed as a pdf report. This example shows you how you can quickly generate a pdf based on a QGIS project (.qgs file) and a QGIS template (.qpt file).

QGIS course at AfQUA

Posted by: Gavin Fleming | in Education, QGIS | 4 years, 6 months ago | Comments

Kartoza has just wrapped up a three-day Introduction to QGIS course that we gave pro bono at The African Quaternary: Environments, Ecology and Humans conference in Cape Town (AfQUA2015). Thank you to Kelly Kirsten from the local organising committee at the University of Cape Town for inviting us. Admire Nyakudya presented to about fifteen conference delegates from around the world. Attendees ran QGIS 2.6.1 on their own notebooks on the operating system of their choice. Some already use QGIS, some were experiencing QGIS for the first time and some some wanted to compare it with ArcGIS. The course content was guided largely by the QGIS training manual but as we usually do, adapted for the requirements, interests and pace of the class.

How to load a QGIS project in python

Posted by: Gavin Fleming | in QGIS | 4 years, 7 months ago | Comments

Today in a project we are working on we wanted to load a QGIS project. It takes  surprisingly few lines of code to make a small standalone application that loads a project and then shows it as a map in a window like this:

A quick hack to select all multipart features in QGIS

Posted by: Gavin Fleming | in FOSSGIS, QGIS | 4 years, 7 months ago | Comments

Today we wanted to find all the multipart features in this layer:

Template by Blacktie Mezzanine theme by CodingHouse