Is it possible to create multiple geom_from_wkt()
elements like Using QGIS Geometry Generator to get rectangle from point? in a single geometry generator symbol layer?
-
Do you mean a single symbol layer as in one geometry generator layer (so the expression must generate multiple elements), or a single symbology layer (so they appear as a group)? For the latter you could just add multiple geometry generator layers within the one symbology using the + button... offset them as required.– she_weedsJan 18, 2018 at 11:08
2 Answers
Probably too late for OP, maybe useful for others who wind up here:
This can be achieved with collect_geometries(geometry1,geometry2…)
Available since QGIS 3.10: https://www.qgis.org/en/site/forusers/visualchangelog310/index.html#feature-new-expression-functions
I used this:
rotate(make_line(
make_point(x($geometry)-"W"/2000,y($geometry)+"L"/2000),
make_point(x($geometry)+"W"/2000,y($geometry)+"L"/2000),
make_point(x($geometry)+"W"/2000,y($geometry)-"L"/2000),
make_point(x($geometry)-"W"/2000,y($geometry)-"L"/2000),
make_point(x($geometry)-"W"/2000,y($geometry)+"L"/2000)
),"angle")
- where a polygon is created with a series of points within a make_line function
- "W" and "L" are the sides of the rectangle in mm
- the same polygon is rotated based on the field "angle"
- the geometry is a point vector layer