mirror of
https://github.com/hyperknot/openfreemap.git
synced 2026-05-22 06:22:16 +00:00
remove keys
This commit is contained in:
@@ -35,6 +35,8 @@ def cli(styles_folder):
|
|||||||
|
|
||||||
print(f'formatting {style_file}')
|
print(f'formatting {style_file}')
|
||||||
|
|
||||||
|
remove_keys(style_file)
|
||||||
|
|
||||||
# gl-style-migrate
|
# gl-style-migrate
|
||||||
p = subprocess.run(
|
p = subprocess.run(
|
||||||
[node_bin_path / 'gl-style-migrate', style_file], capture_output=True, text=True
|
[node_bin_path / 'gl-style-migrate', style_file], capture_output=True, text=True
|
||||||
@@ -64,5 +66,16 @@ def cli(styles_folder):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def remove_keys(style_file):
|
||||||
|
with open(style_file) as fp:
|
||||||
|
data = json.load(fp)
|
||||||
|
|
||||||
|
for key in ['id', 'center', 'zoom', 'bearing', 'pitch']:
|
||||||
|
data.pop(key, None)
|
||||||
|
|
||||||
|
with open(style_file, 'w') as fp:
|
||||||
|
json.dump(data, fp, ensure_ascii=False)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
cli()
|
cli()
|
||||||
|
|||||||
Reference in New Issue
Block a user