Commit c313ccd8 authored by Rick Gruber-Riemer's avatar Rick Gruber-Riemer

Changed parameter PATH_TO_SCENERY_OPT to take a list of paths instead of just one.

parent afd6b740
......@@ -54,7 +54,8 @@ PATH_TO_SCENERY Path n/a Full path t
probe elevation and check for overlap with static objects. Most likely you'll
want to use your TerraSync path here.
PATH_TO_SCENERY_OPT Path None Optional additional path to a scenery folder (e.g. for `Project3000`_).
PATH_TO_SCENERY_OPT List None Optional additional paths to scenery folders (e.g. for `Project3000`_).
Specified as a list of strings (e.g. ['/foo/uno', '/foo/due'].
Only used for overlap checking for buildings against static and shared
objects.
......
......@@ -50,9 +50,9 @@ OSM_FILE = "buildings.osm" # -- file name of file with OSM data. Should reside
# likely you'll want to use your TerraSync path here.
PATH_TO_SCENERY = "/home/user/fgfs/scenery/TerraSync"
# Optional additional path to a scenery folder (e.g. project3000).
# Optional additional list of paths to scenery folders (e.g. project3000).
# Only used for overlap checking for buildings against static and shared objects
PATH_TO_SCENERY_OPT = None
PATH_TO_SCENERY_OPT = None # if not none, then needs to be list of strings
# -- The generated scenery (.stg, .ac, .xml) will be written to this path.
# If empty, we'll use the correct location in PATH_TO_SCENERY. Note that
......@@ -356,6 +356,15 @@ def read_from_file(filename):
else:
logging.warning('Unknown parameter: %s=%s' % (k, v))
# correct use of parameter PATH_TO_SCENERY_OPT: earlier only string, now list of strings (or None)
global PATH_TO_SCENERY_OPT
if PATH_TO_SCENERY_OPT:
if isinstance(PATH_TO_SCENERY_OPT, str):
if PATH_TO_SCENERY_OPT == "":
PATH_TO_SCENERY_OPT = None
else:
PATH_TO_SCENERY_OPT = [PATH_TO_SCENERY_OPT]
def show_default():
"""show default parameters by printing all params defined above between
......
......@@ -317,11 +317,12 @@ def read_stg_entries_in_boundary(consider_shared: bool=True, my_coord_transform:
parameters.BOUNDARY_EAST, parameters.BOUNDARY_NORTH,
parameters.PATH_TO_SCENERY, "Objects")
if parameters.PATH_TO_SCENERY_OPT is not None:
stg_files_opt = calc_tile.get_stg_files_in_boundary(parameters.BOUNDARY_WEST, parameters.BOUNDARY_SOUTH,
parameters.BOUNDARY_EAST, parameters.BOUNDARY_NORTH,
parameters.PATH_TO_SCENERY_OPT, "Objects")
stg_files.extend(stg_files_opt)
if parameters.PATH_TO_SCENERY_OPT:
for my_path in parameters.PATH_TO_SCENERY_OPT:
stg_files_opt = calc_tile.get_stg_files_in_boundary(parameters.BOUNDARY_WEST, parameters.BOUNDARY_SOUTH,
parameters.BOUNDARY_EAST, parameters.BOUNDARY_NORTH,
my_path, "Objects")
stg_files.extend(stg_files_opt)
for filename in stg_files:
stg_entries.extend(read_stg_entries(filename, consider_shared))
......
Markdown is supported
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