17 décembre 2024Urban Mobility Insights with MovingPandas & CARTO in Snowflake Today, I want to point out a blog post over at https://carto.com/blog/urban-mobility-insights-with-movingpandas-carto-in-snowflake written together with my fellow co-authors and EMERALDS project team member Argyrios Kyrgiazos. For the technically inclined, the highlight are the presented UDFs in Snowflake to process and transform the trajectory data. …
23 novembre 2024GeoParquet in QGIS – smaller & faster files for the win! tldr; Tired of working with large CSV files? Give GeoParquet a try! “Parquet is a powerful column-oriented data format, built from the ground up to as a modern alternative to CSV files.” https://geoparquet.org/ (Geo)Parquet is both smaller and faster than CSV. Additionally, (Geo)Parquet columns are typed. Text, numeric values, dates, geometries retain their data types. GeoParquet also stores CRS information and support in GIS solutions is growing. I’ll be giving a quick overview using AIS data in GeoPandas 1.0.1 (with pyarrow) and QGIS 3.38 (with GDAL 3.9.2). File size The example AIS dataset for this demo contains ~10 million rows with 22 columns. I’ve converted the original zipped CSV into GeoPackage and GeoParquet using GeoPandas to illustrate the huge difference in file size: ~470 MB for GeoParquet and zipped CSV, 1.6 GB for CSV, and a whopping 2.6 GB for GeoPackage: Reading performance Pandas and GeoPandas both support selective reading of files, i.e. we can specify the specific columns to be loaded. This does speed up reading, even from CSV files: Whole fileSelected columnsCSV27.9 s13.1 sGeopackage2min 12s 20.2 sGeoParquet7.2 s4.1 s Indeed, reading the whole GeoPackage is get …
4 novembre 2024GeoAI: key developments & insights It’s been a while since my post on geo and the AI hype in 2019. Back then, I didn’t use the term “GeoAI”, even though it has certainly been around for a while (including, e.g., with dedicated SIGSPATIAL workshops since 2017). GeoAI isn’t one single thing. It’s an umbrella term, including: “AI for Geo” (using AI methods in Geo, e.g. deep learning for object recognition in remote sensing images) and “Geo for AI” (integrating geographic concepts into AI models, e.g. by building spatially explicit models). [Zhang 2020] [Li et al. 2024] Today’s post is a collection of key GeoAI developments I’m aware of. If I missed anything you are excited about, please let me know here in the comments or over on Mastodon. Background A week ago, I had the pleasure to attend a “Specialist Meeting” on GeoAI here in Vienna, meeting over 40 researchers from around the world, from Master students to professor emeritus. Huge props to Jano (Prof. Krzysztof Janowicz) and his team at Uni Wien for bringing this awesome group of people together. The elephant in the room: LLMs Unsurprisingly, LLMs and the claims they make about geography are a mayor issue due to the mistakes they make and the biases behind them. A …
6 octobre 2024LLM-based spatial analysis assistants for QGIS After the initial ChatGPT hype in 2023 (when we saw the first LLM-backed QGIS plugins, e.g. QChatGPT and QGPT Agent), there has been a notable slump in new development. As far as I can tell, none of the early plugins are actively maintained anymore. They were nice tech demos but with limited utility. However, in the last month, I saw two new approaches for combining LLMs with QGIS that I want to share in this post: IntelliGeo plugin: generating PyQGIS scripts or graphical models At the QGIS User Conference in Bratislava, I had the pleasure to attend the “Large Language Models and GIS” workshop presented by Gustavo Garcia and Zehao Lu from the the University of Twente. There, they presented the IntelliGeo Plugin which enables the automatic generation of PyQGIS scripts and graphical models. The workshop was packed. After we installed all dependencies and the plugin, it was exciting to test the graphical model generation capabilities. During the workshop, we used OpenAI’s API but the readme also mentions support for Cohere. I was surprised to learn that even simple graphical models are actually pretty large files. This makes it very challenging to generate and/or modify models because …
21 septembre 2024Trajectools tutorial: trajectory preprocessing Today marks the release of Trajectools 2.3 which brings a new set of algorithms, including trajectory generalizing, cleaning, and smoothing. To give you a quick impression of what some of these algorithms would be useful for, this post introduces a trajectory preprocessing workflow that is quite general-purpose and can be adapted to many different datasets. We start out with the Geolife sample dataset which you can find in the Trajectools plugin directory’s sample_data subdirectory. This small dataset includes 5908 points forming 5 trajectories, based on the trajectory_id field: We first split our trajectories by observation gaps to ensure that there are no large gaps in our trajectories. Let’s make at cut at 15 minutes: This splits the original 5 trajectories into 11 trajectories: When we zoom, for example, to the two trajectories in the north western corner, we can see that the trajectories are pretty noisy and there’s even a spike / outlier at the western end: If we label the points with the corresponding speeds, we can see how unrealistic they are: over 300 km/h! Let’s remove outliers over 50 km/h: Better but not perfect: Let’s smooth the trajectories to get rid of more of the …
29 août 2024Building spatial analysis assistants using OpenAI’s Assistant API Earlier this year, I shared my experience using ChatGPT’s Data Analyst web interface for analyzing spatiotemporal data in the post “ChatGPT Data Analyst vs. Movement Data”. The Data Analyst web interface, while user-friendly, is not equipped to handle all types of spatial data tasks, particularly those involving more complex or large-scale datasets. Additionally, because the code is executed on a remote server, we’re limited to the libraries and tools available in that environment. I’ve often encountered situations where the Data Analyst simply doesn’t have access to the necessary libraries in its Python environment, which can be frustrating if you need specific GIS functionality. Today, we’ll therefore start to explore alternatives to ChatGPT’s Data Analyst Web Interface, specifically, the OpenAI Assistant API. Later, I plan to dive deeper into even more flexible approaches, like Langchain’s Pandas DataFrame Agents. We’ll explore these options using spatial analysis workflow, such as: Loading a zipped shapefile and investigate its content Finding the three largest cities in the dataset Selecting all cities in a region, e.g. in Scandinavia from the dataset Creating static and inter …
23 août 2024MovingPandas 0.19 released! This release is the first to support GeoPandas 1.0. Additionally, this release adds multiple new features, including: New explore() function adds interactive folium / leaflet maps New support for mfjson trajectory For the full change log, check out the release page. We have also revamped the documentation at https://movingpandas.readthedocs.io/ using the PyData Sphinx Theme: On a related note: if you know what I need to change to get all Trajectory functions listed in the TOC on the right, please let me know. …
12 juillet 2024Trajectools 2.2 released If you downloaded Trajectools 2.1 and ran into troubles due to the introduced scikit-mobility and gtfs_functions dependencies, please update to Trajectools 2.2. This new version makes it easier to set up Trajectools since MovingPandas is pip-installable on most systems nowadays and scikit-mobility and gtfs_functions are now truly optional dependencies. If you don’t install them, you simply will not see the extra algorithms they add: If you encounter any other issues with Trajectools or have questions regarding its usage, please let me know in the Trajectools Discussions on Github. …
8 juillet 2024New MovingPandas tutorial: taking OGC Moving Features full circle with MF-JSON Last week, I had the pleasure to meet some of the people behind the OGC Moving Features Standard Working group at the IEEE Mobile Data Management Conference (MDM2024). While chatting about the Moving Features (MF) support in MovingPandas, I realized that, after the MF-JSON update & tutorial with official sample post, we never published a complete tutorial on working with MF-JSON encoded data in MovingPandas. The current MovingPandas development version (to be release as version 0.19) supports: Reading MF-JSON MovingPoint (single trajectory features and trajectory collections) Reading MF-JSON Trajectory Writing MovingPandas Trajectories and TrajectoryCollections to MF-JSON MovingPoint This means that we can now go full circle: reading — writing — reading. Reading MF-JSON Both MF-JSON MovingPoint encoding and Trajectory encoding can be read using the MovingPandas function read_mf_json(). The complete Jupyter notebook for this tutorial is available in the project repo. Here we read one of the official MF-JSON MovingPoint sample files: traj = mpd.read_mf_json(‘data/movingfeatures.json’) Writing MF-JSON To write MF-JSON, the Trajectory and TrajectoryCollection classes provide a to_mf_js …
30 juin 2024New interactive trajectory plots for MovingPandas & experiments on their interpretation using ChatGPT 4o With the release of GeoPandas 1.0 this month, we’ve been finally able to close a long-standing issue in MovingPandas by adding support for the explore function which provides interactive maps using Folium and Leaflet. Explore() will be available in the upcoming MovingPandas 0.19 release if your Python environment includes GeoPandas >= 1.0 and Folium. Of course, if you are curious, you can already test this new functionality using the current development version. This enables users to access interactive trajectory plots even in environments where it is not possible to install geoviews / hvplot (the previously only option for interactive plots in MovingPandas). I really like the legend for the speed color gradient, but unfortunately, the legend labels are not readable on the dark background map since they lack the semi-transparent white background that has been applied to the scale bar and credits label. Speaking of reading / interpreting the plots … You’ve probably seen the claims that AI will help make tools more accessible. Clearly AI can interpret and describe photos, but can it also interpret MovingPandas plots? ChatGPT 4o interpretations of MovingPandas plots Not bad. And what …
Besoin de conseils, assistance, formation?
Visitez le site de NASCA et découvrez toutes nos offres de coaching SIG