Exemplo n.º 1
0
        os.environ['TOPMAR_FLOATING'] = ''
    elif topmar_type == 'floating':
        os.environ['TOPMAR_FLOATING'] = '1'
    else:
        print('topmark_type must be either floating or rigid')
        sys.exit(2)

    if args.format is Format.Chart:
        layer_definitions_exist = dirutils.does_layer_rules_exist(
            rule_set_path)
        if not layer_definitions_exist or args.force:
            create_layer_rules(RESOURCES_PATH,
                               os.path.join(rule_set_path, "layer_rules"))

        # TODO: Let this script run from anywhere and skip the chdir
        os.chdir(os.path.dirname(__file__))

        generate_basechart_config(data_path, map_path, rule_set_path,
                                  RESOURCES_PATH, args.force, debug,
                                  point_table, area_table, displaycategory,
                                  chartsymbols)
    else:
        print('Data format "{}" has not yet been ported to the configuration '
              'file. Use the old script to generate your mapfiles'.format(
                  args.format),
              file=sys.stderr)
        sys.exit(1)

    for symbolset in symbolsets:
        generate_symbolset(symbolset, os.path.join(map_path, 'symbols'), False)
Exemplo n.º 2
0
#!/usr/bin/env python3

import argparse
from mapgen.generate_symbolset import (
    generate_symbolset,
    symbolsets,
    update_file,
)

if __name__ == '__main__':
    parser = argparse.ArgumentParser()
    parser.add_argument('--update',
                        '-u',
                        help='Update the symbol definition files',
                        action='store_true')
    parser.add_argument('symbolset',
                        help='Symbolset to generate',
                        choices=symbolsets + ('all', ))
    parser.add_argument('destination', help='Dataset destination folder')

    args = parser.parse_args()

    update_file('chartsymbols.xml', force=args.update)
    if args.symbolset == 'all':
        for symbolset in symbolsets:
            generate_symbolset(symbolset, args.destination, args.update)
    else:
        generate_symbolset(args.symbolset, args.destination, args.update)