From: Marcus Str. Date: Sat, 5 Oct 2024 20:47:04 +0000 (+0200) Subject: Needed to modify layergen so merge residential areas into the layer, as otherwise... X-Git-Url: https://marstr.online/code/gitweb.cgi?a=commitdiff_plain;h=f0820fb17554c6f4d143bb5f8bb7b511bb27e1ba;p=orthographic Needed to modify layergen so merge residential areas into the layer, as otherwise this conflict of layering was not solvable. Adjustment to buildings in photogen to give buildings a slight outline. --- diff --git a/defines.py b/defines.py index ae60ea6..d8cb0ca 100644 --- a/defines.py +++ b/defines.py @@ -119,8 +119,12 @@ mstr_zl_19 = 0.008 # most likely crash. mstr_ortho_layers = [ # Z-Order 0 - ("boundary", "administrative", "admin_level", ["8", "9", "10", "12"], "landuse", "residential-boundary"), + #("boundary", "administrative", "admin_level", ["8", "9", "10", "12"], "landuse", "residential-boundary"), # Z-Order 1 + ("landuse", "residential", "landuse", "residential-boundary"), + ("landuse", "grass", "landuse", "grass"), + ("landuse", "cemetery", "landuse", "grass"), + ("landuse", "greenfield", "landuse", "grass"), ("landuse", "orchard", "landuse", "meadow"), ("landuse", "meadow", "landuse", "meadow"), ("natural", "grassland", "landuse", "meadow"), @@ -197,11 +201,7 @@ mstr_ortho_layers = [ ("building", "commercial", "building", "commercial"), ("building", "yes", "building", "common"), ("place", "sea", "natural", "sea"), - ("place", "ocean", "natural", "sea"), - ("landuse", "residential", "landuse", "residential-boundary"), - ("landuse", "grass", "landuse", "grass"), - ("landuse", "cemetery", "landuse", "grass"), - ("landuse", "greenfield", "landuse", "grass") + ("place", "ocean", "natural", "sea") ] diff --git a/layergen.py b/layergen.py index d541df3..fbf4b78 100644 --- a/layergen.py +++ b/layergen.py @@ -522,6 +522,15 @@ class mstr_layergen: nw = (200-d,200-d,200-d,255) layer_comp_pix[x,y] = nw + # I need to put this special sub-call here to solve an otherwise unsolvable + # conflict with layer order + if self._tag == "landuse" and self._value == "forest": + # The residential layer MUST exist before we reach the forest part. + fn = mstr_datafolder + "_cache/" + str(self._latitude) + "-" + str(self._lat_number) + "_" + str(self._longitude) + "-" + str(self._lng_number) + "_landuse-residential_layer.png" + if os.path.isfile(fn) == True: + rsd = Image.open(fn) + layer_comp.alpha_composite(rsd) + # Store layer if self._is_completion == False: layer_comp.save( mstr_datafolder + "_cache/" + str(self._latitude) + "-" + str(self._lat_number) + "_" + str(self._longitude) + "-" + str(self._lng_number) + "_" + self._tag + "-" + self._value + "_layer.png" ) diff --git a/photogen.py b/photogen.py index 825fd76..9530715 100644 --- a/photogen.py +++ b/photogen.py @@ -67,7 +67,7 @@ class mstr_photogen: if l[0] == "building": if os.path.isfile(root_filename + l[0] + "-" + l[1] + "_layer.png"): bld = Image.open(root_filename + l[0] + "-" + l[1] + "_layer.png") - bld = bld.filter(ImageFilter.GaussianBlur(radius=0.35)) + bld = bld.filter(ImageFilter.GaussianBlur(radius=1)) bldg_main.alpha_composite(bld) # Merge the building layers bldg_final = Image.new("RGBA", (self._imgsize, self._imgsize))