mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 21:13:35 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
28
tools/python/stylesheet/drules_dump.py
Executable file
28
tools/python/stylesheet/drules_dump.py
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env python3
|
||||
# Dumps hashes of protobuffed drules
|
||||
import sys, re
|
||||
import itertools
|
||||
import drules_struct_pb2
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print 'Usage: {} <drules_proto.bin>'.format(sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
drules = drules_struct_pb2.ContainerProto()
|
||||
drules.ParseFromString(open(sys.argv[1]).read())
|
||||
result = []
|
||||
|
||||
for elem in drules.cont:
|
||||
if not elem.element:
|
||||
continue
|
||||
for el in elem.element:
|
||||
zoom = el.scale
|
||||
if zoom <= 0:
|
||||
continue
|
||||
for l in itertools.chain(el.lines, (el.caption, el.path_text, el.circle, el.area, el.symbol)):
|
||||
if l.HasField('priority'):
|
||||
l.ClearField('priority')
|
||||
result.append('{} z{}: {}'.format(elem.name, zoom, re.sub(r'[\r\n\s]+', ' ', str(el))))
|
||||
|
||||
for line in sorted(result):
|
||||
print line
|
||||
Reference in New Issue
Block a user