feat: implement S-52 TX TE text presentation
This commit is contained in:
@@ -114,6 +114,12 @@ def main() -> int:
|
||||
unsupported_csp_counts = Counter()
|
||||
opcode_counts = Counter()
|
||||
direct_symbol_counts = Counter()
|
||||
pattern_counts = Counter()
|
||||
complex_line_counts = Counter()
|
||||
area_color_counts = Counter()
|
||||
simple_line_counts = Counter()
|
||||
tx_rule_counts = Counter()
|
||||
te_rule_counts = Counter()
|
||||
substitution_counts = Counter()
|
||||
|
||||
sql = (
|
||||
@@ -165,7 +171,19 @@ def main() -> int:
|
||||
opcode_counts[opcode] += 1
|
||||
args_list = rule.get("args") or []
|
||||
if opcode == "SY" and args_list:
|
||||
direct_symbol_counts[str(args_list[0])[:8]] += 1
|
||||
direct_symbol_counts[str(args_list[0]).strip("'\"")[:8]] += 1
|
||||
elif opcode == "AP" and args_list:
|
||||
pattern_counts[str(args_list[0]).strip("'\"")[:8]] += 1
|
||||
elif opcode == "LC" and args_list:
|
||||
complex_line_counts[str(args_list[0]).strip("'\"")[:8]] += 1
|
||||
elif opcode == "AC" and args_list:
|
||||
area_color_counts[str(args_list[0]).strip("'\"")] += 1
|
||||
elif opcode == "LS" and len(args_list) >= 3:
|
||||
simple_line_counts[tuple(str(x).strip("'\"") for x in args_list[:3])] += 1
|
||||
elif opcode == "TX":
|
||||
tx_rule_counts[tuple(str(x) for x in args_list)] += 1
|
||||
elif opcode == "TE":
|
||||
te_rule_counts[tuple(str(x) for x in args_list)] += 1
|
||||
if opcode == "CS" and args_list:
|
||||
name = str(args_list[0])[:8]
|
||||
csp_counts[name] += 1
|
||||
@@ -202,6 +220,13 @@ def main() -> int:
|
||||
"implemented_csp_counts": dict(implemented_csp_counts),
|
||||
"unsupported_csp_counts": dict(unsupported_csp_counts),
|
||||
"direct_symbol_top100": direct_symbol_counts.most_common(100),
|
||||
"symbol_resource_counts": direct_symbol_counts.most_common(),
|
||||
"pattern_resource_counts": pattern_counts.most_common(),
|
||||
"complex_line_resource_counts": complex_line_counts.most_common(),
|
||||
"area_color_counts": area_color_counts.most_common(),
|
||||
"simple_line_rule_counts": [[list(k), v] for k, v in simple_line_counts.most_common()],
|
||||
"tx_rule_counts": [[list(k), v] for k, v in tx_rule_counts.most_common()],
|
||||
"te_rule_counts": [[list(k), v] for k, v in te_rule_counts.most_common()],
|
||||
"class_substitution_counts": [
|
||||
{"source_object_class": k[0], "s52_object_class": k[1], "geometry_type": k[2], "count": v}
|
||||
for k, v in substitution_counts.most_common()
|
||||
|
||||
Reference in New Issue
Block a user