maps4fs 2.1.9__tar.gz → 2.2.1__tar.gz
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.
- {maps4fs-2.1.9 → maps4fs-2.2.1}/PKG-INFO +21 -5
- {maps4fs-2.1.9 → maps4fs-2.2.1}/README.md +20 -4
- maps4fs-2.2.1/maps4fs/generator/config.py +93 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/game.py +32 -12
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/map.py +1 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/settings.py +2 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs.egg-info/PKG-INFO +21 -5
- {maps4fs-2.1.9 → maps4fs-2.2.1}/pyproject.toml +1 -1
- maps4fs-2.1.9/maps4fs/generator/config.py +0 -52
- {maps4fs-2.1.9 → maps4fs-2.2.1}/LICENSE.md +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/__init__.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/__init__.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/__init__.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/background.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/base/__init__.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/base/component.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/base/component_image.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/base/component_mesh.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/base/component_xml.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/config.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/dem.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/grle.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/i3d.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/layer.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/satellite.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/component/texture.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/qgis.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/generator/statistics.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs/logger.py +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs.egg-info/SOURCES.txt +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs.egg-info/dependency_links.txt +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs.egg-info/requires.txt +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/maps4fs.egg-info/top_level.txt +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/setup.cfg +0 -0
- {maps4fs-2.1.9 → maps4fs-2.2.1}/tests/test_generator.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: maps4fs
|
3
|
-
Version: 2.1
|
3
|
+
Version: 2.2.1
|
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/
|
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">
|
@@ -85,8 +85,10 @@ Dynamic: license-file
|
|
85
85
|
|
86
86
|
</div>
|
87
87
|
|
88
|
+
🔥🔥🔥🗂️ Track, store and organize all your maps using the [My Maps](docs/my_maps.md) feature. 🔥🔥🔥<br>
|
89
|
+
<br>
|
88
90
|
🗺️ Supports 2x2, 4x4, 8x8, 16x16 and any custom size maps<br>
|
89
|
-
🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi)
|
91
|
+
🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi)<br>
|
90
92
|
✂️ Supports map scaling<br>
|
91
93
|
🔄 Support map rotation<br>
|
92
94
|
🌐 Supports custom [DTM Providers](https://github.com/iwatkot/pydtmdl)<br>
|
@@ -158,6 +160,14 @@ There are several ways to use the tool. You obviously need the **first one**, bu
|
|
158
160
|
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs iwatkot/maps4fs
|
159
161
|
```
|
160
162
|
|
163
|
+
If you want to persist your data, you can mount a directory to the container:
|
164
|
+
|
165
|
+
```bash
|
166
|
+
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs -v /c/maps4fs:/usr/src/app/mfsrootdir iwatkot/maps4fs
|
167
|
+
```
|
168
|
+
|
169
|
+
Learn more in the [My Maps](docs/my_maps.md) documentation.
|
170
|
+
|
161
171
|
And open [http://localhost:8501](http://localhost:8501) in your browser.<br>
|
162
172
|
If you don't know how to use Docker, navigate to the [Docker version](#option-2-docker-version), it's really simple.<br>
|
163
173
|
Check out the [Docker FAQ](docs/FAQ_docker.md) if you have any questions.<br>
|
@@ -212,8 +222,8 @@ Don't know where to start? Don't worry, just follow this [step-by-step guide](do
|
|
212
222
|
🛠️ Don't need to install anything.
|
213
223
|
🗺️ Supported map sizes: 2x2, 4x4.
|
214
224
|
✂️ Map scaling: not supported.
|
215
|
-
⚙️ Advanced settings:
|
216
|
-
🖼️ Texture dissolving:
|
225
|
+
⚙️ Advanced settings: partial.
|
226
|
+
🖼️ Texture dissolving: disabled.
|
217
227
|
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
228
|
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
229
|
|
@@ -240,6 +250,12 @@ You can launch the project with minimalistic UI in your browser using Docker. Fo
|
|
240
250
|
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs iwatkot/maps4fs
|
241
251
|
```
|
242
252
|
|
253
|
+
If you want to persist your data, you can mount a directory to the container:
|
254
|
+
|
255
|
+
```bash
|
256
|
+
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs -v /c/maps4fs:/usr/src/app/mfsrootdir iwatkot/maps4fs
|
257
|
+
```
|
258
|
+
|
243
259
|
3. Open your browser and go to [http://localhost:8501](http://localhost:8501).
|
244
260
|
4. Fill in the required fields and click on the `Generate` button.
|
245
261
|
5. When the map is generated click on the `Download` button to get the map.
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
<div align="center" markdown>
|
16
16
|
<a href="https://discord.gg/Sj5QKKyE42">
|
17
|
-
<img src="https://github.com/
|
17
|
+
<img src="https://github.com/iwatkot/maps4fs/releases/download/2.2.0/maps4fs-poster-discord-mymaps.png">
|
18
18
|
</a>
|
19
19
|
|
20
20
|
<p align="center">
|
@@ -54,8 +54,10 @@
|
|
54
54
|
|
55
55
|
</div>
|
56
56
|
|
57
|
+
🔥🔥🔥🗂️ Track, store and organize all your maps using the [My Maps](docs/my_maps.md) feature. 🔥🔥🔥<br>
|
58
|
+
<br>
|
57
59
|
🗺️ Supports 2x2, 4x4, 8x8, 16x16 and any custom size maps<br>
|
58
|
-
🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi)
|
60
|
+
🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi)<br>
|
59
61
|
✂️ Supports map scaling<br>
|
60
62
|
🔄 Support map rotation<br>
|
61
63
|
🌐 Supports custom [DTM Providers](https://github.com/iwatkot/pydtmdl)<br>
|
@@ -127,6 +129,14 @@ There are several ways to use the tool. You obviously need the **first one**, bu
|
|
127
129
|
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs iwatkot/maps4fs
|
128
130
|
```
|
129
131
|
|
132
|
+
If you want to persist your data, you can mount a directory to the container:
|
133
|
+
|
134
|
+
```bash
|
135
|
+
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs -v /c/maps4fs:/usr/src/app/mfsrootdir iwatkot/maps4fs
|
136
|
+
```
|
137
|
+
|
138
|
+
Learn more in the [My Maps](docs/my_maps.md) documentation.
|
139
|
+
|
130
140
|
And open [http://localhost:8501](http://localhost:8501) in your browser.<br>
|
131
141
|
If you don't know how to use Docker, navigate to the [Docker version](#option-2-docker-version), it's really simple.<br>
|
132
142
|
Check out the [Docker FAQ](docs/FAQ_docker.md) if you have any questions.<br>
|
@@ -181,8 +191,8 @@ Don't know where to start? Don't worry, just follow this [step-by-step guide](do
|
|
181
191
|
🛠️ Don't need to install anything.
|
182
192
|
🗺️ Supported map sizes: 2x2, 4x4.
|
183
193
|
✂️ Map scaling: not supported.
|
184
|
-
⚙️ Advanced settings:
|
185
|
-
🖼️ Texture dissolving:
|
194
|
+
⚙️ Advanced settings: partial.
|
195
|
+
🖼️ Texture dissolving: disabled.
|
186
196
|
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.
|
187
197
|
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>
|
188
198
|
|
@@ -209,6 +219,12 @@ You can launch the project with minimalistic UI in your browser using Docker. Fo
|
|
209
219
|
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs iwatkot/maps4fs
|
210
220
|
```
|
211
221
|
|
222
|
+
If you want to persist your data, you can mount a directory to the container:
|
223
|
+
|
224
|
+
```bash
|
225
|
+
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs -v /c/maps4fs:/usr/src/app/mfsrootdir iwatkot/maps4fs
|
226
|
+
```
|
227
|
+
|
212
228
|
3. Open your browser and go to [http://localhost:8501](http://localhost:8501).
|
213
229
|
4. Fill in the required fields and click on the `Generate` button.
|
214
230
|
5. When the map is generated click on the `Download` button to get the map.
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"""This module contains configuration files for the maps4fs generator."""
|
2
|
+
|
3
|
+
import os
|
4
|
+
import shutil
|
5
|
+
import subprocess
|
6
|
+
|
7
|
+
from osmnx import settings as ox_settings
|
8
|
+
|
9
|
+
from maps4fs.logger import Logger
|
10
|
+
|
11
|
+
logger = Logger()
|
12
|
+
|
13
|
+
DEFAULT_TEMPLATES_DIR = os.path.join(os.getcwd(), "data")
|
14
|
+
MFS_TEMPLATES_DIR = os.getenv("MFS_TEMPLATES_DIRECTORY")
|
15
|
+
if MFS_TEMPLATES_DIR is None:
|
16
|
+
logger.info("MFS_TEMPLATES_DIRECTORY is not set. Using default templates directory.")
|
17
|
+
MFS_TEMPLATES_DIR = DEFAULT_TEMPLATES_DIR
|
18
|
+
else:
|
19
|
+
logger.info("MFS_TEMPLATES_DIRECTORY is set to: %s", MFS_TEMPLATES_DIR)
|
20
|
+
if not os.path.isdir(MFS_TEMPLATES_DIR):
|
21
|
+
logger.info("Templates directory %s does not exist. Creating it.", MFS_TEMPLATES_DIR)
|
22
|
+
os.makedirs(MFS_TEMPLATES_DIR, exist_ok=True)
|
23
|
+
|
24
|
+
# Check if there any files (directory is empty).
|
25
|
+
if not os.listdir(MFS_TEMPLATES_DIR):
|
26
|
+
logger.info("Templates directory %s is empty. Copying default files.", MFS_TEMPLATES_DIR)
|
27
|
+
for item in os.listdir(DEFAULT_TEMPLATES_DIR):
|
28
|
+
s = os.path.join(DEFAULT_TEMPLATES_DIR, item)
|
29
|
+
d = os.path.join(MFS_TEMPLATES_DIR, item)
|
30
|
+
if os.path.isdir(s):
|
31
|
+
shutil.copytree(s, d, False, None)
|
32
|
+
else:
|
33
|
+
shutil.copy2(s, d)
|
34
|
+
logger.info("Default files copied to %s.", MFS_TEMPLATES_DIR)
|
35
|
+
else:
|
36
|
+
logger.warning(
|
37
|
+
"Templates directory %s is not empty. Will not copy default files. "
|
38
|
+
"Ensure that the directory contains the necessary template files.",
|
39
|
+
MFS_TEMPLATES_DIR,
|
40
|
+
)
|
41
|
+
|
42
|
+
MFS_ROOT_DIR = os.getenv("MFS_ROOT_DIRECTORY", os.path.join(os.getcwd(), "mfsrootdir"))
|
43
|
+
MFS_CACHE_DIR = os.path.join(MFS_ROOT_DIR, "cache")
|
44
|
+
MFS_DATA_DIR = os.path.join(MFS_ROOT_DIR, "data")
|
45
|
+
os.makedirs(MFS_CACHE_DIR, exist_ok=True)
|
46
|
+
os.makedirs(MFS_DATA_DIR, exist_ok=True)
|
47
|
+
logger.info(
|
48
|
+
"MFS_ROOT_DIR: %s. MFS_CACHE_DIR: %s. MFS_DATA_DIR: %s.",
|
49
|
+
MFS_ROOT_DIR,
|
50
|
+
MFS_CACHE_DIR,
|
51
|
+
MFS_DATA_DIR,
|
52
|
+
)
|
53
|
+
|
54
|
+
DTM_CACHE_DIR = os.path.join(MFS_CACHE_DIR, "dtm")
|
55
|
+
SAT_CACHE_DIR = os.path.join(MFS_CACHE_DIR, "sat")
|
56
|
+
|
57
|
+
osmnx_cache = os.path.join(MFS_CACHE_DIR, "osmnx")
|
58
|
+
osmnx_data = os.path.join(MFS_CACHE_DIR, "odata")
|
59
|
+
os.makedirs(osmnx_cache, exist_ok=True)
|
60
|
+
os.makedirs(osmnx_data, exist_ok=True)
|
61
|
+
|
62
|
+
|
63
|
+
ox_settings.cache_folder = osmnx_cache
|
64
|
+
ox_settings.data_folder = osmnx_data
|
65
|
+
|
66
|
+
|
67
|
+
def get_package_version(package_name: str) -> str:
|
68
|
+
"""Get the package version.
|
69
|
+
|
70
|
+
Arguments:
|
71
|
+
package_name (str): The name of the package to check.
|
72
|
+
|
73
|
+
Returns:
|
74
|
+
str: The version of the package, or "unknown" if it cannot be determined.
|
75
|
+
"""
|
76
|
+
try:
|
77
|
+
result = subprocess.run(
|
78
|
+
[os.sys.executable, "-m", "pip", "show", package_name], # type: ignore
|
79
|
+
stdout=subprocess.PIPE,
|
80
|
+
stderr=subprocess.PIPE,
|
81
|
+
text=True,
|
82
|
+
check=True,
|
83
|
+
)
|
84
|
+
for line in result.stdout.splitlines():
|
85
|
+
if line.startswith("Version:"):
|
86
|
+
return line.split(":", 1)[1].strip()
|
87
|
+
return "unknown"
|
88
|
+
except Exception:
|
89
|
+
return "unknown"
|
90
|
+
|
91
|
+
|
92
|
+
PACKAGE_VERSION = get_package_version("maps4fs")
|
93
|
+
logger.info("maps4fs version: %s", PACKAGE_VERSION)
|
@@ -6,6 +6,7 @@ from __future__ import annotations
|
|
6
6
|
|
7
7
|
import os
|
8
8
|
|
9
|
+
import maps4fs.generator.config as mfscfg
|
9
10
|
from maps4fs.generator.component.background import Background
|
10
11
|
from maps4fs.generator.component.config import Config
|
11
12
|
from maps4fs.generator.component.grle import GRLE
|
@@ -13,8 +14,6 @@ from maps4fs.generator.component.i3d import I3d
|
|
13
14
|
from maps4fs.generator.component.satellite import Satellite
|
14
15
|
from maps4fs.generator.component.texture import Texture
|
15
16
|
|
16
|
-
working_directory = os.getcwd()
|
17
|
-
|
18
17
|
|
19
18
|
class Game:
|
20
19
|
"""Class used to define different versions of the game for which the map is generated.
|
@@ -34,10 +33,10 @@ class Game:
|
|
34
33
|
code: str | None = None
|
35
34
|
dem_multipliyer: int = 2
|
36
35
|
_additional_dem_name: str | None = None
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
36
|
+
_map_template_file: str | None = None
|
37
|
+
_texture_schema_file: str | None = None
|
38
|
+
_grle_schema_file: str | None = None
|
39
|
+
_tree_schema_file: str | None = None
|
41
40
|
_i3d_processing: bool = True
|
42
41
|
_plants_processing: bool = True
|
43
42
|
_environment_processing: bool = True
|
@@ -50,6 +49,27 @@ class Game:
|
|
50
49
|
def __init__(self, map_template_path: str | None = None):
|
51
50
|
if map_template_path:
|
52
51
|
self._map_template_path = map_template_path
|
52
|
+
else:
|
53
|
+
if not self._map_template_file:
|
54
|
+
raise ValueError("Map template file not set.")
|
55
|
+
self._map_template_path = os.path.join(
|
56
|
+
mfscfg.MFS_TEMPLATES_DIR, self._map_template_file # type: ignore
|
57
|
+
)
|
58
|
+
|
59
|
+
if not self._texture_schema_file:
|
60
|
+
self._texture_schema = None
|
61
|
+
else:
|
62
|
+
self._texture_schema = os.path.join(mfscfg.MFS_TEMPLATES_DIR, self._texture_schema_file) # type: ignore
|
63
|
+
|
64
|
+
if not self._grle_schema_file:
|
65
|
+
self._grle_schema = None
|
66
|
+
else:
|
67
|
+
self._grle_schema = os.path.join(mfscfg.MFS_TEMPLATES_DIR, self._grle_schema_file) # type: ignore
|
68
|
+
|
69
|
+
if not self._tree_schema_file:
|
70
|
+
self._tree_schema = None
|
71
|
+
else:
|
72
|
+
self._tree_schema = os.path.join(mfscfg.MFS_TEMPLATES_DIR, self._tree_schema_file) # type: ignore
|
53
73
|
|
54
74
|
def set_components_by_names(self, component_names: list[str]) -> None:
|
55
75
|
"""Sets the components used for map generation by their names.
|
@@ -297,8 +317,8 @@ class FS22(Game):
|
|
297
317
|
"""Class used to define the game version FS22."""
|
298
318
|
|
299
319
|
code = "FS22"
|
300
|
-
|
301
|
-
|
320
|
+
_map_template_file = "fs22-map-template.zip"
|
321
|
+
_texture_schema_file = "fs22-texture-schema.json"
|
302
322
|
_i3d_processing = False
|
303
323
|
_environment_processing = False
|
304
324
|
_fog_processing = False
|
@@ -342,10 +362,10 @@ class FS25(Game):
|
|
342
362
|
code = "FS25"
|
343
363
|
dem_multipliyer: int = 2
|
344
364
|
_additional_dem_name = "unprocessedHeightMap.png"
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
365
|
+
_map_template_file = "fs25-map-template.zip"
|
366
|
+
_texture_schema_file = "fs25-texture-schema.json"
|
367
|
+
_grle_schema_file = "fs25-grle-schema.json"
|
368
|
+
_tree_schema_file = "fs25-tree-schema.json"
|
349
369
|
|
350
370
|
def dem_file_path(self, map_directory: str) -> str:
|
351
371
|
"""Returns the path to the DEM file.
|
@@ -307,6 +307,7 @@ class MainSettings(NamedTuple):
|
|
307
307
|
longitude: float
|
308
308
|
country: str
|
309
309
|
size: int
|
310
|
+
output_size: int | None
|
310
311
|
rotation: int
|
311
312
|
dtm_provider: str
|
312
313
|
custom_osm: bool
|
@@ -342,6 +343,7 @@ class MainSettings(NamedTuple):
|
|
342
343
|
"longitude": self.longitude,
|
343
344
|
"country": self.country,
|
344
345
|
"size": self.size,
|
346
|
+
"output_size": self.output_size,
|
345
347
|
"rotation": self.rotation,
|
346
348
|
"dtm_provider": self.dtm_provider,
|
347
349
|
"custom_osm": self.custom_osm,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: maps4fs
|
3
|
-
Version: 2.1
|
3
|
+
Version: 2.2.1
|
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/
|
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">
|
@@ -85,8 +85,10 @@ Dynamic: license-file
|
|
85
85
|
|
86
86
|
</div>
|
87
87
|
|
88
|
+
🔥🔥🔥🗂️ Track, store and organize all your maps using the [My Maps](docs/my_maps.md) feature. 🔥🔥🔥<br>
|
89
|
+
<br>
|
88
90
|
🗺️ Supports 2x2, 4x4, 8x8, 16x16 and any custom size maps<br>
|
89
|
-
🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi)
|
91
|
+
🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi)<br>
|
90
92
|
✂️ Supports map scaling<br>
|
91
93
|
🔄 Support map rotation<br>
|
92
94
|
🌐 Supports custom [DTM Providers](https://github.com/iwatkot/pydtmdl)<br>
|
@@ -158,6 +160,14 @@ There are several ways to use the tool. You obviously need the **first one**, bu
|
|
158
160
|
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs iwatkot/maps4fs
|
159
161
|
```
|
160
162
|
|
163
|
+
If you want to persist your data, you can mount a directory to the container:
|
164
|
+
|
165
|
+
```bash
|
166
|
+
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs -v /c/maps4fs:/usr/src/app/mfsrootdir iwatkot/maps4fs
|
167
|
+
```
|
168
|
+
|
169
|
+
Learn more in the [My Maps](docs/my_maps.md) documentation.
|
170
|
+
|
161
171
|
And open [http://localhost:8501](http://localhost:8501) in your browser.<br>
|
162
172
|
If you don't know how to use Docker, navigate to the [Docker version](#option-2-docker-version), it's really simple.<br>
|
163
173
|
Check out the [Docker FAQ](docs/FAQ_docker.md) if you have any questions.<br>
|
@@ -212,8 +222,8 @@ Don't know where to start? Don't worry, just follow this [step-by-step guide](do
|
|
212
222
|
🛠️ Don't need to install anything.
|
213
223
|
🗺️ Supported map sizes: 2x2, 4x4.
|
214
224
|
✂️ Map scaling: not supported.
|
215
|
-
⚙️ Advanced settings:
|
216
|
-
🖼️ Texture dissolving:
|
225
|
+
⚙️ Advanced settings: partial.
|
226
|
+
🖼️ Texture dissolving: disabled.
|
217
227
|
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
228
|
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
229
|
|
@@ -240,6 +250,12 @@ You can launch the project with minimalistic UI in your browser using Docker. Fo
|
|
240
250
|
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs iwatkot/maps4fs
|
241
251
|
```
|
242
252
|
|
253
|
+
If you want to persist your data, you can mount a directory to the container:
|
254
|
+
|
255
|
+
```bash
|
256
|
+
docker run -d -p 8501:8501 -p 8000:8000 --name maps4fs -v /c/maps4fs:/usr/src/app/mfsrootdir iwatkot/maps4fs
|
257
|
+
```
|
258
|
+
|
243
259
|
3. Open your browser and go to [http://localhost:8501](http://localhost:8501).
|
244
260
|
4. Fill in the required fields and click on the `Generate` button.
|
245
261
|
5. When the map is generated click on the `Download` button to get the map.
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "maps4fs"
|
7
|
-
version = "2.1
|
7
|
+
version = "2.2.1"
|
8
8
|
description = "Generate map templates for Farming Simulator from real places."
|
9
9
|
authors = [{name = "iwatkot", email = "iwatkot@gmail.com"}]
|
10
10
|
license = {text = "Apache License 2.0"}
|
@@ -1,52 +0,0 @@
|
|
1
|
-
"""This module contains configuration files for the maps4fs generator."""
|
2
|
-
|
3
|
-
import os
|
4
|
-
import subprocess
|
5
|
-
|
6
|
-
from osmnx import settings as ox_settings
|
7
|
-
|
8
|
-
MFS_ROOT_DIR = os.getenv("MFS_ROOT_DIRECTORY", os.path.join(os.getcwd(), "mfsrootdir"))
|
9
|
-
MFS_CACHE_DIR = os.path.join(MFS_ROOT_DIR, "cache")
|
10
|
-
MFS_DATA_DIR = os.path.join(MFS_ROOT_DIR, "data")
|
11
|
-
os.makedirs(MFS_CACHE_DIR, exist_ok=True)
|
12
|
-
os.makedirs(MFS_DATA_DIR, exist_ok=True)
|
13
|
-
|
14
|
-
DTM_CACHE_DIR = os.path.join(MFS_CACHE_DIR, "dtm")
|
15
|
-
SAT_CACHE_DIR = os.path.join(MFS_CACHE_DIR, "sat")
|
16
|
-
|
17
|
-
osmnx_cache = os.path.join(MFS_CACHE_DIR, "osmnx")
|
18
|
-
osmnx_data = os.path.join(MFS_CACHE_DIR, "odata")
|
19
|
-
os.makedirs(osmnx_cache, exist_ok=True)
|
20
|
-
os.makedirs(osmnx_data, exist_ok=True)
|
21
|
-
|
22
|
-
|
23
|
-
ox_settings.cache_folder = osmnx_cache
|
24
|
-
ox_settings.data_folder = osmnx_data
|
25
|
-
|
26
|
-
|
27
|
-
def get_package_version(package_name: str) -> str:
|
28
|
-
"""Get the package version.
|
29
|
-
|
30
|
-
Arguments:
|
31
|
-
package_name (str): The name of the package to check.
|
32
|
-
|
33
|
-
Returns:
|
34
|
-
str: The version of the package, or "unknown" if it cannot be determined.
|
35
|
-
"""
|
36
|
-
try:
|
37
|
-
result = subprocess.run(
|
38
|
-
[os.sys.executable, "-m", "pip", "show", package_name], # type: ignore
|
39
|
-
stdout=subprocess.PIPE,
|
40
|
-
stderr=subprocess.PIPE,
|
41
|
-
text=True,
|
42
|
-
check=True,
|
43
|
-
)
|
44
|
-
for line in result.stdout.splitlines():
|
45
|
-
if line.startswith("Version:"):
|
46
|
-
return line.split(":", 1)[1].strip()
|
47
|
-
return "unknown"
|
48
|
-
except Exception:
|
49
|
-
return "unknown"
|
50
|
-
|
51
|
-
|
52
|
-
PACKAGE_VERSION = get_package_version("maps4fs")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|