|
10 | 10 | @click.option('--timeout', default=25, help='Timeout in seconds.') |
11 | 11 | @click.option('--endpoint', default='http://overpass-api.de/api/interpreter', |
12 | 12 | help='URL of your prefered API.') |
13 | | -@click.option('--format', default='geojson', help="""Format to save the data. |
| 13 | +@click.option('--responseformat', default='geojson', help="""Format to save the data. |
14 | 14 | Options are 'geojson' and 'osm'. Default format is geojson.""") |
15 | 15 | @click.argument('query', type=str) |
16 | 16 | @click.argument('output_file', type=click.Path()) |
17 | | -def cli(timeout, endpoint, format, query, output_file): |
| 17 | +def cli(timeout, endpoint, responseformat, query, output_file): |
18 | 18 | """Run query and save the result in output_file""" |
19 | 19 |
|
20 | 20 | api = overpass.API(timeout=timeout, endpoint=endpoint) |
21 | 21 |
|
22 | | - if format not in api.SUPPORTED_FORMATS: |
| 22 | + if responseformat not in api.SUPPORTED_FORMATS: |
23 | 23 | print("format {} not supported. Supported formats: {}".format( |
24 | | - format, |
| 24 | + responseformat, |
25 | 25 | api.SUPPORTED_FORMATS.join(", "))) |
26 | | - result = api.Get(query, responseformat=format) |
| 26 | + result = api.Get(query, responseformat=responseformat) |
27 | 27 | with open(output_file, 'w') as f: |
28 | 28 | if responseformat=="geojson": |
29 | 29 | geojson.dump(result, f, indent=2, sort_keys=True) |
|
0 commit comments