Latest news will appear here soon.

Tag: qgis

QGIS to (Geo)Pandas follow-up

The conversation around Looking for better ways to convert between QGIS VectorLayer and (Geo)DataFrame is continuing over at https://fosstodon.org/@underdarkGIS/115442614331293320

What I’ve learned so far:

Exciting times for spatial data science tooling 🤩

Learn More

QFieldのプロジェクトをQGISで開くには?PCへの転送手順を解説 - QGIS LAB by MIERUNE

はじめにQFieldを使用して現地調査作業を完了した後、収集したデータをQGISで活用するには、QGISにデータを転送する必要があります。この記事では、QFieldで収集したデータをPCに転送し、QGISで正しく開いて活用するための手順を、AndroidとiOSそれぞれの場合に分けて詳しく解説します。なお、この記事では、現地で新たに追加したポリゴンの地物を含むQFieldプロジェクトを例として説明...
Learn More

Improved Access to Microsoft Planetary Computer in QGIS via STAC

Explore how QGIS now supports direct access and authentication for Microsoft Planetary Computer’s STAC datasets, enabling users to filter, view, and stream geospatial data efficiently.
Learn More

[Blog] Photo sketching is now available in Mergin Maps

Discover the new photo sketching feature in Mergin Maps – annotate images with sketches, notes, and highlights directly in the app using touch or stylus. Learn how to enable and use this tool in your QGIS projects.
Learn More

Trigger Happy: Live edits in QGIS

QGIS and PostgreSQL working well together
Learn More

Looking for better ways to convert between QGIS VectorLayer and (Geo)DataFrame

Plugin developers who want to use (Geo)Pandas-based functionality in their plugins regularly face the challenge of converting QGIS vector layers to (Geo)DataFrames. There is currently no built-in convenience function.

In Trajectools, so far, I have been performing the conversion manually, looping through all features and taking care of tricky column types, such as datetimes and geometries:

def df_from_layer_trajectools(layer,time_field_name="t"):
    # Original Trajectools 2.7 version
    names = [field.name() for field in layer.fields()]
    data = []
    for feature in layer.getFeatures():
        my_dict = {}
        for i, a in enumerate(feature.attributes()):
            if names[i] == time_field_name and isinstance(a, QDateTime):
                a = a.toPyDateTime()
            my_dict[names[i]] = a
        pt = feature.geometry().asPoint()
        my_dict["geom_x"] = pt.x()
        my_dict["geom_y"] = pt.y()
        data.append(my_dict)
    df = pd.DataFrame(data)
    return df

It works (mostly), but it’s far from fast. For the 25 million Geolife points, it takes 4 minutes:

In an attempt to speed-up (and make the conversion more robust, e.g. regarding datetime/timezone conversion and null values), I’ve spent some time at SDSL2025 with Joris Van den Bossche trying a workaround that writes the QGIS layer to an Arrow file and then reads that file with pyogrio:

def gdf_from_layer_arrow(layer):
    # SDSL2025 version
    with tempfile.TemporaryDirectory() as tmpdirname:
        path = os.path.join(tmpdirname, "data.arrow")

        options = QgsVectorFileWriter.SaveVectorOptions()
        options.actionOnExistingFile = QgsVectorFileWriter.CreateOrOverwriteFile 
        options.layerName = 'data'
        options.driverName = "arrow"
        
        QgsVectorFileWriter.writeAsVectorFormatV3(
            layer, path, QgsProject.instance().transformContext(), options
        )
       
        meta, table = pyogrio.read_arrow(path)
        gdf = gpd.GeoDataFrame.from_arrow(table)

    return gdf

Not only do we get a GeoDataFrame in return, this also runs in half the time, i.e. in 2 minutes instead of 4:

Switching to this approach will require adding pyogrio to the plugin dependencies. Looks like it could be worth it.

We also discussed another alternative: It would be faster to read the vector layer data source directly, in case it is a supported file format. However, this means we’d need separate handling for other input layers.

There’s also the issue of supporting the Processing feature that allows users to run the algorithm only on the selected features because selected features are only exposed through QgsProcessingParameterFeatureSource (and not through QgsProcessingParameterVectorLayer). Maybe the Export Selected Features algorithm can cover this case but it will export an empty layer if there is no selection.

Are you aware of any other / better ways to approach this issue? Any pointers are appreciated.

Learn More

日本から世界へ!FOSS4G 2025 Japan参加レポート - QGIS LAB by MIERUNE

はじめに2025年10月11日・12日、専修大学生田キャンパスにて、一般社団法人OSGeo日本支部(OSGeo.JP)の主催により「FOSS4G 2025 Japan」が開催されました。今回のテーマは「CONNECT TO ___ 」。「FOSS4G」とは、地理空間技術のオープンソースソフトウェア群を指す言葉であり、その普及や知見共有を目的としたカンファレンスの名称でもあります。2026年には、グ...
Learn More

QGISで地図をまとめて自動出力!地図帳機能の設定方法を解説 - QGIS LAB by MIERUNE

はじめにQGISの印刷レイアウトの機能を使って、「市区町村ごと」や「顧客のリストの地点ごと」など、同じレイアウトで大量の地図を効率的に作成したい、と考えたことはありませんか?QGISに標準搭載されている「地図帳機能」は、このような定型的な地図を効率的に自動生成できる強力なツールです。この記事では、QGISの地図帳機能の基本的な使い方から応用テクニックまで、順を追って解説します。地図帳機能を使うには...
Learn More

(Fr) [Témoignage Client] Nicolas Godet, ISL Ingénierie

Sorry, this entry is only available in French.

Learn More