How to create AI train data with QGIS
In this how-to, we will use Areas to store our data in. Areas can overlap and be grouped together using a particular attribute, in this case FOLIAGE. The FOLIAGE attribute should contain a single integer number, which represents the classification. For example, we can use the following classification:
- Deciduous Tree
- Pine Tree
- Heath area
- Hedge
- Bush
- Reed
- Flower bed
- Leafless Tree Area
The areas are drawn on top of a particular Overlay or WMS Layer of your project. In this case we will use the original satellite background layer of a Project's WMS service.
How to create AI train data with QGIS:
- Open your project in editor mode.
- Hover over Areas in the ribbon bar, and select Add new Empty Area.
- With the Area selected, select the Attribute tab in the Area Detail Panel.
- Under Add new Attribute, type FOLIAGE for name and 1 for value.
- Click Save New Attribute to add the FOLIAGE attribute.
- Click on the Group by Attribute button in the Area Overview Panel.
- Add the same Attribute name as added for the Area in the previous steps.
- Next, hover over Areas in the ribbon bar and select Export Geo Data
- For Filter, select Foliage
- Select any of the GeoJSON options.
- Click on the Copy the URL button next to Web Feature Service (WFS)
- Open QGIS
- In QGIS, Hover over Layer in the ribbon bar, and under add new Layer, select add WFS / OGC API Feature Layer
- In the Data Source Manager panel, select New.
- Paste the copied WFS url from the Export Geo Data panel and paste it in the url field.
- Provide an appropriate name, for example Foliage - My Project Name and confirm.
- Click on the Connect button.
- Select the layer named Foliage Areas and click on Add.
- In the Tygron Application again, hover over Overlays and select Export Grid Data
- Click on the Copy URL
Notes
- You can choose to change the Attribute Form of the WFS Feature Layer to use the Classification instead of a text field with a number, in case the classification numbers are hard to remember.