maps4fs 0.7.9__py3-none-any.whl → 0.8.3__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.
- maps4fs/generator/background.py +292 -0
- maps4fs/generator/component.py +66 -0
- maps4fs/generator/config.py +4 -2
- maps4fs/generator/dem.py +115 -32
- maps4fs/generator/game.py +24 -1
- maps4fs/generator/i3d.py +89 -0
- maps4fs/generator/map.py +43 -27
- maps4fs/generator/path_steps.py +72 -0
- maps4fs/generator/texture.py +86 -29
- maps4fs/generator/tile.py +55 -0
- {maps4fs-0.7.9.dist-info → maps4fs-0.8.3.dist-info}/METADATA +172 -25
- maps4fs-0.8.3.dist-info/RECORD +18 -0
- maps4fs-0.7.9.dist-info/RECORD +0 -14
- {maps4fs-0.7.9.dist-info → maps4fs-0.8.3.dist-info}/LICENSE.md +0 -0
- {maps4fs-0.7.9.dist-info → maps4fs-0.8.3.dist-info}/WHEEL +0 -0
- {maps4fs-0.7.9.dist-info → maps4fs-0.8.3.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: maps4fs
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.8.3
|
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
|
@@ -16,7 +16,9 @@ License-File: LICENSE.md
|
|
16
16
|
Requires-Dist: opencv-python
|
17
17
|
Requires-Dist: osmnx<2.0.0
|
18
18
|
Requires-Dist: rasterio
|
19
|
-
Requires-Dist:
|
19
|
+
Requires-Dist: folium
|
20
|
+
Requires-Dist: geopy
|
21
|
+
Requires-Dist: trimesh
|
20
22
|
|
21
23
|
<div align="center" markdown>
|
22
24
|
<img src="https://github.com/iwatkot/maps4fs/assets/118521851/ffd7f0a3-e317-4c3f-911f-2c2fb736fbfa">
|
@@ -24,9 +26,13 @@ Requires-Dist: tqdm
|
|
24
26
|
<p align="center">
|
25
27
|
<a href="#Quick-Start">Quick Start</a> •
|
26
28
|
<a href="#Overview">Overview</a> •
|
27
|
-
<a href="#How-To-Run">How-To-Run</a>
|
28
|
-
<a href="#Supported-objects">Supported objects</a> •
|
29
|
-
<a href="#
|
29
|
+
<a href="#How-To-Run">How-To-Run</a><br>
|
30
|
+
<a href="#Supported-objects">Supported objects</a> •
|
31
|
+
<a href="#Generation-info">Generation info</a> •
|
32
|
+
<a href="#Texture-schema">Texture schema</a> •
|
33
|
+
<a href="Background-terrain">Background terrain</a><br>
|
34
|
+
<a href="#For-advanced-users">For advanced users</a> •
|
35
|
+
<a jref="#Resources">Resources</a> •
|
30
36
|
<a href="#Bugs-and-feature-requests">Bugs and feature requests</a>
|
31
37
|
</p>
|
32
38
|
|
@@ -36,6 +42,7 @@ Requires-Dist: tqdm
|
|
36
42
|
[](https://hub.docker.com/repository/docker/iwatkot/maps4fs/general)
|
37
43
|
[](https://github.com/iwatkot/maps4fs/issues)
|
38
44
|
[](https://codeclimate.com/github/iwatkot/maps4fs/maintainability)<br>
|
45
|
+
[](https://pypi.org/project/maps4fs)
|
39
46
|
[](https://mypy-lang.org/)
|
40
47
|
[](https://github.com/iwatkot/maps4fs/actions)
|
41
48
|
[](https://codeclimate.com/github/iwatkot/maps4fs/test_coverage)
|
@@ -48,6 +55,8 @@ Requires-Dist: tqdm
|
|
48
55
|
🏞️ Generates height using SRTM dataset<br>
|
49
56
|
📦 Provides a ready-to-use map template for the Giants Editor<br>
|
50
57
|
🚜 Supports Farming Simulator 22 and 25<br>
|
58
|
+
🔷 Generates *.obj files for background terrain based on the real-world height map 🆕<br>
|
59
|
+
📄 Generates commands to obtain high-resolution satellite images from [QGIS](https://qgis.org/download/) 🆕<br>
|
51
60
|
|
52
61
|
## Quick Start
|
53
62
|
There are several ways to use the tool. You obviously need the **first one**, but you can choose any of the others depending on your needs.<br>
|
@@ -119,7 +128,7 @@ docker run -d -p 8501:8501 iwatkot/maps4fs
|
|
119
128
|
4. Fill in the required fields and click on the `Generate` button.
|
120
129
|
5. When the map is generated click on the `Download` button to get the map.
|
121
130
|
|
122
|
-

|
123
132
|
|
124
133
|
### Option 3: Python package
|
125
134
|
🔴 Recommended for developers.<br>
|
@@ -160,8 +169,10 @@ map = mfs.Map(
|
|
160
169
|
```
|
161
170
|
|
162
171
|
4. Generate the map:
|
172
|
+
The `generate` method returns a generator, which yields the active component of the map. You can use it to track the progress of the generation process.
|
163
173
|
```python
|
164
|
-
map.generate()
|
174
|
+
for active_component in map.generate():
|
175
|
+
print(active_component)
|
165
176
|
```
|
166
177
|
|
167
178
|
The map will be saved in the `map_directory` directory.
|
@@ -181,30 +192,157 @@ The project is based on the [OpenStreetMap](https://www.openstreetmap.org/) data
|
|
181
192
|
|
182
193
|
The list will be updated as the project develops.
|
183
194
|
|
184
|
-
##
|
185
|
-
The script will
|
186
|
-
|
187
|
-
|
188
|
-
`
|
189
|
-
`
|
190
|
-
`
|
191
|
-
`
|
192
|
-
`
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
195
|
+
## Generation info
|
196
|
+
The script will generate the `generation_info.json` file in the `output` folder. It splitted to the different sections, which represents the components of the map generator. You may need this information to use some other tools and services to obtain additional data for your map.<br>
|
197
|
+
|
198
|
+
List of components:
|
199
|
+
- `Config` - this component handles the `map.xml` file, where the basic description of the map is stored.
|
200
|
+
- `Texture` - this component describes the textures, that were used to generate the map.
|
201
|
+
- `DEM` - this component describes the Digital Elevation Model (the one which creates terrain on your map), which was used to generate the height map and related to the `dem.png` file.
|
202
|
+
- `I3d` - this component describes the i3d file, where some specific attributes properties and path to the files are stored.
|
203
|
+
- `Background` - this component describes the 8 tiles, that surround the map.
|
204
|
+
|
205
|
+
Below you'll find descriptions of the components and the fields that they contain.<br>
|
206
|
+
ℹ️ If there's no information about the component, it means that at the moment it does not store any data in the `generation_info.json` file.
|
207
|
+
|
208
|
+
### Texture
|
209
|
+
|
210
|
+
Example of the `Texture` component:
|
211
|
+
```json
|
212
|
+
"Texture": {
|
213
|
+
"coordinates": [
|
214
|
+
45.28571409289627,
|
215
|
+
20.237433441210115
|
216
|
+
],
|
217
|
+
"bbox": [
|
218
|
+
45.29492313313172,
|
219
|
+
45.27650505266082,
|
220
|
+
20.250522423471406,
|
221
|
+
20.224344458948824
|
222
|
+
],
|
223
|
+
"map_height": 2048,
|
224
|
+
"map_width": 2048,
|
225
|
+
"minimum_x": 439161.2439774908,
|
226
|
+
"minimum_y": 5013940.540089059,
|
227
|
+
"maximum_x": 441233.5397821935,
|
228
|
+
"maximum_y": 5016006.074349126,
|
229
|
+
"height": 2065.5342600671574,
|
230
|
+
"width": 2072.295804702677,
|
231
|
+
"height_coef": 1.0085616504234167,
|
232
|
+
"width_coef": 1.011863185889979
|
233
|
+
},
|
234
|
+
```
|
235
|
+
|
236
|
+
And here's the list of the fields:
|
237
|
+
|
238
|
+
- `"coordinates"` - the coordinates of the map center which you entered,<br>
|
239
|
+
- `"bbox"` - the bounding box of the map in lat and lon,<br>
|
240
|
+
- `"map_height"` - the height of the map in meters (this one is from the user input, e.g. 2048 and so on),<br>
|
241
|
+
- `"map_width"` - the width of the map in meters (same as above),<br>
|
242
|
+
- `"minimum_x"` - the minimum x coordinate of the map (UTM projection),<br>
|
243
|
+
- `"minimum_y"` - the minimum y coordinate of the map (UTM projection),<br>
|
244
|
+
- `"maximum_x"` - the maximum x coordinate of the map (UTM projection),<br>
|
245
|
+
- `"maximum_y"` - the maximum y coordinate of the map (UTM projection),<br>
|
246
|
+
- `"height"` - the height of the map in meters (it won't be equal to the parameters above since the Earth is not flat, sorry flat-earthers),<br>
|
247
|
+
- `"width"` - the width of the map in meters (same as above),<br>
|
248
|
+
- `"height_coef"` - since we need a texture of exact size, the height of the map is multiplied by this coefficient,<br>
|
249
|
+
- `"width_coef"` - same as above but for the width,<br>
|
250
|
+
- `"tile_name"` - the name of the SRTM tile which was used to generate the height map, e.g. "N52E013"<br>
|
251
|
+
|
252
|
+
### Background
|
253
|
+
|
254
|
+
The background component consist of the 8 tiles, each one represents the tile, that surrounds the map. The tiles are named as the cardinal points, e.g. "N", "NE", "E" and so on.<br>
|
255
|
+
Example of the `Background` component:
|
256
|
+
|
257
|
+
```json
|
258
|
+
"Background": {
|
259
|
+
"N": {
|
260
|
+
"center_latitude": 45.30414170952092,
|
261
|
+
"center_longitude": 20.237433441210115,
|
262
|
+
"epsg3857_string": "2251363.25324853,2254278.318028022,5668072.719985372,5670987.784803056 [EPSG:3857]",
|
263
|
+
"height": 2048,
|
264
|
+
"width": 2048,
|
265
|
+
"north": 45.31335074975637,
|
266
|
+
"south": 45.29493266928547,
|
267
|
+
"east": 20.250526677438195,
|
268
|
+
"west": 20.224340204982035
|
269
|
+
},
|
270
|
+
}
|
271
|
+
```
|
272
|
+
|
273
|
+
And here's the list of the fields:
|
274
|
+
- `"center_latitude"` - the latitude of the center of the tile,<br>
|
275
|
+
- `"center_longitude"` - the longitude of the center of the tile,<br>
|
276
|
+
- `"epsg3857_string"` - the string representation of the bounding box in the EPSG:3857 projection, it's required to obtain the satellite images in the QGIS,<br>
|
277
|
+
- `"height"` - the height of the tile in meters,<br>
|
278
|
+
- `"width"` - the width of the tile in meters,<br>
|
279
|
+
- `"north"` - the northern border of the tile,<br>
|
280
|
+
- `"south"` - the southern border of the tile,<br>
|
281
|
+
- `"east"` - the eastern border of the tile,<br>
|
282
|
+
- `"west"` - the western border of the tile,<br>
|
283
|
+
|
284
|
+
## Texture schema
|
285
|
+
maps4fs uses a simple JSON file to define the texture schema. For each of supported games this file has unique entries, but the structure is the same. Here's an example of the schema for Farming Simulator 25:
|
286
|
+
|
287
|
+
```json
|
288
|
+
[
|
289
|
+
{
|
290
|
+
"name": "forestRockRoots",
|
291
|
+
"count": 2,
|
292
|
+
"exclude_weight": true
|
293
|
+
},
|
294
|
+
{
|
295
|
+
"name": "grass",
|
296
|
+
"count": 2,
|
297
|
+
"tags": { "natural": "grassland" },
|
298
|
+
"color": [34, 255, 34],
|
299
|
+
"priority": 0
|
300
|
+
},
|
301
|
+
{
|
302
|
+
"name": "grassClovers",
|
303
|
+
"count": 2
|
304
|
+
},
|
305
|
+
{
|
306
|
+
"name": "grassCut",
|
307
|
+
"count": 2
|
308
|
+
},
|
309
|
+
{
|
310
|
+
"name": "grassDirtPatchy",
|
311
|
+
"count": 2,
|
312
|
+
"tags": { "natural": ["wood", "tree_row"] },
|
313
|
+
"width": 2,
|
314
|
+
"color": [0, 252, 124]
|
315
|
+
}
|
316
|
+
]
|
317
|
+
```
|
318
|
+
Let's have a closer look at the fields:
|
319
|
+
- `name` - the name of the texture. Just the way the file will be named.
|
320
|
+
- `count` - the number of textures of this type. For example, for the **dirtMedium** texture there will be two textures: **dirtMedium01_weight.png** and **dirtMedium02_weight.png**.
|
321
|
+
ℹ️ There's one texture that have count `0`, it's the waterPuddle texture from FS22, which not present in FS25.
|
322
|
+
- `tags` - the tags from the OpenStreetMap data. Refer to the section [Supported objects](#supported-objects) to see the list of supported tags. If there are no tags, the texture file will be generated empty and no objects will be placed on it.
|
323
|
+
- `width` - the width of the texture in meters. Some of the objects from OSM (roads, for example) are lines, not areas. So, to draw them correctly, the tool needs to know the width of the line.
|
324
|
+
- `color` - the color of the texture. It's used only in the preview images and have no effect on the map itself. But remember that previews are crucial for the map making process, so it's better to set the color to something that represents the texture.
|
325
|
+
- `priority` - the priority of the texture for overlapping. Textures with higher priorities will be drawn over the textures with lower priorities.
|
326
|
+
ℹ️ The texture with 0 priority considers the base layer, which means that all empty areas will be filled with this texture.
|
327
|
+
- `exclude_weight` - this only used for the forestRockRoots texture from FS25. It's just means that this texture has no `weight` postfix, that's all.
|
328
|
+
|
329
|
+
## Background terrain
|
330
|
+
The tool now supports the generation of the background terrain. If you don't know what it is, here's a brief explanation. The background terrain is the world around the map. It's important to create it, because if you don't, the map will look like it's floating in the void. The background terrain is a simple plane which can (and should) be texture to look fine.<br>
|
331
|
+
So, the tool generates the background terrain in the form of the 8 tiles, which surround the map. The tiles are named as the cardinal points, e.g. "N", "NE", "E" and so on. All those tiles will be saved in the `objects/tiles` directory with corresponding names: `N.obj`, `NE.obj`, `E.obj` and so on.<br>
|
332
|
+
If you're willing to create a background terrain, you will need: Blender, the Blender Exporter Plugins and the QGIS. You'll find the download links in the [Resources](#resources) section.<br>
|
333
|
+
|
334
|
+
If you're afraid of this task, please don't be. It's really simple and I've prepaired detailed step-by-step instructions for you, you'll find them in the separate README files. Here are the steps you need to follow:
|
335
|
+
|
336
|
+
1. [Download high-resolution satellite images](README_satellite_images.md).
|
337
|
+
2. [Prepare the i3d files](README_i3d.md).
|
338
|
+
3. [Import the i3d files to Giants Editor](README_giants_editor.md).
|
201
339
|
|
202
340
|
## For advanced users
|
203
341
|
The tool supports the custom size of the map. To use this feature select `Custom` in the `Map size` dropdown and enter the desired size. The tool will generate a map with the size you entered.<br>
|
204
342
|
|
205
343
|
⛔️ Do not use this feature, if you don't know what you're doing. In most cases the Giants Editor will just crash on opening the file, because you need to enter a specific values for the map size.<br><br>
|
206
344
|
|
207
|
-

|
208
346
|
|
209
347
|
You can also apply some advanced settings to the map generation process. Note that they're ADVANCED, so you don't need to use them if you're not sure what they do.<br>
|
210
348
|
|
@@ -214,5 +352,14 @@ Here's the list of the advanced settings:
|
|
214
352
|
|
215
353
|
- DEM Blur radius: the radius of the Gaussian blur filter applied to the DEM map. By default, it's set to 21. This filter just makes the DEM map smoother, so the height transitions will be more natural. You can set it to 1 to disable the filter, but it will result as a Minecraft-like map.
|
216
354
|
|
355
|
+
## Resources
|
356
|
+
In this section you'll find a list of the resources that you need to create a map for the Farming Simulator.<br>
|
357
|
+
To create a basic map, you only need the Giants Editor. But if you want to create a background terrain - the world around the map, so it won't look like it's floating in the void - you also need Blender and the Blender Exporter Plugins. To create realistic textures for the background terrain, the QGIS is required to obtain high-resolution satellite images.<br>
|
358
|
+
|
359
|
+
1. [Giants Editor](https://gdn.giants-software.com/downloads.php) - the official tool for creating maps for the Farming Simulator.
|
360
|
+
2. [Blender](https://www.blender.org/download/) - the open-source 3D modeling software that you can use to create models for the Farming Simulator.
|
361
|
+
3. [Blender Exporter Plugins](https://gdn.giants-software.com/downloads.php) - the official plugins for exporting models from Blender to i3d format (the format used in the Farming Simulator).
|
362
|
+
4. [QGIS](https://qgis.org/download/) - the open-source GIS software that you can use to obtain high-resolution satellite images for your map.
|
363
|
+
|
217
364
|
## Bugs and feature requests
|
218
365
|
If you find a bug or have an idea for a new feature, please create an issue [here](https://github.com/iwatkot/maps4fs/issues) or contact me directly on [Telegram](https://t.me/iwatkot).<br>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
maps4fs/__init__.py,sha256=da4jmND2Ths9AffnkAKgzLHNkvKFOc_l21gJisPXqWY,155
|
2
|
+
maps4fs/logger.py,sha256=CneeHxQywjNUJXqQrUUSeiDxu95FfrfyK_Si1v0gMZ8,1477
|
3
|
+
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
4
|
+
maps4fs/generator/background.py,sha256=KsErhYERWXzMedGLg1H7wO94OXyaqw_XQYnotKNTStE,11267
|
5
|
+
maps4fs/generator/component.py,sha256=w5hUttO8m5bXcujLxB0pZjf25hxMnMPP4yPikQyoOkQ,6010
|
6
|
+
maps4fs/generator/config.py,sha256=ln_XGUdiPnc4zzhMVEueZRf-FGljeHtCHUnJ6FRlE4w,2264
|
7
|
+
maps4fs/generator/dem.py,sha256=FsYcaf0IQSYykKdbkHxAN5-Rc_PZZEBJfdZA2Z-b8AU,14514
|
8
|
+
maps4fs/generator/game.py,sha256=yry1tJYQi-tNLHlEY85Vz71KN_o2PVjxrAc4HDNB_Sg,6837
|
9
|
+
maps4fs/generator/i3d.py,sha256=UuQiQRusPQ2f6PvGKxJ_UZeXsx3uG15efmy8Ysnm3F8,3597
|
10
|
+
maps4fs/generator/map.py,sha256=2MXOIQxj7mDxhp76uh7EXqLP-v3T4TbiKQdx6my7GFc,4290
|
11
|
+
maps4fs/generator/path_steps.py,sha256=rKslIiG9mriCVL9_0i8Oet2p0DITrpBWi0pECpvuyUM,2707
|
12
|
+
maps4fs/generator/texture.py,sha256=0gkohGmamZbmqc9VpPqt8pli_x9w9SnUh2JjYGaiI3I,18170
|
13
|
+
maps4fs/generator/tile.py,sha256=3vmfjQiPiiUZKPuIo5tg2rOKkgcP1NRVkMGK-Vo10-A,2138
|
14
|
+
maps4fs-0.8.3.dist-info/LICENSE.md,sha256=-JY0v7p3dwXze61EbYiK7YEJ2aKrjaFZ8y2xYEOrmRY,1068
|
15
|
+
maps4fs-0.8.3.dist-info/METADATA,sha256=UbKREWFL9CnOpTHk1I76Q-4S5DEGOGbWoNro-qREB9c,20081
|
16
|
+
maps4fs-0.8.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
17
|
+
maps4fs-0.8.3.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
18
|
+
maps4fs-0.8.3.dist-info/RECORD,,
|
maps4fs-0.7.9.dist-info/RECORD
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
maps4fs/__init__.py,sha256=da4jmND2Ths9AffnkAKgzLHNkvKFOc_l21gJisPXqWY,155
|
2
|
-
maps4fs/logger.py,sha256=CneeHxQywjNUJXqQrUUSeiDxu95FfrfyK_Si1v0gMZ8,1477
|
3
|
-
maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
|
4
|
-
maps4fs/generator/component.py,sha256=BU_HNNyKXuEBohQJRTlXmNdSNrjolwX-ZzqqSSuzTrE,3463
|
5
|
-
maps4fs/generator/config.py,sha256=luDYXkKjgOM4-Mft4mHDPP6v-DVIUyWZAMAsCKyvaoY,2108
|
6
|
-
maps4fs/generator/dem.py,sha256=61SOBf1-Tr0AQb_HeYrnvDbKR4rR_7PfzL7i99ADZEA,11414
|
7
|
-
maps4fs/generator/game.py,sha256=dfbLyu1yqbHkBWmJu1uANCX-84vkdlvqR6hA6JCiIsE,6107
|
8
|
-
maps4fs/generator/map.py,sha256=zLIFAjjz-Y7u_FG-UjYoGiqBreLwuverkYY8Er9L_Qg,3796
|
9
|
-
maps4fs/generator/texture.py,sha256=cEXQOLJ5Iq_Nb0C9OmU-9PR-E_5cgM1Q62kG49G3VNg,16019
|
10
|
-
maps4fs-0.7.9.dist-info/LICENSE.md,sha256=-JY0v7p3dwXze61EbYiK7YEJ2aKrjaFZ8y2xYEOrmRY,1068
|
11
|
-
maps4fs-0.7.9.dist-info/METADATA,sha256=AoopE2APfkWbDK6H25pTqXuObQ_suF7a2kOxbiNGEPg,11844
|
12
|
-
maps4fs-0.7.9.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
13
|
-
maps4fs-0.7.9.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
|
14
|
-
maps4fs-0.7.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|