Blog d’Anita Graser

https://anitagraser.com

  • 30 mai 2024ChatGPT Data Analyst vs movement data
    Today, I took ChatGPT’s Data Analyst for a spin. You’ve probably seen the fancy advertising videos: just drop in a dataset and AI does all the analysis for you?! Let’s see … Of course, I’m not going to use some lame movie database or flower petals data. Instead, let’s go all in and test with a movement dataset. You don’t get a second chance to make a first impression, they say. — Well, Data Analyst, you didn’t impress on the first try. How hard can it be to guess the delimiter and act accordingly? Anyway, let’s help it a little: That looks much better. It makes an effort to guess what the columns could mean and successfully identifies the spatiotemporal information. Now for some spatial analysis. On first try, it didn’t want to calculate the length of the trajectories in geographic terms, but we can make it to: It will also show the code used to get to the results: And indeed, these are close enough to the results computed using MovingPandas: “What about plots?” I hear you ask. For a first try, not bad at all: Let’s see if we can push it further: Looks like poor Data Analyst ended up in geospatial library dependency hell It’s interesting to watch it try find a solution. Alas, no ba …
  • 20 mai 2024New Trajectools 2.1 and MovingPandas 0.18 releases
    Today marks the 2.1 release of Trajectools for QGIS. This release adds multiple new algorithms and improvements. Since some improvements involve upstream MovingPandas functionality, I recommend to also update MovingPandas while you’re at it. If you have installed QGIS and MovingPandas via conda / mamba, you can simply: conda activate qgis mamba install movingpandas=0.18 Afterwards, you can check that the library was correctly installed using: import movingpandas as mpdmpd.show_versions() Trajectools 2.1 The new Trajectools algorithms are: Trajectory overlay — Intersect trajectories with polygon layer Privacy — Home work attack (requires scikit-mobility) This algorithm determines how easy it is to identify an individual in a dataset. In a home and work attack the adversary knows the coordinates of the two locations most frequently visited by an individual. GTFS — Extract segments (requires gtfs_functions) GTFS — Extract shapes (requires gtfs_functions) These algorithms extract public transport routes (GTFS shapes) and route segments between stops (GTFS segments) from GTFS ZIP files using gtfs_functions.Feed.shapes and .segments, respectively. Furthermore, we have fixed issue with pr …
  • 4 mai 2024GTFS algorithms about to land in Trajectools
    Trajectools continues growing. Lately, we have started expanding towards public transport analysis. The algorithms available through the current Trajectools development version are courtesy of the gtfs_functions library. There are a couple of existing plugins that deal with GTFS. However, in my experience, they either don’t integrate with Processing and/or don’t provide the functions I was expecting. So far, we have two GTFS algorithms to cover essential public transport analysis needs: The “Extract shapes” algorithm gives us the public transport routes: The “Extract segments” algorithm has one more options. In addition to extracting the segments between public transport stops, it can also enrich the segments with the scheduled vehicle speeds: Here you can see the scheduled speeds: To show the stops, we can put marker line markers on the segment start and end locations: The segments contain route information and stop names, so these can be extracted and used for labeling as well: If you want to reproduce the above examples, grab the open Vorarlberg public transport schedule GTFS. These developments are supported by the Emeralds Horizon Europe project. …
  • 20 avril 2024QGIS Server — Docker edition
    Today’s post is a QGIS Server update. It’s been a while (12 years ) since I last posted about QGIS Server. It would be an understatement to say that things have evolved since then, not least due to the development of Docker which, Wikipedia tells me, was released 11 years ago. There have been multiple Docker images for QGIS Server provided by QGIS Community members over the years. Recently, OPENGIS.ch’s Docker image has been adopted as official QGIS Server image https://github.com/qgis/qgis-docker which aims to be a starting point for users to develop their own customized applications. The following steps have been tested on Ubuntu (both native and in WSL). First, we need Docker. I installed Docker from the apt repository as described in the official docs. Once Docker is set up, we can get the QGIS Server, e.g. for the LTR: docker pull qgis/qgis-server:ltr Now we only need to start it: docker run -v $(pwd)/qgis-server-data:/io/data –name qgis-server -d -p 8010:80 qgis/qgis-server:ltr Note how we are mapping the qgis-server-data directory in our current working directory to /io/data in the container. This is where we’ll put our QGIS project files. We can already check out the OGC A …
  • 18 mars 2024Getting started with pygeoapi processes
    Today’s post is a quick introduction to pygeoapi, a Python server implementation of the OGC API suite of standards. OGC API provides many different standards but I’m particularly interested in OGC API – Processes which standardizes geospatial data processing functionality. pygeoapi implements this standard by providing a plugin architecture, thereby allowing developers to implement custom processing workflows in Python. I’ll provide instructions for setting up and running pygeoapi on Windows using Powershell. The official docs show how to do this on Linux systems. The pygeoapi homepage prominently features instructions for installing the dev version. For first experiments, however, I’d recommend using a release version instead. So that’s what we’ll do here. As a first step, lets install the latest release (0.16.1 at the time of writing) from conda-forge: conda create -n pygeoapi python=3.10conda activate pygeoapimamba install -c conda-forge pygeoapi Next, we’ll clone the GitHub repo to get the example config and datasets: cd C:\Users\anita\Documents\GitHub\git clone https://github.com/geopython/pygeoapi.gitcd pygeoapi\ To finish the setup, we need some configurations: cp pygeoapi-c …
  • 24 février 2024Trajectools 2.0 released 🎉
    It’s my pleasure to share with you that Trajectools 2.0 just landed in the official QGIS Plugin Repository. This is the first version without the “experimental” flag. If you look at the plugin release history, you will see that the previous release was from 2020. That’s quite a while ago and a lot has happened since, including the development of MovingPandas. Let’s have a look what’s new! The old “Trajectories from point layer”, “Add heading to points”, and “Add speed (m/s) to points” algorithms have been superseded by the new “Create trajectories” algorithm which automatically computes speeds and headings when creating the trajectory outputs. “Day trajectories from point layer” is covered by the new “Split trajectories at time intervals” which supports splitting by hour, day, month, and year. “Clip trajectories by extent” still exists but, additionally, we can now also “Clip trajectories by polygon layer” There are two new event extraction algorithms to “Extract OD points” and “Extract OD points”, as well as the related “Split trajectories at stops”. Additionally, we can also “Split trajectories at observation gaps”. Trajectory outputs, by default, come as a pair of a point layer …
  • 3 février 2024Finding geospatial accounts on Mastodon
    Besides following hashtags, such as #GISChat, #QGIS, #OpenStreetMap, #FOSS4G, and #OSGeo, curating good lists is probably the best way to stay up to date with geospatial developments. To get you started (or to potentially enrich your existing lists), I thought I’d share my Geospatial and SpatialDataScience lists with you. And the best thing: you don’t need to go through all the >150 entries manually! Instead, go to your Mastodon account settings and under “Import and export” you’ll find a tool to import and merge my list.csv with your lists: And if you are not following the geospatial hashtags yet, you can search or click on the hashtags you’re interested in and start following to get all tagged posts into your timeline: …
  • 27 janvier 2024Trajectools update: stop detection & trajectory styling
    The Trajectools toolbox has continued growing: I’m continuously testing the algorithms integrated so far to see if they work as GIS users would expect and can to ensure that they can be integrated in Processing model seamlessly. Because naming things is tricky, I’m currently struggling with how to best group the toolbox algorithms into meaningful categories. I looked into the categories mentioned in OGC Moving Features Access but honestly found them kind of lacking: Andrienko et al.’s book “Visual Analytics of Movement” comes closer to what I’m looking for: … but I’m not convinced yet. So take the above listed three categories with a grain of salt. Those may change before the release. (Any inputs / feedback / recommendation welcome!) Let me close this quick status update with a screencast showcasing stop detection in AIS data, featuring the recently added trajectory styling using interpolated lines: While Trajectools is getting ready for its 2.0 release, you can get the current development version directly from https://github.com/movingpandas/qgis-processing-trajectory. …
  • 12 janvier 2024QGIS Processing Trajectools v2 in the works
    Trajectools development started back in 2018 but has been on hold since 2020 when I realized that it would be necessary to first develop a solid trajectory analysis library. With the MovingPandas library in place, I’ve now started to reboot Trajectools. Trajectools v2 builds on MovingPandas and exposes its trajectory analysis algorithms in the QGIS Processing Toolbox. So far, I have integrated the basic steps of Building trajectories including speed and direction information from timestamped points and Splitting trajectories at observation gaps, stops, or regular time intervals. The algorithms create two output layers: Trajectory points with speed and direction information that are styled using arrow markers Trajectories as LineStringMs which makes it straightforward to count the number of trajectories and to visualize where one trajectory ends and another starts. So far, the default style for the trajectory points is hard-coded to apply the Turbo color ramp on the speed column with values from 0 to 50 (since I’m simply loading a ready-made QML). By default, the speed is calculated as km/h but that can be customized: I don’t have a solution yet to automatically create a style for t …
  • 15 décembre 2023Offline Vector Tile Package .vtpk in QGIS
    Starting from 3.26, QGIS now supports .vtpk (Vector Tile Package) files out of the box! From the changelog: ESRI vector tile packages (VTPK files) can now be opened directly as vector tile layers via drag and drop, including support for style translation. This is great news, particularly for users from Austria, since this makes it possible to use the open government basemap.at vector tiles directly, without any fuss: 1. Download the 2GB offline vector basemap from https://www.data.gv.at/katalog/de/dataset/basemap-at-verwaltungsgrundkarte-vektor-offline-osterreich 2. Add the .vtpk as a layer using the Data Source Manager or via drag-and-drop from the file explorer 3. All done and ready, including the basemap styling and labeling — which we can customize as well: Kudos to https://wien.rocks/@DieterKomendera/111568809248327077 for bringing this new feature to my attention. PS: And interesting tidbit from the developer of this feature, Nyall Dawson: …