Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add style-tools binary #416

Merged
merged 6 commits into from
Sep 27, 2022
Merged

Conversation

lazaa32
Copy link
Collaborator

@lazaa32 lazaa32 commented Sep 21, 2022

This PR adds utility for handling style. Related to this PR in OMT: openmaptiles/openmaptiles#1420

  • It adds spritezero to generate sprite files from svg icons.
  • It adds style-tools binary and styleutils.py.

style-tools split to split style.json into style snippet layer_name.json, one per layer. Style snippets also keep the style layers order from the original style.json
style-tools merge to merge all style snippets into a new style.json with layers ordered based on order value.

Add styleutils.py
Add spitezero to Dockerfile
bin/style-tools Outdated Show resolved Hide resolved
bin/style-tools Outdated Show resolved Hide resolved
openmaptiles/styleutils.py Outdated Show resolved Hide resolved
openmaptiles/styleutils.py Outdated Show resolved Hide resolved
openmaptiles/styleutils.py Outdated Show resolved Hide resolved
return int(layer.get('order'))


def split(tileset_fp: Path, style_fp: Path):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, i think it is much better to work with the style by its name, not path. You can just do a tileset.layers[style] (and catch an error if its not there)

openmaptiles/styleutils.py Outdated Show resolved Hide resolved
openmaptiles/styleutils.py Outdated Show resolved Hide resolved
openmaptiles/styleutils.py Outdated Show resolved Hide resolved
@lazaa32 lazaa32 merged commit e7c63b2 into openmaptiles:master Sep 27, 2022
francois2metz pushed a commit to indoorequal/openmaptiles-tools that referenced this pull request Mar 17, 2023
Add style-tools binary
Add styleutils.py
Add spitezero to Dockerfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants