Page 1 of 115 (2284 posts)

  • talks about »


Last update:
Thu May 23 16:55:12 2019

A Django site.

QGIS Planet

Movement data in GIS #23: trajectories in context

Today’s post continues where “Why you should be using PostGIS trajectories” leaves off. It’s the result of a collaboration with Eva Westermeier. I had the pleasure to supervise her internship at AIT last year and also co-supervised her Master’s thesis [0] on the topic of enriching trajectories with information about their geographic context.

Context-aware analysis of movement data is crucial for different domains and applications, from transport to ecology. While there is a wealth of data, efficient and user-friendly contextual trajectory analysis is still hampered by a lack of appropriate conceptual approaches and practical methods. (Westermeier, 2018)

Part of the work was focused on evaluating different approaches to adding context information from vector datasets to trajectories in PostGIS. For example, adding land cover context to animal movement data or adding information on anchoring and harbor areas to vessel movement data.

Classic point-based model vs. line-based model

The obvious approach is to intersect the trajectory points with context data. This is the classic point data model of contextual trajectories. It’s straightforward to add context information in the point-based model but it also generates large numbers of repeating annotations. In contrast, the line data model using, for example, PostGIS trajectories (LinestringM) is more compact since trajectories can be split into segments at context borders. This creates one annotation per segment and the individual segments are convenient to analyze (as described in part #12).

Spatio-temporal interpolation as provided by the line data model offers additional advantages for the analysis of annotated segments. Contextual segments start and end at the intersection of the trajectory linestring with context polygon borders. This means that there are no gaps like in the point-based model. Consequently, while the point-based model systematically underestimates segment length and duration, the line-based approach offers more meaningful segment length and duration measurements.

Schematic illustration of a subset of an annotated trajectory in two context classes, a) systematic underestimation of length or duration in the point data model, b) full length or duration between context polygon borders in the line data model (source: Westermeier (2018))

Another issue of the point data model is that brief context changes may be missed or represented by just one point location. This makes it impossible to compute the length or duration of the respective context segment. (Of course, depending on the application, it can be desirable to ignore brief context changes and make the annotation process robust towards irrelevant changes.)

Schematic illustration of context annotation for brief context changes, a) and b)
two variants for the point data model, c) gapless annotation in the line data model (source: Westermeier (2018) based on Buchin et al. (2014))

Beyond annotations, context can also be considered directly in an analysis, for example, when computing distances between trajectories and contextual point objects. In this case, the point-based approach systematically overestimates the distances.

Schematic illustration of distance measurement from a trajectory to an external
object, a) point data model, b) line data model (source: Westermeier (2018))

The above examples show that there are some good reasons to dump the classic point-based model. However, the line-based model is not without its own issues.


Computing the context annotations for trajectory segments is tricky. The main issue is that ST_Intersection drops the M values. This effectively destroys our trajectories! There are ways to deal with this issue – and the corresponding SQL queries are published in the thesis (p. 38-40) – but it’s a real bummer. Basically, ST_Intersection only provides geometric output. Therefore, we need to reconstruct the temporal information in order to create usable trajectory segments.

Finally, while the line-based model is well suited to add context from other vector data, it is less useful for context data from continuous rasters but that was beyond the scope of this work.


After the promising results of my initial investigations into PostGIS trajectories, I was optimistic that context annotations would be a straightforward add-on. The line-based approach has multiple advantages when it comes to analyzing contextual segments. Unfortunately, generating these contextual segments is much less convenient and also slower than I had hoped. Originally, I had planned to turn this work into a plugin for the Processing toolbox but the results of this work motivated me to look into other solutions. You’ve already seen some of the outcomes in part #20 “Trajectools v1 released!”.


[0] Westermeier, E.M. (2018). Contextual Trajectory Modeling and Analysis. Master Thesis, Interfaculty Department of Geoinformatics, University of Salzburg.

This post is part of a series. Read more about movement data in GIS.


Sourcepole war an der FOSSGIS 2015 in Münster unter anderem mit zwei QGIS-Vorträgen präsent: Neues von QGIS QGIS Plugins - Must-Haves, Fachlösungen und Geheimtipps

QGIS Enterprise

Mit QGIS Enterprise bietet Sourcepole ein komplettes Wartungs- und Support-Paket für eine Geodaten-Infrastruktur (GDI) an, die vollständig auf Open Source Software aufbaut. Der Kern des Angebotes ist die Quantum GIS Suite basierend auf QGIS Desktop, QGIS Server, QGIS WebClient und QGIS Mobile. dauerhafte Infrastruktur Investitionssicherheit hohe Verfügbarkeit GDI-Gesamtpaket Serviceorientierte Architektur keine Lizenzkosten schnelle Bug-Fixes regelmässige Updates kompetente Schulung Nutzen Sie die Vorteile der Hersteller-Unabhängigkeit. Reduzieren sie die Kosten ihrer Geodaten Infrastruktur da keine Software-Lizenzen anfallen.

Slides FOSS4G 2014

Slides from our presentations at FOSS4G 2014 in Portland/Oregon: From Nottingham to PDX: QGIS 2014 roundup State of QGIS Server Easy ETL with OGR Pirmin Kalberer (@implgeo)

Presentations at FOSS4G 2015 in Seoul

Slides from our presentations at FOSS4G 2015 in Seoul: Keynote: The QGIS project and its evolution from a desktop GIS to a GIS platform - Slides New QGIS functions for power users - Slides QGIS Plugins - From Must-Haves to insider tips - Slides Building an OpenLayers 3 map viewer with React - Slides Thanks to the organizers of this great conference! It was a pleasure to get in contact with so many users from around the world.

The state of QGIS Globe

The Region of Umbria, Italy, sponsored 4 days of work to update QGIS Globe for current QGIS versions. Most of the functionality is working again and the globe is now compatible with osgEarth 1.0 up to 1.3. The bad news is, that the globe plugin is not working on Windows with OSGeo4W. It seems that one of the OSGeo4W libraries (GDAL?) is compiled with an incompatible MS compiler version. Christmas holidays are coming…

Eigene GIS-Fachapplikationen mit QGIS entwickeln

Als Ergebnis der Zusammenarbeit zwischen der Sourcepole AG und der Hochschule Rapperswil (HSR) ist ein Video entstanden, dass die Entwicklung eigener Fachschalen mit QGIS beschreibt. Am Beispiel der Zonenplanung zeigt dieses Video, wie Sie mit Quantum GIS eine so genannte Fachapplikation erstellen könne. Sehen Sie Schritt für Schritt, wie sie Quantum GIS auf Ihre persönlichen Bedürfnisse anpassen können, passende Erweiterungen finden, eigene Eingabeformulare erstellen und eine Datenbank verwalten. Die Grundlage zu diesem Video war ein Workshop auf dem Geosummit 2012 Bern, den Pirmin Kalberer entwickelt hat.

Publish Image Tooltips with QGIS Cloud

A lot of people are using QGIS Cloud as a service with ready to use QGIS webclient. It’s very easy to publish data and share maps in this way. Publishing of georeferenced images can be done with QGIS Cloud in a few steps as well. But the main problems are: how to upload the images into the cloud database? how to manage them? how to display the results? QGIS and QGIS Cloud are offering all tools for this task.

QGIS Instant Print Plugin

As a side product of a customer project, we’re publishing a QGIS plugin for printing maps to a file with just two mouse clicks.

QGIS - the FOSSGIS week

Tuesday, 2012-03-20 11:00: FOSSGIS in Dessau, Germany starts with a workshop for programming QGIS plugins A great conference begins, with about 400 people attending presentations and workshops over three days. Tuesday, 2012-03-20 14:42: Changeset c27c89045c: “Add WFS support for QGIS server. Provided by René-Luc D’Hont” Wow. Tuesday, 2012-03-20 14.48: QGIS 1.7.4 uploaded to DebianGIS Ok, QGIS 1.7.4 is already a few weeks old. But current version on Debian is 1.

New configuration options in QGIS server

In QGIS server, it is now possible to selectively exclude layers from WMS publication. These layers will be available only on the desktop and hidden from WMS clients. Similarly, print layouts can be excluded from WMS publication. Of course, these settings are conveniently accessible from the project properties dialog of QGIS (but you need to have a nightly build or a recent compile): Additionally, attributes per layer can be excluded from WMS or WFS publication in the vector properties dialog:

Raster resampling in QGIS

QGIS already offers a lot of possibilities to visualize raster data (contrast enhancement, color map, handling of transparent pixels, …) Last year, Radim Blazek refactored the raster provider interface and added on-the-fly reprojection support for rasters to QGIS. Very cool! One of the few things currently missing in QGIS raster layer is the possibility to have other resampling types than nearest neighbour. The problem is that rasters appear pixelated when zooming further than the source raster resolution.

QGIS Enterprise – Open Source GIS with LTS Support

Quantum QGIS, a user-friendly and full featured Open Source GIS suite, is used in a wide range of professional enterprise infrastructures. Sourcepole, located in Zurich, Switzerland, now fills the last gap, which has prevented many organizations from the use of QGIS in enterprise infrastructures so far - they offer professional support directly from QGIS core developers. With QGIS Enterprise long term support and maintenance, the customer gets a professionally supported and maintained GIS infrastructure based on QGIS.

QGIS Cloud and Sourcepole are sponsoring Öcher-Safari

QGIS Cloud and Sourcepole are proud to be official sponsors of the team Öcher-Safari, attending the Allgäu-Orient-Rallye. One of the last adventures in the world of cars. Sourcepole serves the team with know how, infrastructure and more. Information about the team and the charity ideas of this event you can find on Öcher-Safari and the official web site of the Allgäu-Orient-Rallye.

QGIS Cloud - Speed up the loading time of the web client

QGIS Cloud is your personal geo-data infrastructure in the internet. Publish maps and data. Share geo-information with others. And all of this very easily, without server, infrastructure and expert knowledge. If you know QGIS Desktop, then you know QGIS cloud just as well. Just install the QGIS cloud plugin from the official QGIS plugin repository and you’re good to go. You can publish as many maps as you want. But the default settings of QGIS projects you like to publish via QGIS Cloud are not the best with respect to the performance of the QGIS Webclient / WMS.

Creating png8 images with QGIS server

For providing maps via WMS over the internet, it is important to generate image files with a small size. Because normally, most of the perceived WMS delay comes from transfering large images files over the internet (and not from map rendering itself). Therefore, QGIS server supports the conversion of png24 and png32 images into png8, therefore generating a file with only 1⁄3 resp. 1⁄4 of the original size (but with lower quality).

Shaded relief maps with QGIS

Creating a shaded relief map from digital elevation data is a nice way to create a backround map for web mapping or other GIS work. Thanks to the know-how and the funding from the Swiss Humanitarian Aid Unit, QGIS now has a sophisticated function for relief map generation. The method is described in detail in an paper by Marc-André Bünzli. An important part of the method is the choice of the elevation colors.

Kursprogramm Herbst 2012

Sourcepole bietet Grundlagen- und Aufbau-Kurse für den Betrieb von Geodaten-Infrastrukturen auf der Basis von PostgreSQL/PostGIS und Quantum GIS an. Detaillierte Informationen zu den Kursen, die im Herbst 2012 stattfinden, entnehmen Sie bitte dem Kursprogramm. Die Anmeldung ist ab sofort online möglich. Wir freuen uns darauf Sie in Zürich begüssen zu können.

Share and manage your Data with QGIS Cloud and WFS-T

A lot of people are using QGIS Cloud as a service with ready to use QGIS webclient. It’s very easy to publish data and share maps in this way. But QGIS Cloud has more power under the hood. A not so obvious feature of QGIS Cloud is the option to share your data via Web Feature Service (WFS) and manage them via Web Feature Service Transactional (WFS-T). “The basic Web Feature Service allows querying and retrieval of features.

Multiple map grids in the QGIS print composer

In printed maps, having several coordinate grids over one map is a very usefull feature. For instance using a meter system as output CRS, it is nice to display a latitude / longitude grid as well. Until now, the QGIS print composer allowed only one coordinate grid per composer map and it was restricted to the map output CRS. Having that multigrid / multiCRS feature in QGIS Enterprise since 13.04 already, I’ve recently found the time to port it into the QGIS developer version.

  • Page 1 of 115 ( 2284 posts )
  • >>

Back to Top