Files
comaps/tools/python/stylesheet/drules_dump.py
Konstantin Pastbin e3e4a1985a 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
2025-05-08 21:10:51 +07:00

29 lines
759 B
Python
Executable File

#!/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