Creating and modifying shapefiles
Shape files (.shp) are QGIS's way of storing location, shape, and attributes of geographic features (aka labels). Continuing our example, we'll take a look at how to create shape files in QGIS.
Last updated
Shape files (.shp) are QGIS's way of storing location, shape, and attributes of geographic features (aka labels). Continuing our example, we'll take a look at how to create shape files in QGIS.
Last updated
Open QGIS.
Open the GeoTiff file(s) to be labeled.
Open the Bing Satellite.
Make sure the Data Source Manager Toolbar is on your screen.
In the Data Source Manager Toolbar at the top, select the icon with four dots that says New Shapefile Layer...
when hovered over.
In the window that appears begin by giving the file a name next to File name
.
Try to give it a unique name that won't be confused later. For example, include the name of the instrument, the date that the data corresponds to, and the feature being labeled (eMAS_08022019_fire). This is just a guideline though, feel free to be as detailed as you'd like. Naming the shapefile after the original file with the specific feature at the end is also always a safe bet (eMASL1B_19910_06_20190806_1815_1824_V03_fire).
Then, select the button with 3 dots to the right of the file name, choose a directory for the shapefile to be stored in, and click save.
Try to save all the shape files for one image/images from the same instrument/scene in the same folder for easier access later. Stay consistent with how/where shape files (for every image) are stored, we'll need to access their file paths later.
Labeler's Note: I would recommend the example organization below. Other organizations (such as folders corresponding to each label_type (e.g. smoke, fire, background, etc.)) typically become a lot harder to work with during future steps when we need to gather all of the files using the command line. An organization, with each folder corresponding to an image, makes organizing the YAML a lot easier.
Here's an example organization:
For Geometry type, select Polygon.
This allows us to have a 2D shape rather than just a line.
At the bottom right of the window click OK.
Note: if you'd like to change the color of the shapefile, select the shapefile from the Layers panel and hover over to the Layer Styling panel and select any color.
Congrats, you now have your first shape file! Labeling is pretty simple.
With the data layer selected (in the Layers panel), navigate to the Layer Styling panel and choose which spectral band is best for viewing the feature you are labeling. For more documentation on this, see Understanding the data.
Now, with the shapefile layer selected, select the yellow pencil button from the Digitizing toolbar that says Toggle Editing
when hovered over.
Then select the green button to the right of the pencil (that appears when the pencil is selected) that says Add Polygon Feature
when hovered over.
Click on the perimeter of the feature you would like to label and begin labeling.
Once you have completed your label, right click on the screen and select OK in the pop up that appears.
Here is an example of a label of the burnscar from the William's Flat's Fire.
Congrats, you now have your first label! Use these steps to create as many labels as needed. For more documentation on more complex features (deleting labels, modifying labels, etc.) see Other shapefile tools.
Labeler's Note: For better results, create a background label(s)! You can create a general label (e.g. _background) for each image that encompasses everything except the features you are labeling, or you can create a background label for each specific feature (e.g. _fire_background, _smoke_background) of each image, which encompasses everything except that specific feature. For example, its okay if the label for _fire_background overlapped onto the _smoke label.