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?

1
  • 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, 2018 at 11:08

2 Answers 2

2

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

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

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.