DuckDB and QGIS

Nov 27, 2023 | 911, address, Python, QGIS

I’ve not taken time over the last few months to “play” with geo. I’ve been hitting conferences and marketing and doing all the things I sort of don’t like that much. More talk of conferences coming.

One thing I’ve seen pop up more and more is duckdb. Wht is it? Basically a serverless database. It’s local. You use it for data analysis or data update locally. For everything I’ve been doing with a database lately duckdb won’t work – BUT – it’s interesting.

I downloaded it and ran it and basically after some hit or miss since I barely read the documentation I read in a shapefile. Basically after making a database and a table I did:

create table addresses as select * from st_read('../../temp/address_points.shp');

I did a little bit of SQL and had fun. DuckDB has a spatial extension so you can do things like load spatial data like a shapefile or Geopackage.

Why talk about it? This announcement from Oslandia:

So with a small amount of effort to install an experimental plugin (no I’m not telling you how to install an experimental plugin):

I can view the data and run processes – I just can’t edit it. Yet. At least I hope it’s a yet. I see much possibility in duckdb. Well – basically I see great possibility in anything where there is an open spec and a community growing around it. Plus this is pretty new and QGIS can already view the database.

The important part as taken from the blog post:

The following features are already identified. You can make them a reality through funding :

  • Layer editing (modify data, add/delete columns, create/delete entities, etc.)
  • Importing a spatial layer from QGIS directly into a DuckDB database
  • Better integration of DuckDB in QGIS
  • Support for tables with multiple geometry types
  • If you have any development requests, please don’t hesitate to contact us: contact@oslandia.com

You may also like

My So called Life as a Map Maker

My So called Life as a Map Maker

I can sum it up: It's not much of one. Way back in my younger days I was infatuated with ArcPlot (which was the plotting portion of ArcINFO). From there I moved to Arcview, ArcMap, and eventually here to QGIS. All of my work typically revolves around Data. I usually...

Tricks with an ESRI File Geodatabase

Tricks with an ESRI File Geodatabase

A few years back I jumped in way over my head with QGIS/Postgis. I had moved a process out of one software and into my favorite two (QGIS/PostGIS) and little did I know the final output had to be a ESRI File Geodatabase. So what did I do? I shamed them into using a...

Making the Invalid Valid

Making the Invalid Valid

I could argue I'm doing that on multiple levels these days. Except I want to talk Geometry, QGIS, and Forks in the Road. I haven't done just a "QGIS Tech Post" in a while. I talk about it and training and generalities but hardly dive into the specifics. So here is a...