]> marstr Code Repo - orthographic/commitdiff
Needed to modify layergen so merge residential areas into the layer, as otherwise...
authorMarcus Str. <marcus@marstr.online>
Sat, 5 Oct 2024 20:47:04 +0000 (22:47 +0200)
committerMarcus Str. <marcus@marstr.online>
Sat, 5 Oct 2024 20:47:04 +0000 (22:47 +0200)
defines.py
layergen.py
photogen.py

index ae60ea6d57a5cbfe984258a9c7dc744afc9db2d1..d8cb0cad4ed3d7afeda7773e2729fd0352023fc4 100644 (file)
@@ -119,8 +119,12 @@ mstr_zl_19 = 0.008
 # most likely crash.\r
 mstr_ortho_layers = [\r
     # Z-Order 0\r
-    ("boundary", "administrative", "admin_level", ["8", "9", "10", "12"], "landuse", "residential-boundary"),\r
+    #("boundary", "administrative", "admin_level", ["8", "9", "10", "12"], "landuse", "residential-boundary"),\r
     # Z-Order 1\r
+    ("landuse", "residential", "landuse", "residential-boundary"),\r
+    ("landuse", "grass", "landuse", "grass"),\r
+    ("landuse", "cemetery", "landuse", "grass"),\r
+    ("landuse", "greenfield", "landuse", "grass"),\r
     ("landuse", "orchard", "landuse", "meadow"),\r
     ("landuse", "meadow", "landuse", "meadow"),\r
     ("natural", "grassland", "landuse", "meadow"),\r
@@ -197,11 +201,7 @@ mstr_ortho_layers = [
        ("building", "commercial", "building", "commercial"),\r
     ("building", "yes", "building", "common"),\r
     ("place", "sea", "natural", "sea"),\r
-    ("place", "ocean", "natural", "sea"),\r
-    ("landuse", "residential", "landuse", "residential-boundary"),\r
-    ("landuse", "grass", "landuse", "grass"),\r
-    ("landuse", "cemetery", "landuse", "grass"),\r
-    ("landuse", "greenfield", "landuse", "grass")\r
+    ("place", "ocean", "natural", "sea")\r
 ]\r
 \r
 \r
index d541df3ac56797cde88e775f5f8f18fcd728931b..fbf4b7891b8b1aed365c429e10721a43772909fe 100644 (file)
@@ -522,6 +522,15 @@ class mstr_layergen:
                             nw = (200-d,200-d,200-d,255)\r
                             layer_comp_pix[x,y] = nw\r
 \r
+            # I need to put this special sub-call here to solve an otherwise unsolvable\r
+            # conflict with layer order\r
+            if self._tag == "landuse" and self._value == "forest":\r
+                # The residential layer MUST exist before we reach the forest part.\r
+                fn = mstr_datafolder + "_cache/" + str(self._latitude) + "-" + str(self._lat_number) + "_" + str(self._longitude) + "-" + str(self._lng_number) + "_landuse-residential_layer.png"\r
+                if os.path.isfile(fn) == True:\r
+                    rsd = Image.open(fn)\r
+                    layer_comp.alpha_composite(rsd)\r
+\r
             # Store layer\r
             if self._is_completion == False:\r
                 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" )\r
index 825fd76d83c9524903944d68aafe8ab446382998..95307152b1e554491503fb67b7fa9a39adaf903f 100644 (file)
@@ -67,7 +67,7 @@ class mstr_photogen:
             if l[0] == "building":\r
                 if os.path.isfile(root_filename + l[0] + "-" + l[1] + "_layer.png"):\r
                     bld = Image.open(root_filename + l[0] + "-" + l[1] + "_layer.png")\r
-                    bld = bld.filter(ImageFilter.GaussianBlur(radius=0.35))\r
+                    bld = bld.filter(ImageFilter.GaussianBlur(radius=1))\r
                     bldg_main.alpha_composite(bld)\r
         # Merge the building layers\r
         bldg_final = Image.new("RGBA", (self._imgsize, self._imgsize))\r