Using QGIS, I have to map the general area of my project. However, this area depends on another layer representing sub-areas.

I know that I can use the dissolve tool on the second layer to get the extent, which gives me the exact result I am looking for.

However, as the second layer will undergo further modifications which might impact its extent, I was wondering if there was a way to create some kind of a "virtual layer" that represents the extent of the sub areas from the second layer? I wish to avoid dissolving the layers over and over again.

I can't use a simple style trick, as my main extent has to be surrounded by a dash line (management requirement).

1 Answer 1


You can create a virtual layer with the dissolved geometry. Go to:
Layer -> Create Layer -> New Virtual Layer ...

In the Query section you write

SELECT st_union(geometry)
FROM "yourlayername"

and then press Add.
The function st_union dissolves the geometry of the layer. Yourlayername stands for the name of your layer representing the sub-areas.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.