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

Step-by-Step Guide to Drawing Shapes in QGIS

Step-by-Step Guide to Drawing Shapes in QGIS

Drawing shapes in QGIS may seem daunting at first, but with the right steps, you can easily create points, lines, and polygons in your projects. This tutorial will guide you through the process of setting up layers, enabling editing, and saving your work effectively.

Step 1: Understanding the Need for a Host Layer

In QGIS, drawing shapes like points, lines, or polygons requires a dedicated layer to host these geometries. Unlike graphic design software where you can freely draw, QGIS necessitates the creation of a layer first. This foundational step is crucial for proper organization and management of spatial data.

Creating a New Layer

To create a new layer, navigate to the menu and select Layer, then Create Layer. You have the option to choose between a GeoPackage or a Shapefile. For this tutorial, we’ll focus on using a GeoPackage.

Creating a new layer in QGIS

Setting the Geometry Type

After choosing the layer type, specify the geometry type based on what you plan to draw. For example, if you want to draw a line, select Line as the geometry type. This selection is essential as it determines the features available for editing later.

Setting the geometry type for the new layer

Enabling Editing on the Layer

Once your layer is created, you must enable editing. This is done by clicking the yellow pencil icon, which toggles the editing mode. When editing is enabled, additional options for adding features become available.

Enabling editing on the layer

Drawing a Line Feature

With editing enabled, you can add a line feature. Click the Add Line Feature button, and your cursor will change to a crosshair. Click on the map to create your line by placing vertices. Right-click to finalize the line, and a prompt will appear to fill out any additional attributes associated with the geometry.

Drawing a line feature in QGIS

Saving Layer Edits

After drawing your line, it’s crucial to save the edits. Click on the Save Layer Edits icon. Remember, saving the layer edits is separate from saving the project. Ensure both actions are completed to avoid losing your work.

Saving layer edits in QGIS

Creating a Polygon Layer

To create a polygon, repeat the layer creation process. This time, set the geometry type to Polygon. You can also add fields, such as Country Name, which allows for data entry related to the polygon.

Creating a polygon layer in QGIS

Adding a Polygon Feature

With editing enabled on the polygon layer, select the Add Polygon Feature option. Click to define the vertices of the polygon, and right-click to finalize it. You will be prompted to enter attributes for the polygon, such as its name.

Adding a polygon feature in QGIS

Saving Polygon Edits

Similar to the line feature, it’s important to save the edits made to the polygon layer. Click on Save Layer Edits to ensure that your changes are preserved.

Saving polygon edits in QGIS

Exploring Other Geometry Creation Methods

Beyond freehand sketching, QGIS offers various methods to create geometries. With the editing mode activated, you can explore options like adding circles or other shapes. This versatility allows for more precise and varied geometric representations.

Exploring geometry creation methods in QGIS

Understanding CRS and Projection Issues

When working with geometries, be aware of the Coordinate Reference System (CRS) used in your project. For instance, if you are drawing shapes in the UK, ensure that your layer’s CRS matches the project’s CRS to maintain accuracy in shape representation.

Understanding CRS and projection issues in QGIS

Creating Shapes in the Correct CRS

If you encounter issues with shapes not appearing as expected, consider creating a new layer with the appropriate CRS. This can be done by selecting the current project CRS during the layer creation process. This adjustment ensures that geometries, like circles, are rendered correctly.

Creating shapes with the correct CRS in QGIS

Step 8: Adding Fields to the Polygon Layer

When creating a polygon layer, it’s essential to define fields that will hold attribute data associated with the shapes you draw. This step enhances your data’s richness and allows for better analysis later on.

To add fields, you will need to specify them during the layer creation process. For example, if you’re mapping countries, you might want to include fields like Country Name, Population, or Area. Each field will correspond to a column in the associated attribute table.

 

FAQ: Common Questions About Drawing in QGIS

Can I draw shapes without creating a layer first?

No, in QGIS, a layer is necessary to host any drawn shapes. You must create a layer to begin drawing.

What types of geometries can I create?

You can create points, lines, and polygons. Additionally, QGIS allows for the creation of circles, rectangles, and ellipses using specific tools.

How do I save my edits?

After making changes, remember to click the Save Layer Edits button. This action saves your geometry changes separately from the project file.

What should I do if my shapes appear distorted?

If you notice distortion, check the CRS settings for both your project and layers. Ensure they match to correct any issues with shape representation.

Can I edit my shapes after saving?

Yes, you can edit your shapes anytime by enabling editing mode on the layer. Just remember to save your edits afterward.

 

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.