Commit 5ebff00b authored by Rick Gruber-Riemer's avatar Rick Gruber-Riemer

New parameter to control writing cluster stats.

Make sure when there is nothing to write that copy data stuff does not abort.
parent 07b9eca1
......@@ -116,10 +116,11 @@ class ClusterContainer(object):
return the_cluster
def write_statistics(self, clusters_name: str) -> None:
my_file = open(parameters.PREFIX + os.sep + clusters_name + ".dat", "w")
for j in range(self.max_grid.iy):
for i in range(self.max_grid.ix):
cl = self._clusters[i][j]
my_file.write("%i %i %i\n" % (i, j, len(cl.objects)))
my_file.write("\n")
my_file.close()
if parameters.log_level_debug_or_lower() and parameters.WRITE_CLUSTER_STATS:
my_file = open(parameters.PREFIX + os.sep + clusters_name + ".dat", "w")
for j in range(self.max_grid.iy):
for i in range(self.max_grid.ix):
cl = self._clusters[i][j]
my_file.write("%i %i %i\n" % (i, j, len(cl.objects)))
my_file.write("\n")
my_file.close()
......@@ -29,8 +29,7 @@ def process(copy_fg_data: bool, scenery_type: str) -> None:
level_two_dirs.append(sub_dir_path + os.sep + level_two_dir)
if len(level_two_dirs) == 0:
logging.error("The scenery path does not seem to have necessary sub-directories in %s", scenery_path)
sys.exit(1)
logging.info("ERROR: The scenery path does not seem to have necessary sub-directories in %s", scenery_path)
else:
data_dir = util.assert_trailing_slash(parameters.PATH_TO_OSM2CITY_DATA)
# textures
......
......@@ -80,6 +80,8 @@ USE_NEW_STG_VERBS = False
USE_EXTERNAL_MODELS = False
WRITE_CLUSTER_STATS = False
# =============================================================================
# PARAMETERS RELATED TO BUILDINGS IN osm2city
# =============================================================================
......
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