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.

This commit is contained in:
Marcus Str. 2024-10-05 22:47:04 +02:00
parent 3b7abe6017
commit f0820fb175
3 changed files with 16 additions and 7 deletions

View File

@ -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")
]

View File

@ -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" )

View File

@ -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))