Commit 57d8730a authored by Eric Duminil's avatar Eric Duminil
Browse files

Allow many parameters, via input file

parent 3449fcf2
No related merge requests found
Showing with 17 additions and 4 deletions
+17 -4
......@@ -129,14 +129,27 @@ def extract_region(output_dir: Path, location_name: str, wkt: str) -> None:
if len(gml_inputs) == 0:
print("Error: No CityGML found. At least part of the region should be in Baden-Württemberg!")
return
params_path = output_dir / 'params.txt'
wkt_path = output_dir / 'region.wkt'
print(f" Extracting {output_file}.")
with open(wkt_path, 'w') as f:
f.write(wkt)
with open(params_path, 'w') as f:
f.write("--input\n")
f.write(','.join(f"{gml}" for gml in gml_inputs))
f.write("\n")
f.write("--output\n")
f.write(f'"{output_file}"\n')
f.write("--wkt\n")
f.write(f'"{wkt_path}"\n')
result = subprocess.run(['java', '-classpath', f'{region_chooser_libs}',
'eu.simstadt.regionchooser.RegionChooserCLI',
'--input', ','.join(str(gml) for gml in gml_inputs),
'--output', str(output_file),
'--wkt', '-',
f'@{params_path}'
],
input=wkt,
text=True,
capture_output=True,
check=True
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment