3

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?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
maxwhere
  • 1,156
  • 6
  • 16
  • 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_weeds Jan 18 '18 at 11:08

2 Answers2

1

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

Babel
  • 71,072
  • 14
  • 78
  • 208
0

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
MrXsquared
  • 34,292
  • 21
  • 67
  • 117