unvt / charites

It is an application to style vector tiles easily
https://unvt.github.io/charites/
MIT License
51 stars 13 forks source link

Add a command that can copy layer file #24

Open naogify opened 2 years ago

naogify commented 2 years ago

Add the command to duplicates a new layer based on an existing layer. Also, it's better to have an option to create a template layer file.

Command might be like

$ charites copy old-layer.yml new-layer.yml
or
$ charites add-layer --copy old-layer.yml
hfu commented 2 years ago

A great idea! May I propose the following:

Assumption

The source style description forms the standard charites structure, such as:

style.yml
layers/layer1.yml
layers/layer2.yml

Command

charites copy style.yml layer1 layer1a

This should make a duplicate of layers/layer1.yml as layers/layer1a.yml and insert reference to layers/layer1a.yml from style.yml.

What do you think?