Page 2 of 76 (1505 posts)

  • talks about »


Last update:
Sun May 24 20:10:08 2015

A Django site.

QGIS Planet

In memory of Tim York

The other weekend the world lost a great guy, someone so nice that you struggle to find anything bad to say about him at all. Tim was only 27 but died tragically on the weekend, to the complete shock of everyone that knew him. I don’t think anyone really knew what to feel at that point, and even now it is still really hard to take it.

Tim was very well known in the GIS space here in Australia, and extremely well respected by everyone that knew him. I attended Locate15, where I was going catch up for a beer and chat with him, and almost everyone I talked to knew who he was and how great he really was. I would not doubt at all he could have become CEO or leader at a large company, no doubt at all.

It was mentioned at the funeral that we should try to think of how Tim made our lives better. For that I can fully thank Tim for my job at DMS. It was at a SSSI event after talking with my now manager about if they would like me at DMS that I had caught up with Tim and he encouraged me to move into the private sector. For that I thank him a lot.

I have started to read “How To Win Friends & Influence People” by Dale Carnegie, because one can always do with more skills in life, and some important points from the book:

  • Become genuinely interested in other people.
  • Smile.
  • Remember a person’s name.
  • Be a good listener. Encourage others to talk about themselves.
  • Talk in terms of the other person’s interests

This. All of this is what Tim did. This is the reason it always felt great to talk to him and be around him, even when I only saw him a few times.

I don’t know if Tim’s life was better for knowing me, given his large group of friends and great partner I suspect not, but I know sure as shit that mine was better for having known him.


Filed under: personal

Go2streetview plugin for QGIS

A very handy plugin for QGIS I use day to day is go2streetview by Enrico Ferreguti. The plugin adds an icon to the tool bar in QGIS and when selected I can click a road or street on a base map and a window will open that displays the Google Street or a Bing Maps Bird’s Eye view of the location. The camera’s direction and location is highlighted by a blue marker. I use the plugin when tracing boundaries of parks, open spaces and foot paths from aerial imagery. If the imagery is blurred or the view is obscured by trees, I click a point on a nearby street to see the location up close. The plugin works wherever Google Street view and Bing Birds Eye has coverage.

For example, in the screen-shot below notice there is a footpath leading to a bus shelter that’s not mapped by OpenStreetMap. I know where it is now, I will add it to my map.

Street View

Plugin: go2streetview

Nautical Charts in QGIS – The Compass Rose

Before the advent of shipborne satellite navigation systems, navigation at sea required three precise measurements – Solar or Stellar Declination for Latitude, Time at Greenwich for Longitude and True North that determined the ship’s heading. True North was obtained from the ship’s Magnetic Compass, an instrument who’s name indicates at an additional complication.

A magnetic compass does not point towards True North. Magnetic North is 100s km from the Geographic North Pole and the Earth’s magnetic field is uneven, it is distorted by magnetic irregularities within the Outer Core and intrinsically magnetic Mantle and Crustal rock. Additionally, the position of Magnetic North is not fixed, it is presently drifting from Arctic Canada towards Russia at 15 km per year. Therefore True North has to be derived from Magnetic North using a correction called Magnetic Declination (or Magnetic Variation), the angular difference between Magnetic North and True North. Magnetic Declination varies from location to location and over time.

Nautical navigation charts typically contain one or more Compass Roses, also called a Windrose, these consist of two circles – an outer circle that displays the cardinal directions of North, East, South and West and a inner circle that displays the direction of Magnetic North. The Magnetic Declination and its annual rate of change is typically printed within the Compass Rose, it is therefore possible to calculate the Magnetic Declination several years after a map is printed.

In this tutorial I will show you a process that to create a Compass Rose with the correct Magnetic Declination and Annual Rate of Change for any terrestrial location for use in QGIS. First we need to obtain a suitable Compass Rose graphic. Conveniently the United States National Oceanic and Atmospheric Administration (NOAA) published a Compass Rose in the Public Domain i.e. it is free to use without limitation. I downloaded a version of the NOAA Compass Rose from Wikimedia (or you can right click and save the Compass Rose below). Additionally, the background of this Compass Rose is transparent, this allows a map (or indeed a web page) to show though (note the Magnetic Declination in 1985 was 4 degrees 15 minutes west of True North and it had an annual decrease of 8 minutes of a degree per year).


There are several handy on-line utilities that can calculate Magnetic Declination and the Annual Rate of Change but we shall use Charles F. F. Karney’s excellent cross-platform GeographicLib in this case. GeographicLib is a suite of command line utilities for solving solving various geodesic problems such as conversions between geographic, UTM, UPS, MGRS, geocentric and local cartesian coordinates, gravity calculations, determining geoid height, and magnetic field calculations. The latest version can be obtained as a pre-compiled binary from Sourceforge or as source code.

The other essential step is to measure the precise map location in WGS84 coordinates. This can be done using the Coordinated Capture plug-in provided as standard with QGIS. To select the WGS84 coordinate reference system (CRS) click the sphere symbol in Coordinated Capture panel to open the Coordinate Reference System Selector. After setting the CRS to WGS84 (EPSG: 4326), click the icon left of the “Copy to Clipboard” button (this toggles real time display of captured coordinates) and then click “Start Capture”. The position in Decimal Degrees will be updated in the upper window as you move the cursor across the map, the lower window will display projected coordinates (in my case Pseudo Mercator EPSG: 3857). Clicking the map will select a coordinate point and the real time display will cease updating.


The MagneticField utility of GeographicLib is then used to calculate the Magnetic Declination and Annual Rate of Change for the captured coordinate, in this case a location east of Howth, Ireland.

$ MagneticField -r -t 2014-08-04 --input-string "53.37772 6.00935"

-3.57 67.81 18572.9 18536.9 -1152.2 45528.7 49171.3
0.17 -0.01 17.9 21.2 52.4 19.6 24.9

The results are: Magnetic Declination in degrees (-3.57); the inclination of the Magnetic Field in degrees (67.81); the horizontal strength of the magnetic field in nanotesla (18572.9 nT); the north component of the field (18536.9 nT); the east component of the field in (-1152.2 nT); the vertical component of the field in nT (45528.7 nT) and the total field (49171.3 nT). The numbers on the second line are the annual rate of change of these values, the first number is. We only need the first numbers on each line; the Magnetic Declination (-3.57) and Annual Rate of Change of Magnetic Declination (0.17). We can convert these to Degrees Minutes Seconds if required.

After calculating the Magnetic Declination and Annual Rate of Change, edit the NOAA Compass Rose in a graphics program such as  GIMP or Photoshop. In my case I copied the inner circle to a separate layer and I rotated it 3.57 degrees anticlockwise. I then added text to the Compass Rose stating the Magnetic Declination (Var.) and the Annual Rate of Change (Annual Decrease). After editing the Compass Rose graphic I finally added it to my Nautical Chart as a Image in Map Composer of QGIS.

Further Reading:

Bowditch, N. & ‎National Imagery and Mapping Agency, 2002. CHAPTER 3. NAUTICAL CHARTS. In: The American Practical Navigator: An Epitome of Navigation. Bethesda, MD : Washington, DC, Paradise Cay Publications, 9, 23–50. ISBN: 978-0939837540

The 10th annual FOSS4G conference

The 10th annual FOSS4G conference was held from 8th-13th September in Portland, Oregon, USA. FOSS4G is the world’s premier global gathering of developers, users and key decision-makers involved in open source geospatial software. With over 180 talks presented covering topics from 3D printing maps with Grass GIS 7 to QGIS Map Server and beyond, FOSS4G 2014 was a resounding success. Don’t be disappointed if you could not attend, all the talks given at FOSS4G 2014 are now viewable on Vimeo, including 8 one hour invited presentations from staff at Amazon, MapZen, Boundless, Mapbox etc. These talks are well worth watching if you want to keep up to date with the latest developments in open source geospatial software.

FOSS4G 2014 General Sessions – Talks and Invited Presentations

Importing CSV files into PostgreSQL using the DB Manager in QGIS

There is very useful tool in QGIS that can import very large CSV files into PostgreSQL rapidly and reliably. The DB Manager’s “Import Vector Layer” tool. Contrary to its highly misleading title it can import CSV files as well. Open the DB Manager (menu Database – DB Manager). Then select the database where you want to store your table and click the “Import layer/file” icon.

Icon_to_ClickFrom the Import Vector Layer GUI, locate our CSV file on disk and enter the name of your new table in the Table box and click OK. Yes, it’s that simple. Proceeding this, you may need to select an text encoding scheme, files created on Windows often use ISO-8859-1 (Latin-1) instead of UTF-8 encoding. In my case, I was able to import a large statistical data set describing the energy efficiency of 525,500 Irish homes (432 megabytes) into PostgreSQL in ~15 minutes. After the CSV file is imported, you can optionally add it to your project using the DB Manager, right-click the table and select Add to Canvas. Don’t use the “Add PostGIS Layers” menu, it’s not a PostGIS layer.

Import_GuiAnd one more useful tip. You can convert Tab delimited text to CSV using QGIS. Load a Tab delimited text file into QGIS using the Add Delimited Text Layer GUI, then right click the imported file in the layer panel and save it as a CSV file.

Oceancolor Data Downloader v1.0 for QGIS

Aqua Modis SST 2015-01-13

Sea Surface Temperature data downloaded by Oceancolor Data Downloader.

The Oceancolor Data Downloader is a new plugin for QGIS from the Mapping and Geographic Information Centre of the British Antarctic Survey that downloads Oceancolor and Sea Surface Temperature data from NASA’s Oceancolor website. The plugin currently downloads three datasets:

  • MODIS AQUA chlorophyll concentration
  • SeaWiFS chlorophyll concentration
  • MODIS AQUA night time Sea Surface Temperatures

The data accessed includes daily, 8 day, monthly and yearly composites, all of which can be saved to disk while downloading. Future plans for the plugin include additional access to other datasets such as ocean Net Primary Production, selection by bounding box, the ability to save in other formats, a progress bar etc.

I used the plugin to download global Sea Surface Temperatures for the 13th Jan 2015. I then used shapefiles from Natural Earth to create a simple basemap. I finally chose the IBCAO Polar Stereographic projection (EPSG: 3996) to create a map centred on the North Pole.

If you use the plugin to produce published research, please cite:


Adding ESRI’s Online World Imagery Dataset to QGIS

ESRI’s ArcGIS Online World Imagery is a high resolution satellite and aerial imagery base map for use in Google Earth, ArcMap and ArcGIS Explorer. The same excellent imagery is used by the Bing Maps Aerial layer. Somewhat surprisingly, World Imagery can also be accessed by QGIS, as it supports ESRI’s map servers that use Representational State Transfer (REST) and Simple Object Assess Protocol (SOAP) standards.

Simply copy and past the following code into the Python Console in QGIS and press return (Plugins – Console):


The code adds an ESRI Online World Imagery base map to QGIS. It has a number of advantages over the popular OpenLayers Plugin that adds various Google, Bing and OpenStreetMap image layers to QGIS. Unlike images downloaded by the OpenLayers plugin the ESRI World Imagery base map is a true Raster who’s attributes are fully editable e.g. brightness, blending mode and transparency can be adjusted. World Imagery can also be printed at a very high resolution with other QGIS layers on a map and without it shifting relative to other layers; a conspicuous problem with OpenLayers that does not use “On the Fly” re-projection and only prints Google, Bing layers at a low resolution. It is an ideal aerial base map.


QGIS: Adding An ArcServer Rest Service

Connecting to ArcGIS “mapserver” layers

The Coastal Vignette


Coastal Vignette seen on an old Irish ‘6-Inch map’

Occasionally on old maps you may see a pleasing decorative effect on bodies of water called a “Coastal Vignette”, these are fine lines that highlight coastlines and lake shores. The example seen above is from a ca. 100 year old “6-inch map” of Lough Nafooey in County Galway, Ireland. I presume the Coastal Vignette effect in this example was hand drawn, it required considerable skill and patience.

These is no plugin for creating Coastal Vignettes in QGIS just yet, so I developed a simple technique to recreate the effect using the raster Proximity (Raster Distance)’ algorithm accessible in the Processing Toolbox.

In order to use the Proximity Analysis tool I first converted a Shapefile polygon depicting the sea off Dublin into a 10 by 10 metre resolution Raster using the menu command ‘Raster – Conversion – Rasterize (Vector to raster)’.


This generated a Raster that coded the Sea as ‘1’ (white) and ‘0’ (black) for Land.

Next, I selected ‘Proximity (raster distance)’  from the Processing Toolbox – (GDAL/OGR) – [GDAL] Analysis – Proximity (raster distance). You can quickly find the command by typing the algorithm’s name in the box above the Processing Toolbox.


I entered 0 in the ‘Values’ box, this tells the Proximity algorithm to measure the distance away from land (a value of 0). The resulting Raster contains cell values that correspond to the distance away from the coast in metres, which I styled below.

The final step is to create Contours Lines from the Proximity analysis result using the menu item Raster – Contour. In my case I used an “interval between the contour lines” of 200 metres and I added an Attribute name called “DIST”.


The resulting contour lines have distance attributes attached to them can be used to create a Graduated colour style if needed, though in my cause I manually edited the attributes of 10 contour lines nearest the coast and I gradually increased the transparency of the mid-grey contour lines from opaque at the coast to fully transparent out at sea. I made the remaining contour lines transparent.

And here is the finished result, with the Sea and an OpenStreetMap base map styled to look just like Google Maps.

Finished Vignette 2

Google Map Style with “Shape Burst” effect in QGIS 2.3

Here’s a nice looking map I created using QGIS 2.3, the testing version of QGIS. I downloaded free OpenStreetMap data and I styled it to look just like Google Maps, as per instructions published by Anita Graser. I also outlined county boundaries using the new “Shape Burst” effect, which creates a pleasing graduated colour pattern that faithfully follows polygon outlines (it’s also applied to the Sea, though it’s quite subtle). I used Data Defined Properties to restrict the effect to all counties except Dublin City, this also created a Mask.

Lastly, there’s also a subtle “Coastal Vignette” effect, these are fine lines that trace the coastline and were typical of old style hand drawn maps. Must have taken a tremendous amount of patience. I developed a simple method of reproducing the effect and I’ll let you know how I did it in my next blog post. Oh and by the way, the scale relates to a map printed at A3 size.


Creating a Nautical Chart in QGIS 2.4

Continuing with a nautical theme, here is a nautical chart I creating using QGIS 2.4. It includes a Graticule in decimal degrees, a Compass Rose and a scale bar in Nautical Miles. A magnetic declination of 3º 35′ was determined using the MagneticField utility of GeographicLib, an advanced software library for solving geodesic problems. I will post a full tutorial shortly.

Nautical Chart for North Dublin Bay

CartoDB wins best “high-growth web entrepreneur” at the 2014 European Web Entrepreneur of the Year Awards

CartoDB, the FOSS powered web mapping solution, was honoured at the 2014 European Web Entrepreneur of the Year Awards along with three other companies at Dublin’s Web Summit on November 7th. The awards, presented by a European Commission backed body, were announced after a six month competition that involved public voting across four categories. CartoDB won the award for best “high-growth web entrepreneur”. CartoDB now has a growth rate of over 15% per month and customers in over 30 countries.

In September, a partner company of CartoDB, Kudos Ltda., released a plug-in that allows QGIS users to view, create, edit and delete data stored on their CartoDB accounts. Here is a map I created with the help of the new CartoDB plug-in that shows mountains and hills across the contiguous United States in the form of a heat map.

CartoDB and QGIS illustrate the exciting convergence between web hosted and desktop GIS, where interactive maps created in QGIS can be quickly published on the web and viewed by a worldwide audience.


3rd Portugal QGIS user meeting (Covilhã) and QGIS‬ Conference 2015 (University of Copenhagen)

In the next weeks/months are due a couple of QGIS events where NaturalGIS will be present with presentations and workshops.

May 18th and 19th we will be at the QGIS Conference 2015 organized by the University of Copenhagen, Forestry College, that will take place in Nødebo, Denmark. This event is directly linked with the 13th QGIS Developer Meeting, that will take place from May 20 to 22 in the same location.

At the QGIS Conference we will make a presentation about how to get help/support for QGIS and a workshop about QGIS Server and how to publish OGC services (WMS/WFS/WCS) and webgis applications.

QGIS Conference 2015

June 5th we will be in Covilhã, Serra da Estrela, Portugal, to join the 3rd Portugal QGIS user meeting where we also will make a presentation (the same as in Nødebo) and a workshop about using the QGIS Processing toolbox.

3rd Portugal QGIS user meeting

Using Layer Visibility Presets in QGIS

One of the cool outcomes of our recent QGIS Legend Refactoring work was the ability to add "visibility presets". This feature allows users to save and load preset layer and group visibility settings.

Main canvas

First select the layers and groups, you’d like to manage visibility presets for. Now click at the top of the Layers panel and select Add preset … A new window will appear. Enter a name for the preset and click OK. Next time you click you should see the saved presets. The presets also save the visibility of categories in each layer.

In the video below, we create two presets. One for a specific site location and another zoomed to the outline of Great Britain which will be used as an overview in the print composer.

Print composer

The print composer now allows multiple map windows, each locked to a different layer visibility preset. This means a single map composer can show map windows with different layer arrangements.

In the video below, one preset is used for the main map and the other for an overview:

Crayfish 1.3: What's New!

Crayfish is becoming the must-have QGIS plugin for those working with the binary and ascii DAT/.2dm formats. Recently we had some requests from BASEMENT users to fully support the file format of their modelling package.

We have also been busy beta-testing our new illuvis flood risk communication service. Crayfish 1.3 integrates the illuvis client, allowing users to interact easily with this flood risk mapping service.

Read on for a look at some of the new features in more detail...

Advanced Styling

You can now turn off values below or above certain thresholds. This feature is very useful when you work with rainfall-runoff models and want to turn off values below e.g. 2 cm.

You can now set your colour ramps once, save them and apply them to other layers.

Export to Geo-TIFF

You can now easily export outputs from Crayfish to Geo-TIFF (.tif) files. Simply select the Quantity and Output time in the Crayfish viewer then right-click on the Crayfish layer in the QGIS Layers panel and select Export to grid…

Export to illuvis

For those users who have been using illuvis, you can now upload crayfish layers directly to the flood map publishing web service rather than first having to convert results to Geo-TIFF. If you would like to become an illuvis beta-tester, please contact us.

Support for BASEMENT

Users can now view outputs from the BASEMENT modelling package.

Binary package for Ubuntu

We love Linux and have finally managed to prepare crayfish binaries for Ubuntu 14.04. If you are using other distros, the compilation should be straight-forward using guide in the README file.


If you have some feedback or come across a bug, feel free to file a ticket on the issues page of the Crayfish github repository.


We’d like to thank The Laboratory of Hydraulics, Hydrology and Glaciology (VAW) of ETH Zurich for sponsoring some of the great features in this release.


Sourcepole war an der FOSSGIS 2015 in Münster unter anderem mit zwei QGIS-Vorträgen präsent:

Datum transformations with NTv2 grids in QGIS: the easy way

NTv2 is a format/method to allow transform coordinates (and vector/raster layers) from one coordinate reference system to a different one (involving a change of datum) with a small error: the precision is usually around a few centimeters (or less) and is much better than the one that can be obtained by reprojecting layers using the standard coordinate reference systems definitions, as they are available in common GIS software/libraries/toolboxes.

Ntv2 Datum transformations precision
An example of the precision given by NTv2 tranformations
compared to the one obtained by reprojecting layers using standard CRS definitions.

Note: This is a rather complex matter so you may want to read some tutorial about it. One of the best we have ever read is this one [Portuguese or English].

The NTv2 method make use of binary files (.gsb) called ”grids” and is fully supported by libraries like Proj and software like GDAL/OGR. Until not long ago the availability of these grids was scarce but in recent times they have become quite easy to find and are freely available for many countries.

Unfortunately using this grid is not easy for the common GIS user: both command line utilities and Desktop GIS software need custom CRS definitions, downloading and copying files to specific locations and eventually do more configurations. See for example the following tutorials for QGIS or ArcGIS.

For the cases when grid files are freely available and redistributable we implemented an easier solution in the form of a QGIS plugin for its Processing toolbox. With this plugin the operation is as simple as just selecting the coordinate reference system of the input layer and the transformation (direct or inverse).

Ntv2 Datum transformations for the QGIS Processing toolbox
Ntv2 Datum transformations GUI

The plugin already comes with support for grids/transformations for a few countries and more will be added given that ntv2 grids are freely available and redistributable. If you want to have a certain grid/transformation/country added please open a request here

including all the necessary details.

Ntv2 Datum transformations for the QGIS Processing toolbox
Ntv2 Datum transformations for the QGIS Processing toolbox

Note2: The plugin was directly derived from a similar one that we helped develop for the Portuguese QGIS community/user group for the specific context of datum transformations for Portugal. At some point we felt that this plugin could have been useful also for users from other countries so we released an “international” version of it.

Game of Life – Raster edition

You probably remember my Game of Life posts from last year: Experiments with Conway’s Game of Life & More experiments with Game of Life where I developed a vector-based version of GoL.

Richard Wen and Claus Rinner at Ryerson University now published a raster-based version.

Here’s a screenshot of the script in action:

Screenshot 2015-03-08 20.04.07

The code is hosted on Github and I’m sure there will be many other ideas which can build on code snippets to read and write raster cell values.

For more info, please visit the GIS at Ryerson blog.

Generating an XYZ ASCII file from a QGIS raster

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).





To use the script, you should save it to your local machine, then open the python console and load the script in the python editor. Next select a single band raster and then run the script in the editor. If your raster is quite large, it will take some time to run. I have spent zero time trying to optimise the script – if someone has an idea for doing it faster, send me a patch and I will update the example above.

The generated output dataset will look something like this:



The resulting script can be used with programs like gdal_grid or loaded back into QGIS as a vector layer using the Delimited Text provider:


QGIS 74ac7f0 - raster_to_xyz_171

Computing network centers

How do you objectively define and compute which parts of a network are in the center? One approach is to use the concept of centrality.

Centrality refers to indicators which identify the most important vertices within a graph. Applications include identifying the most influential person(s) in a social network, key infrastructure nodes in the Internet or urban networks, and super spreaders of disease. (Source:

Researching this topic, it turns out that some centrality measures have already been implemented in GRASS GIS. thumbs up! computes degree, betweeness, closeness and eigenvector centrality.

As a test, I’ve loaded the OSM street network of Vienna and run -a input=streets@anita_000 output=centrality degree=degree closeness=closeness betweenness=betweenness eigenvector=eigenvector


The computations take a while.

In my opinion, the most interesting centrality measures for this street network are closeness and betweenness:

Closeness “measures to which extent a node i is near to all the other nodes along the shortest paths”. Closeness values are lowest in the center of the network and higher in the outskirts.

Betweenness “is based on the idea that a node is central if it lies between many other nodes, in the sense that it is traversed by many of the shortest paths connecting couples of nodes.” Betweenness values are highest on bridges and other important arterials while they are lowest for dead-end streets.

(Definitions as described in more detail in Crucitti, Paolo, Vito Latora, and Sergio Porta. “Centrality measures in spatial networks of urban streets.” Physical Review E 73.3 (2006): 036125.)

Centrality: low values in pink, high values in green

Centrality: low values in pink, high values in green

Works great! Unfortunately, is not yet part of the QGIS Processing GRASS toolbox. It would certainly be a great addition.

Get your QGIS merchandise while it’s hot!

Since the 2.8 release is done, the QGIS team has been busy with a small side project: setting up a series of shops for fans of QGIS. Right now, the following shops are available:

North America

There is a US and a Canadian shop. Additionally, there is also the possibility to design your own products (US, Canada).



There’s also a series of European shops, for example for the UK, Germany, and France. There are more, if Spreadshirt has a site for your country, there’s probably a QGIS shop too.


Thanks to Nathan for pointing out the Australian shop!

For each product sold, the QGIS project receives around $3 (minus applicable fees) which will go directly towards improving your favorite GIS.

  • <<
  • Page 2 of 76 ( 1505 posts )
  • >>

Back to Top