How to use optional arguments

I am trying to use the return_difference argument in layer_intersection without using the merge_attributes argument. Both are listed as optional so I thought I could use either without the other.

-> select({*,exposure: layer_intersection(exposure, bookmark('Suburbs'), return_difference: true)})

riskscape output is

     - More arguments required. Keyword 'return_difference' is argument 4 but only 3 arguments were specified

What I would like is for all attributes of both layers to be merged and to include all features even if they don’t overlap.

Hi John,

From memory, I think you can use an empty struct as the 3rd argument, but that would not merge any attributes, e.g.

layer_intersection(exposure, bookmark('Suburbs'), { }, return_difference: true)})

That’s not what you want here - I think the only way to merge all the attributes is to specify them all individually.

Cheers,
Tim