maps4fs 1.9.52__py3-none-any.whl → 1.9.54__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.
@@ -119,6 +119,12 @@ class I3d(XMLComponent):
119
119
  tree = self.get_tree(splines_i3d_path)
120
120
 
121
121
  roads_polylines = self.get_infolayer_data(Parameters.TEXTURES, Parameters.ROADS_POLYLINES)
122
+
123
+ if self.map.spline_settings.field_splines:
124
+ fields_polygons = self.get_infolayer_data(Parameters.TEXTURES, Parameters.FIELDS)
125
+ if isinstance(roads_polylines, list) and isinstance(fields_polygons, list):
126
+ roads_polylines.extend(fields_polygons)
127
+
122
128
  if not roads_polylines:
123
129
  self.logger.warning("Roads polylines data not found in textures info layer.")
124
130
  return
@@ -152,8 +158,14 @@ class I3d(XMLComponent):
152
158
 
153
159
  node_id = SPLINES_NODE_ID_STARTING_VALUE
154
160
  for road_id, road_info in enumerate(roads_polylines, start=1):
155
- points = road_info.get("points")
156
- tags = road_info.get("tags")
161
+ if isinstance(road_info, dict):
162
+ points = road_info.get("points")
163
+ tags = road_info.get("tags")
164
+ is_field = False
165
+ else:
166
+ points = road_info
167
+ tags = "field"
168
+ is_field = True
157
169
 
158
170
  try:
159
171
  fitted_road = self.fit_object_into_bounds(
@@ -208,15 +220,16 @@ class I3d(XMLComponent):
208
220
 
209
221
  shapes_node.append(nurbs_curve_node)
210
222
 
211
- user_attribute_node = self.get_user_attribute_node(
212
- node_id,
213
- attributes=[
214
- ("maxSpeedScale", "integer", "1"),
215
- ("speedLimit", "integer", "100"),
216
- ],
217
- )
223
+ if not is_field:
224
+ user_attribute_node = self.get_user_attribute_node(
225
+ node_id,
226
+ attributes=[
227
+ ("maxSpeedScale", "integer", "1"),
228
+ ("speedLimit", "integer", "100"),
229
+ ],
230
+ )
218
231
 
219
- user_attributes_node.append(user_attribute_node)
232
+ user_attributes_node.append(user_attribute_node)
220
233
  node_id += 1
221
234
 
222
235
  tree.write(splines_i3d_path) # type: ignore
maps4fs/generator/map.py CHANGED
@@ -92,6 +92,7 @@ class Map:
92
92
  "dtm_provider": dtm_provider.name(),
93
93
  "custom_osm": bool(custom_osm),
94
94
  "is_public": kwargs.get("is_public", False),
95
+ "api_request": kwargs.get("api_request", False),
95
96
  }
96
97
  send_main_settings(main_settings)
97
98
  except Exception as e:
@@ -227,6 +227,7 @@ class SplineSettings(SettingsModel):
227
227
 
228
228
  spline_density: int = 2
229
229
  add_reversed_splines: bool = False
230
+ field_splines: bool = False
230
231
 
231
232
 
232
233
  class SatelliteSettings(SettingsModel):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maps4fs
3
- Version: 1.9.52
3
+ Version: 1.9.54
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: Apache License 2.0
@@ -2,16 +2,16 @@ maps4fs/__init__.py,sha256=EGvLVoRpSt4jITswsGbe1ISVmGAZAMQJcBmTwtyuVxI,335
2
2
  maps4fs/logger.py,sha256=WDfR14hxqy8b6xtwL6YIu2LGzFO1sbt0LxMgfsDTOkA,865
3
3
  maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
4
4
  maps4fs/generator/game.py,sha256=g8lMHuuRRmJLSDsQTAMv8p_-qntYMiZKnAqn7ru96i0,11645
5
- maps4fs/generator/map.py,sha256=7-nx27M-VwTocPor8BCkkpthYBJYe_B-pe5_Dcsijaw,13899
5
+ maps4fs/generator/map.py,sha256=3q9S4tYWeRaYO_ENLD_80towAEnIVn11_9mXNsqN6eg,13964
6
6
  maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
7
- maps4fs/generator/settings.py,sha256=E_M47X2QhbBqgiNraBDQd62lAQlNWHYLq30HQ59_4k4,7490
7
+ maps4fs/generator/settings.py,sha256=e_wAJy69QoEmYgXOsoNc1Hp115FNcLQBzrrv-o8Pzd8,7522
8
8
  maps4fs/generator/statistics.py,sha256=aynS3zbAtiwnU_YLKHPTiiaKW98_suvQUhy1SGBA6mc,2448
9
9
  maps4fs/generator/component/__init__.py,sha256=s01yVVVi8R2xxNvflu2D6wTd9I_g73AMM2x7vAC7GX4,490
10
10
  maps4fs/generator/component/background.py,sha256=AfbgNUai3tvpMe8lYmfiaM1n51ssunECy4gRglihumU,24032
11
11
  maps4fs/generator/component/config.py,sha256=IP530sapLofFskSnBEB96G0aUSd6Sno0G9ET3ca0ZOQ,3696
12
12
  maps4fs/generator/component/dem.py,sha256=Bvm3ViA6PpR7RXRAHBj5rgYB9PWy55Qj6PhTMv6dJRI,11953
13
13
  maps4fs/generator/component/grle.py,sha256=ao3-4B4QUVl0XgOmYAj9L48KGaZtCZRTB1BqYgdAJIc,19613
14
- maps4fs/generator/component/i3d.py,sha256=xTiZYQRahYBsVALxmnsBygzTHJLE54ucXvHK8LWCYAs,23914
14
+ maps4fs/generator/component/i3d.py,sha256=1NlcK-7TmnF6zYa-Gi6whAwK2z6HPmWert7MLbzJiqI,24471
15
15
  maps4fs/generator/component/layer.py,sha256=-br4gAGcGeBNb3ldch9XFEK0lhXqb1IbArhFB5Owu54,6186
16
16
  maps4fs/generator/component/satellite.py,sha256=47V9aPbv7k-2C-PsoXd33EO92yavFzB6_MRCd7fLP6k,5042
17
17
  maps4fs/generator/component/texture.py,sha256=Nc_oOHX3b4vJm8FnNOn3W4EQGFkW0zW0rGzO_0nTJMM,33392
@@ -54,8 +54,8 @@ maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,4
54
54
  maps4fs/toolbox/background.py,sha256=RB0pHuRyfnDuqYtO2gUypfPm4G5cYRFdT2W-DG49zy0,2427
55
55
  maps4fs/toolbox/custom_osm.py,sha256=fjVSl9Ztc8_q0DxgNkhM7tE0Y-XpX8xcGGW-Tunp0R8,2518
56
56
  maps4fs/toolbox/dem.py,sha256=mbn3ZqMRhhYmzgssm2CGvg6aa89MUBOJPq6QyE54OLY,4191
57
- maps4fs-1.9.52.dist-info/licenses/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
58
- maps4fs-1.9.52.dist-info/METADATA,sha256=7LZ_NrNnL3aTXeS1AGEMhOx_pISOVGMihcJpUc4bFcI,49397
59
- maps4fs-1.9.52.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
60
- maps4fs-1.9.52.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
61
- maps4fs-1.9.52.dist-info/RECORD,,
57
+ maps4fs-1.9.54.dist-info/licenses/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
58
+ maps4fs-1.9.54.dist-info/METADATA,sha256=GjTIUeYYs-VHnduS-CmoBq8jYPvysEREcVZ-r3feHvs,49397
59
+ maps4fs-1.9.54.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
60
+ maps4fs-1.9.54.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
61
+ maps4fs-1.9.54.dist-info/RECORD,,