Make a separate layer for each unique metadata value.
Fix raster output builds; pass meta through with lines as well.
Write the metadata as an attribute in the vector output.
Revert accidental change that made 0-length vectors.