1

I am trying to create folding marks in the QGIS-print composer. Basically they are just markers along a line - with the twist, that the spacing is not even. I want to avoid having to create several lines, because that would involve a lot of fiddling and wouldn't be as elegant.

So my idea is to create either a line or an arrow and use make_point(...) in order to create orthogonal dashes along that line/arrow. Sadly testruns didn't work, so the question is, whether I actually could use the geometry generator in this scenario, and if yes, which "coordinate system" I would have to use. So far I tried mm-based coordinates within the bbox of the line/arrow.

  • can u explain what kind of use u made of make_point() so far ? – snaileater Jun 15 at 8:59
  • 1
    seems like you want the line_interpolate_point function. – csk Jun 16 at 18:42
2

There's an issue with the Geometry Generator for polyline items in the print composer. If you try to place a point on a polyline print composer item using a geometry generator (geometry type: point) and the function line_interpolate_point($geometry,distance), it's not clear what units the distance value is. I tried it with a very wide range of values, from 0.0000001 to 5000000. I couldn't find any distance value where a point appeared on the line.

enter image description here

It seems like the polyline item should be linked to the map item, so it can have a defined coordinate reference system. It's not, though. There's nowhere in the polyline item properties where you can choose to link it to a specific map. I'm not sure if this is a bug, or just an under-developed feature.


As a workaround, you can place points at variable distances on a polyline item using multiple marker line symbol layers. You just have to add an additional symbol layer for each point.

For Marker Placement, choose "on first vertex only." Add an offset value.

enter image description here

For Marker Type, choose the line marker.

enter image description here

Note: Unlike the geometry generator symbol type, you can choose "map units" for the offset value. I'm not sure what happens if you have more than one map item with different map units.

  • This workaround should be fine, thanks a lot. – Erik Jun 17 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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