maps4fs 1.2.7__py3-none-any.whl → 1.2.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -412,7 +412,7 @@ class Texture(Component):
412
412
 
413
413
  mask = cv2.bitwise_not(cumulative_image)
414
414
 
415
- for polygon in self.polygons(layer.tags, layer.width): # type: ignore
415
+ for polygon in self.polygons(layer.tags, layer.width, layer.info_layer): # type: ignore
416
416
  if layer.info_layer:
417
417
  info_layer_data[layer.info_layer].append(self.np_to_polygon_points(polygon))
418
418
  cv2.fillPoly(layer_image, [polygon], color=255) # type: ignore
@@ -621,18 +621,22 @@ class Texture(Component):
621
621
  return converters.get(geom_type) # type: ignore
622
622
 
623
623
  def polygons(
624
- self, tags: dict[str, str | list[str] | bool], width: int | None
624
+ self,
625
+ tags: dict[str, str | list[str] | bool],
626
+ width: int | None,
627
+ info_layer: str | None = None,
625
628
  ) -> Generator[np.ndarray, None, None]:
626
629
  """Generator which yields numpy arrays of polygons from OSM data.
627
630
 
628
631
  Arguments:
629
632
  tags (dict[str, str | list[str]]): Dictionary of tags to search for.
630
633
  width (int | None): Width of the polygon in meters (only for LineString).
634
+ info_layer (str | None): Name of the corresponding info layer.
631
635
 
632
636
  Yields:
633
637
  Generator[np.ndarray, None, None]: Numpy array of polygon points.
634
638
  """
635
- is_fieds = "farmland" in tags.values()
639
+ is_fieds = info_layer == "fields"
636
640
  try:
637
641
  objects = ox.features_from_bbox(bbox=self.new_bbox, tags=tags)
638
642
  except Exception as e: # pylint: disable=W0718
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maps4fs
3
- Version: 1.2.7
3
+ Version: 1.2.9
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: MIT License
@@ -10,12 +10,12 @@ maps4fs/generator/grle.py,sha256=3hcr5e2YLXemFi-_x2cLHWbMVb06591k0PZxaBVovH8,176
10
10
  maps4fs/generator/i3d.py,sha256=oK5pKjzvT-gydma5Q6CcDYTVODGxK7MIGajLrAV9JkU,18370
11
11
  maps4fs/generator/map.py,sha256=lA1MNAcMwsDtsYxbwwm7DjwP3zraHKnri_xnLUu30j0,5326
12
12
  maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
13
- maps4fs/generator/texture.py,sha256=vgiwJNIl14JABhNOBGh_W8SBkAUNQN3TjNJayR76va0,27468
13
+ maps4fs/generator/texture.py,sha256=lde8BiI0ANuwvG1zupUjm-ESoyf_KSqwYjVT993nj8g,27612
14
14
  maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
15
15
  maps4fs/toolbox/background.py,sha256=9BXWNqs_n3HgqDiPztWylgYk_QM4YgBpe6_ZNQAWtSc,2154
16
16
  maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
17
- maps4fs-1.2.7.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
18
- maps4fs-1.2.7.dist-info/METADATA,sha256=okYdp3VzT4qCDn6cS50DdBoQ0TwLtSeCTXtVFnFTY7I,30600
19
- maps4fs-1.2.7.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
20
- maps4fs-1.2.7.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
21
- maps4fs-1.2.7.dist-info/RECORD,,
17
+ maps4fs-1.2.9.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
18
+ maps4fs-1.2.9.dist-info/METADATA,sha256=funMW5_2yaZ2dk64_6PatXFWZmSD7eMybdv7hcD63U0,30600
19
+ maps4fs-1.2.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
20
+ maps4fs-1.2.9.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
21
+ maps4fs-1.2.9.dist-info/RECORD,,