Blog d’Anita Graser

https://anitagraser.com

  • 3 mai 2022Inscribed and bounding circles in PostGIS
    Today, I’m revisiting work from 2017. In Brezina, Graser & Leth (2017), we looked at different ways to determine the width of sidewalks in Vienna based on the city’s street surface database. Image source: Brezina, Graser & Leth (2017) Inscribed and circumscribed circles were a natural starting point. Circumscribed or bounding circle tools (the smallest circle to enclose an input polygon) have been commonly available in desktop GIS and spatial databases. Inscribed circle tools (the largest circle that fits into an input polygon) used to be less readily available. Lately, support has improved since ST_MaximumInscribedCircle has been added in PostGIS 3.1.0 (requires GEOS >= 3.9.0). The tricky thing is that ST_MaximumInscribedCircle does not behave like ST_MinimumBoundingCircle. While the bounding circle function returns the circle geometry, the inscribed circle function returns a record containing information on the circle center and radius. Handling the resulting records involves some not so intuitive SQL. Here is what I’ve come up with to get both the circle geometries as well as the radius values: WITH foo AS ( SELECT id, ST_MaximumInscribedCircle(geom) AS inscribed_circle, ST_Mini …
  • 23 avril 2022MF-JSON update & tutorial with official sample
    Since last week’s post, I’ve learned that there is an official OGC Moving Features JSON Encodings repository with more recent sample datasets, including MovingPoint, MovingPolygon, and Trajectory JSON examples. The MovingPoint example seems to describe a storm, including its path (temporalGeometry), pressure, wind strength, and class values (temporalProperties): You can give the current implementation a spin using this MyBinder notebook An exciting future step would be to experiment with extending MovingPandas to support the MovingPolygon MF-JSON examples. MovingPolygons can change their size and orientation as they move. I’m not yet sure, however, if the number of polygon nodes can change between time steps and how this would be reflected by the prism concept presented in the draft specification: Image source: https://ksookim.github.io/mf-json/ …
  • 21 avril 2022Dynamic Infographic Map Tutorial
    This is a guest post by Mickael HOARAU @Oneil974 As an update of the tutorial from previous years, I created a tutorial showing how to make a simple and dynamic color map with charts in QGIS. In this tutorial you can see some of interesting features of QGIS and its community plugins. Here you’ll see variables, expressions, filters, QuickOSM and DataPlotly plugins and much more. You just need to use QGIS 3.24 Tisler version. Here is the tutorial. …
  • 16 avril 2022New OGC Moving Features JSON support in MovingPandas
    First time, we talked about the OGC Moving Features standard in a post from 2017. Back then, we looked at the proposed standard way to encode trajectories in CSV and discussed its issues. Since then, the Moving Features working group at OGC has not been idle. Besides the CSV and XML encodings, they have designed a new JSON encoding that addresses many of the downsides of the previous two. You can read more about this in our 2020 preprint “From Simple Features to Moving Features and Beyond”. Basically Moving Features JSON (MF-JSON) is heavily inspired by GeoJSON and it comes with a bunch of mandatory and optional key/value pairs. There is support for static properties as well as dynamic temporal properties and, of course, temporal geometries (yes geometries, not just points). I think this format may have an actual chance of gaining more widespread adoption. Image source: http://www.opengis.net/doc/BP/mf-json/1.0 Inspired by Pandas.read_csv() and GeoPandas.read_file(), I’ve started implementing a read_mf_json() function in MovingPandas. So far, it supports basic MovingFeature JSONs with MovingPoint geometry: You’ll need to use the current development version to test this feature. Nex …
  • 10 avril 2022Geospatial: where MovingPandas meets Leafmap
    Many of you certainly have already heard of and/or even used Leafmap by Qiusheng Wu. Leafmap is a Python package for interactive spatial analysis with minimal coding in Jupyter environments. It provides interactive maps based on folium and ipyleaflet, spatial analysis functions using WhiteboxTools and whiteboxgui, and additional GUI elements based on ipywidgets. This way, Leafmap achieves a look and feel that is reminiscent of a desktop GIS: Image source: https://github.com/giswqs/leafmap Recently, Qiusheng has started an additional project: the geospatial meta package which brings together a variety of different Python packages for geospatial analysis. As such, the main goals of geospatial are to make it easier to discover and use the diverse packages that make up the spatial Python ecosystem. [youtube https://www.youtube.com/watch?v=Y1xB7d2VbFY?version=3&rel=1&showsearch=0&showinfo=1&iv_load_policy=1&fs=1&hl=en&autohide=2&wmode=transparent&w=545&h=307] Besides the usual suspects, such as GeoPandas and of course Leafmap, one of the packages included in geospatial is MovingPandas. Thanks, Qiusheng! I’ve tested the mamba install today and am very happy with how this worked out. Ther …
  • 6 mars 2022MovingPandas now supports local coordinates
    MovingPandas 0.9rc3 has just been released, including important fixes for local coordinate support. Sports analytics is just one example of movement data analysis that uses local rather than geographic coordinates. Many movement data sources – such as soccer players’ movements extracted from video footage – use local reference systems. This means that x and y represent positions within an arbitrary frame, such as a soccer field. Since Geopandas and GeoViews support handling and plotting local coordinates just fine, there is nothing stopping us from applying all MovingPandas functionality to this data. For example, to visualize the movement speed of players: Of course, we can also plot other trajectory attributes, such as the team affiliation. But one particularly useful feature is the ability to use custom background images, for example, to show the soccer field layout: To access the full example notebook, visit: https://github.com/anitagraser/movingpandas/blob/master/tutorials/5-local-coordinates.ipynb An update to the MovingPandas examples repository will follow shortly. …
  • 15 janvier 2022MovingPandas v0.9 released!
    The latest v0.9 release is now available from conda-forge. This release contains some really cool new algorithms: Trajectory smoothing (Kalman filter)Spatiotemporal trajectory generalization (Top-Down Time Ratio)Trajectory cleaning (statistical outliers in numerical columns) The Kalman filter in action on the Geolife sample: smoother, less jiggly trajectories. Top-Down Time Ratio generalization aka trajectory compression in action: reduces the number of positions along the trajectory without altering the spatiotemporal properties, such as speed, too much. These new algorithms were contributed by Lyudmil Vladimirov and George S. Theodoropoulos. Behind the scenes, Ray Bell took care of moving testing from Travis to Github Actions, and together we worked through the steps to ensure that the source code is now properly linted using flake8 and black. Being able to work with so many awesome contributors has made this release really special for me. It’s great to see the project attracting more developer interest. As always, all tutorials are available from the movingpandas-examples repository and on MyBinder: …
  • 31 décembre 20212021 wrap-up: baba und foi net!
    What a ride. This year has been both extremely rewarding and incredibly frustrating, sometimes both in very short succession. I’ve finally finished my PhD dissertation and – between movement data analysis and open source and open data science talks in general – I’ve been counting over ten invited talks and conference presentations, including keynotes at FOSS4G and GI_Forum. Unfortunately, all of these were limited to virtual experiences and therefore often lacked much of the social interaction off stage that usually makes giving talks rewarding. But FOSS4G2021 was a refreshing exception to this rule: #FOSS4G2021 closing session with @delawen: such great organization, incredible volunteers. Thank you all pic.twitter.com/JkTTnS4G54— Anita Graser (@underdarkGIS) October 1, 2021https://platform.twitter.com/widgets.js Last week I finally defended my PhD thesis on the « Exploratory Analysis of Massive Movement Data ». Still in virtual mode but I hope we’ll soon be able to celebrate in person. Huge thanks to my supervisors @GIStrobl and Prof. R. Weibel, reviewers, and discussants. pic.twitter.com/kohZZdJ0hG— Anita Graser (@underdarkGIS) September 10, 2021https://platform.twitter.com/widgets …
  • 29 décembre 2021Snowy day map style now available on the QGIS hub
    Today’s post is a follow-up and summary of my mapping efforts this December. It all started with a proof of concept that it is possible to create a nice looking snowfall effect using only labeling: Snowy day map style: using only unicode characters and #QGIS labeling #gischat pic.twitter.com/2bmldImkyN— Anita Graser (@underdarkGIS) December 12, 2021 After a few more iterations, I even included the snowflake style in the first ever QGIS Map Design DLC: a free extra map recipe that shows how to create a map series of Antarctic expeditions. For more details (including project download links), check out my guest post on the Locate Press blog: QGIS Map Design – Free Christmas DLC If you want to just use the snowflake style in your own projects, the easiest way is to grab the “Snowy Day” project from the QGIS hub (while the GeoPackage is waiting for approval on the official site, you can get it from my Dropbox): The project is self-contained within the downloaded GeoPackage. One of the most convenient ways to open projects from GeoPackages is through the browser panel: From here, you can copy-paste the layer style to any other polygon layer. To change the snowflake color, go to the proje …
  • 27 novembre 2021New MovingPandas website
    The last couple of days, I have been hacking away to improve the online presence of MovingPandas. The new home page aims to be the central landing page that provides direct links to all important resources: from source code on Github, to documentation on ReadTheDocs, and – most importantly – all the tutorial and analysis example notebooks: Additionally, all tutorial and analysis example notebooks now contain direct links to live versions on MyBinder, sources on Github and already executed pre-rendered HTML versions of the notebooks for quick browsing: If you are using MovingPandas, I’d love to hear about it, particularly if you want to share one of your analysis examples with the community. …