QGIS Planet

GeoParquet 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 columns
CSV27.9 s13.1 s
Geopackage2min 12s 😵20.2 s
GeoParquet7.2 s4.1 s

Indeed, reading the whole GeoPackage is getting quite painful.

Here’s the code I used for timing the read times:

As you can see, these times include the creation of the GeoPandas.GeoDataFrame.

If we don’t need a GeoDataFrame, we can read the files even faster:

Non-spatial DataFrames

GeoParquet files can be read by non-GIS tools, such as Pandas. This makes it easier to collaborate with people who may not be familiar with geospatial data stacks.

And reading plain DataFrames is much faster than creating GeoDataFrames:

But back to GIS …

GeoParquet in QGIS

In QGIS, GeoParquet files can be loaded like any other vector layer, thanks to GDAL:

Loading the GeoParquet and GeoPackage files is pretty quick, especially if we zoom into a small region of interest (even though, unfortunately, it doesn’t seem possible to restrict the columns to further speed up loading). Loading the CSV, however, is pretty painful due to the lack of spatial indexing, which becomes apparent very quickly in the direct comparison:

(You can see how slowly the red CSV points are rendering. I didn’t have the patience to include the whole process in the GIF.)

As far as I can tell, my QGIS 3.38 ‘Grenoble’ does not support writing to or editing of GeoParquet files. So I’m limited to reading GeoParquet for now.

However, seeing how much smaller GeoParquets are compared to GeoPackages (and also faster to write), I hope that we will soon get the option to export to GeoParquet.

For now, I’ll start by converting my large CSV files to GeoParquet using GeoPandas.

More reading

If you’re into GeoJSON and/or PyGeoAPI, check out Joana Simoes’ post: “Navigating GeoParquet: Lessons Learned from the eMOTIONAL Cities Project”

And if you want to see a global dataset example, have a look at Matt Travis’ presentation using Overture data:

Learn More

属性値に応じて地物を絞り込もう〜QGISの便利なフィルタ機能を紹介〜 - QGIS LAB by MIERUNE

はじめに地図データを可視化する際に、「都道府県のポリゴンデータから特定の市町村のポリゴンだけを表示したい」とか「人口が◯◯人以上の都道府県のみを表示させたい」といった特定の条件に合致した地物のみを絞り込んで表示したいと思ったことはないでしょうか。このような場合には、QGISのフィルタ機能を用いることで、ベクタデータの属性値に基づいて特定の値を持つ地物のみを抽出し、データを表示することができます。こ...
Learn More

Suivre le Vendée Globe 2024 depuis un SIG

Créer et visualiser les données SIG de l'avancement de la course du Vendée Globe 2024 à partir des tableurs officiels.
Learn More

QGISの活用事例も満載!FOSS4G 2024 Japan イベントレポート - QGIS LAB by MIERUNE

はじめに2024年11月9日から10日にかけて、地理空間技術のオープンソースコミュニティ(FOSS4G)が集結するイベント「FOSS4G 2024 Japan」が、専修大学生田キャンパスで開催されました。このイベントは一般社団法人OSGeo日本支部(OSGeo.JP)の主催で、地理空間情報システム(GIS)をはじめとするオープンソース技術の最新動向を共有する場として、毎年多くの開発者、ユーザー、研...
Learn More

(Fr) [Story] Oslandia x QWC : épisode 1 / 8

Sorry, this entry is only available in French.

Learn More

(Fr) [Story] Oslandia x QWC : épisode 6 / 8

Sorry, this entry is only available in French.

Learn More

東京都23区の3次元点群データをQGISで表示してみよう〜東京都デジタルツイン実現プロジェクト〜 - QGIS LAB by MIERUNE

はじめに東京都は、2024年10月31日に、スマート東京を目指す「デジタルツイン実現プロジェクト」の一環として、区部の高精度な3次元点群データを公開しました。これにより、防災や都市計画のシミュレーションに加え、観光・ゲーム分野での利用が期待されています。この記事では、デジタルツイン実現プロジェクトの概要と、公開されたデータの紹介、そしてQGISでの活用方法について詳しく説明します。デジタルツイン実...
Learn More

[Case Study] Citizen science in Zurich with Camptocamp and Mergin Maps

Discover how Camptocamp, in collaboration with Zurich, used Mergin Maps and QGIS to map bird nesting sites, empowering volunteers to collect accurate survey data.
Learn More

GeoPackageでデータを管理しよう!新規作成と変換方法の紹介 - QGIS LAB by MIERUNE

はじめにGeoPackageとはベクタデータのファイル形式の1つです。QGISでは、3系のバージョンよりGeoPackageがデフォルトのファイル形式となっています。GeoPackageは、複数のレイヤを1つのファイルにまとめて保存できたり、大容量のデータに対応しているなど、Shapefileの欠点を解消した新しいデータ形式です。この記事では、QGISにおけるGeoPackageの使い方や利便性に...
Learn More