Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
podcast
Filter by Categories
ArcGIS Pro
GDAL
GeoJson
Map
Map Tools
Maps
postgis
Python
QGIS
Uncategorized

How to Get WKT and JSON Data for Geometries in QGIS

How to Get WKT and JSON Data for Geometries in QGIS

In this tutorial, we will guide you through the process of obtaining Well-Known Text (WKT) or JSON data for geometries using a handy plugin in QGIS. This is particularly useful for those who need to extract geometry data in a textual format for use in various applications.

Step 1: Install the Get WKT Plugin

Start by opening QGIS and selecting the layer for which you want to extract the geometry. In our example, we will select the boundary of Greater London.

Selecting the layer boundary of Greater London

Next, navigate to the top menu and click on Plugins, then choose Manage and Install Plugins.

Navigating to the plugins menu

In the search bar, type in WKT. You should see a plugin called Get WKT. Click on it and hit the Install button.

Installing the Get WKT plugin

Step 2: Extract WKT Geometry

Once the plugin is installed, you can close the plugin window. You will notice a new button added to your toolbar.

New button for Get WKT plugin in QGIS

With your layer still selected, click on the drop-down menu of the new button and select Get WKT String. A pop-up window will appear displaying the geometry.

Selecting Get WKT String from the drop-down menu

In this case, the geometry is a multi-polygon. You can copy this text and paste it into your application of choice, such as Notepad.

Pop-up window showing the WKT geometry

Step 3: Extract JSON Data

You can also extract JSON data using the same plugin. Simply repeat the steps above and select the option for JSON instead of WKT.

Extracting JSON data using the Get WKT plugin

And that’s it! You now have the WKT or JSON data for your geometry extracted from QGIS.

About the Author
I'm Daniel O'Donohue, the voice and creator behind The MapScaping Podcast ( A podcast for the geospatial community ). With a professional background as a geospatial specialist, I've spent years harnessing the power of spatial to unravel the complexities of our world, one layer at a time.