maps4fs 2.2.0__py3-none-any.whl → 2.2.2__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.
@@ -597,6 +597,7 @@ class Background(MeshComponent, ImageComponent):
597
597
  polygon_points=polygon.exterior.coords,
598
598
  angle=self.rotation,
599
599
  canvas_size=self.background_size,
600
+ xshift=-Parameters.BACKGROUND_DISTANCE,
600
601
  )
601
602
  fitted_polygon = shapely.Polygon(fitted_polygon_points)
602
603
  fitted_polygons.append(fitted_polygon)
@@ -365,6 +365,8 @@ class Component:
365
365
  angle: int = 0,
366
366
  border: int = 0,
367
367
  canvas_size: int | None = None,
368
+ xshift: int = 0,
369
+ yshift: int = 0,
368
370
  ) -> list[tuple[int, int]]:
369
371
  """Fits a polygon into the bounds of the map.
370
372
 
@@ -374,6 +376,9 @@ class Component:
374
376
  margin (int, optional): The margin to add to the polygon. Defaults to 0.
375
377
  angle (int, optional): The angle to rotate the polygon by. Defaults to 0.
376
378
  border (int, optional): The border to add to the bounds. Defaults to 0.
379
+ canvas_size (int, optional): The size of the canvas. Defaults to None.
380
+ xshift (int, optional): The x-axis shift to apply. Will be added to calculated offset.
381
+ yshift (int, optional): The y-axis shift to apply. Will be added to calculated offset.
377
382
 
378
383
  Returns:
379
384
  list[tuple[int, int]]: The points of the polygon fitted into the map bounds.
@@ -400,8 +405,11 @@ class Component:
400
405
  )
401
406
  osm_object = rotate(osm_object, -angle, origin=(center_x, center_y))
402
407
  offset = int((self.map_size / 2) - (self.map_rotated_size / 2)) * self.map.size_scale
403
- self.logger.debug("Translating the osm_object by %s", offset)
404
- osm_object = translate(osm_object, xoff=offset, yoff=offset)
408
+ xoff = yoff = offset
409
+ xoff += xshift
410
+ yoff += yshift
411
+ self.logger.debug("Translating the osm_object by X: %s, Y: %s", xoff, yoff)
412
+ osm_object = translate(osm_object, xoff=xoff, yoff=yoff)
405
413
  self.logger.debug("Rotated and translated the osm_object.")
406
414
 
407
415
  if margin and object_type is Polygon:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maps4fs
3
- Version: 2.2.0
3
+ Version: 2.2.2
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
@@ -45,7 +45,7 @@ Dynamic: license-file
45
45
 
46
46
  <div align="center" markdown>
47
47
  <a href="https://discord.gg/Sj5QKKyE42">
48
- <img src="https://github.com/user-attachments/assets/37043333-d6ef-4ca3-9f3c-81323d9d0b71">
48
+ <img src="https://github.com/iwatkot/maps4fs/releases/download/2.2.0/maps4fs-poster-discord-mymaps.png">
49
49
  </a>
50
50
 
51
51
  <p align="center">
@@ -54,6 +54,7 @@ Dynamic: license-file
54
54
  <a href="docs/step_by_step.md">Create a map in 10 steps</a> •
55
55
  <a href="docs/recommendations.md">Practical recommendations</a> •
56
56
  <a href="#How-To-Run">How-To-Run</a><br>
57
+ <a href="docs/my_maps.md">My Maps</a> •
57
58
  <a href="docs/FAQ.md">FAQ</a> •
58
59
  <a href="docs/map_structure.md">Map Structure</a> •
59
60
  <a href="#Schemas-Editor">Schemas Editor</a> •
@@ -85,8 +86,10 @@ Dynamic: license-file
85
86
 
86
87
  </div>
87
88
 
89
+ 🔥🔥🔥🗂️ Track, store and organize all your maps using the [My Maps](docs/my_maps.md) feature. 🔥🔥🔥<br>
90
+ <br>
88
91
  🗺️ Supports 2x2, 4x4, 8x8, 16x16 and any custom size maps<br>
89
- 🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi) 🆕<br>
92
+ 🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi)<br>
90
93
  ✂️ Supports map scaling<br>
91
94
  🔄 Support map rotation<br>
92
95
  🌐 Supports custom [DTM Providers](https://github.com/iwatkot/pydtmdl)<br>
@@ -158,6 +161,14 @@ There are several ways to use the tool. You obviously need the **first one**, bu
158
161
  docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs iwatkot/maps4fs
159
162
  ```
160
163
 
164
+ If you want to persist your data, you can mount a directory to the container:
165
+
166
+ ```bash
167
+ docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs -v /c/maps4fs:/usr/src/app/mfsrootdir iwatkot/maps4fs
168
+ ```
169
+
170
+ Learn more in the [My Maps](docs/my_maps.md) documentation.
171
+
161
172
  And open [http://localhost:8501](http://localhost:8501) in your browser.<br>
162
173
  If you don't know how to use Docker, navigate to the [Docker version](#option-2-docker-version), it's really simple.<br>
163
174
  Check out the [Docker FAQ](docs/FAQ_docker.md) if you have any questions.<br>
@@ -212,8 +223,8 @@ Don't know where to start? Don't worry, just follow this [step-by-step guide](do
212
223
  🛠️ Don't need to install anything.
213
224
  🗺️ Supported map sizes: 2x2, 4x4.
214
225
  ✂️ Map scaling: not supported.
215
- ⚙️ Advanced settings: enabled.
216
- 🖼️ Texture dissolving: enabled.
226
+ ⚙️ Advanced settings: partial.
227
+ 🖼️ Texture dissolving: disabled.
217
228
  Using the public version on [maps4fs.xyz](https://maps4fs.xyz) is the easiest way to generate a map template. Just open the link and follow the instructions.
218
229
  Note: due to CPU and RAM limitations of the hosting, the generation may take some time. If you need faster processing, use the [Docker version](#option-2-docker-version).<br>
219
230
 
@@ -240,6 +251,12 @@ You can launch the project with minimalistic UI in your browser using Docker. Fo
240
251
  docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs iwatkot/maps4fs
241
252
  ```
242
253
 
254
+ If you want to persist your data, you can mount a directory to the container:
255
+
256
+ ```bash
257
+ docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs -v /c/maps4fs:/usr/src/app/mfsrootdir iwatkot/maps4fs
258
+ ```
259
+
243
260
  3. Open your browser and go to [http://localhost:8501](http://localhost:8501).
244
261
  4. Fill in the required fields and click on the `Generate` button.
245
262
  5. When the map is generated click on the `Download` button to get the map.
@@ -8,7 +8,7 @@ maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,611
8
8
  maps4fs/generator/settings.py,sha256=NukAt1s4CS0HEWmUcBPc8OiqkWqjts3AvvkX0APZKes,11385
9
9
  maps4fs/generator/statistics.py,sha256=aynS3zbAtiwnU_YLKHPTiiaKW98_suvQUhy1SGBA6mc,2448
10
10
  maps4fs/generator/component/__init__.py,sha256=s01yVVVi8R2xxNvflu2D6wTd9I_g73AMM2x7vAC7GX4,490
11
- maps4fs/generator/component/background.py,sha256=JANbVgcBXpaQ0HB1eeV16KkFgpU-Txj5kB5eJNEDAv0,34473
11
+ maps4fs/generator/component/background.py,sha256=-GNA6zdQmfu7Oi4Cny0uhxlgl39VbvhEGhl4wKdh0ew,34533
12
12
  maps4fs/generator/component/config.py,sha256=uL76h9UwyhZKZmbxz0mBmWtEPN6qYay4epTEqqtej60,8601
13
13
  maps4fs/generator/component/dem.py,sha256=mtsdTIcEHmR9mW1LMcCaX4F2OCch9BM_WXHkvJby9ZY,11930
14
14
  maps4fs/generator/component/grle.py,sha256=3BKGlR0q0t0NvmqeT81WieS6MIc_UlMQjIDDZiqTiws,27243
@@ -17,12 +17,12 @@ maps4fs/generator/component/layer.py,sha256=U_DzJTn1m_yGOtwuvbXxr7oL7YHHBGBcK37l
17
17
  maps4fs/generator/component/satellite.py,sha256=9nKwL8zQ-BB6WFMx2m8zduFn6RaxSNv6Vtpge1-QMYE,5052
18
18
  maps4fs/generator/component/texture.py,sha256=Ngvfe51grb6Ead6WvNjx1Zr0yz65y8y2vY8xUteLoNo,35019
19
19
  maps4fs/generator/component/base/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
20
- maps4fs/generator/component/base/component.py,sha256=AP7b6rmYV_HdyyHlCTo9s6fyBXyyqGyBv-DYVynBGws,22884
20
+ maps4fs/generator/component/base/component.py,sha256=lf0V9CLUXMg88Nm2yI3rP5taVYYlNivud0x6kbhBYqA,23312
21
21
  maps4fs/generator/component/base/component_image.py,sha256=WTGC6v1KuS5sLNCC95Z48nCspvATKKNOuhTNYzTWXr4,8315
22
22
  maps4fs/generator/component/base/component_mesh.py,sha256=3hC-qDT8Vde6SmRMqs9USAkrF-gL2dDTYW71ATpxUS4,9130
23
23
  maps4fs/generator/component/base/component_xml.py,sha256=MT-VhU2dEckLFxAgmxg6V3gnv11di_94Qq6atfpOLdc,5342
24
- maps4fs-2.2.0.dist-info/licenses/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
25
- maps4fs-2.2.0.dist-info/METADATA,sha256=kqnmOq-uxIG07x5Bjypf-gkU0eiyN1AWvVtysxm6tYw,45431
26
- maps4fs-2.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
- maps4fs-2.2.0.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
28
- maps4fs-2.2.0.dist-info/RECORD,,
24
+ maps4fs-2.2.2.dist-info/licenses/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
25
+ maps4fs-2.2.2.dist-info/METADATA,sha256=m6Ilrs7QCxuaGxLXvcLUVOjQLeZsTBTcpV-e14ihpW0,46076
26
+ maps4fs-2.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
27
+ maps4fs-2.2.2.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
28
+ maps4fs-2.2.2.dist-info/RECORD,,