| 30 | |
| 31 | |
| 32 | def parse_args(): |
| 33 | parser = argparse.ArgumentParser( |
| 34 | description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter |
| 35 | ) |
| 36 | |
| 37 | parser.add_argument( |
| 38 | "--input", |
| 39 | "-i", |
| 40 | type=argparse.FileType("r"), |
| 41 | default=sys.stdin, |
| 42 | help="The WKT/WKB input to parse. Defaults to stdin.", |
| 43 | ) |
| 44 | parser.add_argument( |
| 45 | "--output", |
| 46 | "-o", |
| 47 | type=argparse.FileType("w"), |
| 48 | default=sys.stdout, |
| 49 | help="Where to output the SVG. Defaults to stdout.", |
| 50 | ) |
| 51 | parser.add_argument( |
| 52 | "--input-format", |
| 53 | "-I", |
| 54 | default="wkt", |
| 55 | choices=["wkt", "wkb", "flat"], |
| 56 | help="The input format. Defaults to WKT.", |
| 57 | ) |
| 58 | parser.add_argument( |
| 59 | "-l", |
| 60 | "--log-level", |
| 61 | type=str, |
| 62 | default=DEFAULT_LEVEL, |
| 63 | choices=LOG_LEVELS.keys(), |
| 64 | help=f"Set the logging output level. Defaults to {DEFAULT_LEVEL}.", |
| 65 | ) |
| 66 | |
| 67 | return parser.parse_args() |
| 68 | |
| 69 | |
| 70 | def insert_point( |