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.
Next, navigate to the top menu and click on Plugins, then choose Manage and Install Plugins.
In the search bar, type in WKT. You should see a plugin called Get WKT. Click on it and hit the Install button.
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.
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.
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.
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.
And that’s it! You now have the WKT or JSON data for your geometry extracted from QGIS.