As part of trying to find an answer for How to -explode only one subfeature from only one feature? I created some fields in one layer only, then, after doing some operations, tried to merge that layer back with one other specific layer.
The docs for
merge-layers say you can use
name= but I've not managed to get either to work:
target=can accept a comma-separated list of layers, but it seems not to work:
If I wrap each layer name in quotes:
-merge-layers target="'layer A', 'layer B'"
...I get an error suggesting it's looking for one layer called
'layer A', 'layer B':
Missing target: 'layer A', 'layer B'
Available layers: [list of layers here]
If I don't wrap each layer name in quotes:
-merge-layers target="layer A, layer B"
... then I get no errors, but nothing happens. It doesn't merge the layers.
If I add a
namethen it renames only the first layer in the comma separated list (regardless of what layer is selected). For example, this:
-merge-layers target="layer A, layer B" name="new layer"
...renames layer A to "new layer" but does nothing at all to layer B. So for whatever reason it seems to ignore the layers after the first in the comma seperated list.
I also tried using
-merge-layers name="'layer A', 'layer B'"
...which ran into this error, despite the fact I had used
-filter-fieldsto remove these fields from the layers I was targeting:
Field missing from one or more layers: someField
...but I later discovered that this was because I'd misunderstood the
nameparameter: this was simply the name the new merged field would take, so since I had no
targetdefined, it was trying to merge all layers and was picking up on errant fields in layers other than the ones I was trying to merge.
I also tried using one layer name as a regular parameter and one as a
target=but it didn't like that either:
-merge-layers 'layer A' target="layer B"
...gives this error:
Unexpected option: layer A
I also tried two
targetoptions, but this doesn't work:
-merge-layers target="layer A" target="layer B"
All the usage examples I can find for
-merge-layers use it to merge every layer.
What's the correct way to target and merge specific layers?