Ejemplo n.º 1
0
)
parser_cut_data.add_argument(
    'planetOSM', help='Full path of the planetOSM file in O5M format'
)
parser_cut_data.set_defaults(func=cut_data)


# script arguments
parser.add_argument(
    '--verbose', action='store_true', default=False,
    help='show verbose execution messages'
)

parser.add_argument(
    '--settings', default='settings.yaml',
    help='path to the settings file, default: settings.yaml'
)


if __name__ == '__main__':
    # parse the args, and call default function
    args = parser.parse_args()

    proj_settings = POSMSettings(args.settings, verbose=args.verbose)
    settings = proj_settings.get_settings()

    # setup logging, has to be after osmext.settings
    logging.config.dictConfig(settings.get('logging'))

    args.func(args)
Ejemplo n.º 2
0
parser.add_argument(
    '--simplify', default=0, help='simplify tolerance in degrees, default: 0',
    type=float
)

parser.add_argument(
    '--output_dir', default='poly', help='output directory, default: poly'
)

parser.add_argument(
    '--geojson', action='store_true', default=False,
    help='create GEOJson files of poly geometry'
)

if __name__ == '__main__':
    # parse the args, and call default function
    args = parser.parse_args()
    proj_settings = POSMSettings(args.settings)

    settings = proj_settings.get_settings()
    admin_levels = proj_settings.get_admin_levels()

    logging.config.dictConfig(settings.get('logging'))

    main(
        settings=settings, directory=args.output_dir,
        bufferDistance=args.buffer, simplifyDistance=args.simplify,
        geojson=args.geojson
    )