maps4fs 1.6.91__tar.gz → 1.7.5__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-1.6.91 → maps4fs-1.7.5}/PKG-INFO +64 -29
- {maps4fs-1.6.91 → maps4fs-1.7.5}/README.md +62 -27
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/__init__.py +4 -2
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/component.py +6 -15
- maps4fs-1.7.5/maps4fs/generator/dtm/dtm.py +549 -0
- maps4fs-1.7.5/maps4fs/generator/dtm/nrw.py +127 -0
- maps4fs-1.7.5/maps4fs/generator/dtm/srtm.py +124 -0
- maps4fs-1.7.5/maps4fs/generator/dtm/usgs.py +135 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/settings.py +1 -1
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/texture.py +51 -49
- maps4fs-1.7.5/maps4fs/toolbox/custom_osm.py +67 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs.egg-info/PKG-INFO +64 -29
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs.egg-info/SOURCES.txt +2 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/pyproject.toml +1 -1
- maps4fs-1.6.91/maps4fs/generator/dtm/dtm.py +0 -321
- maps4fs-1.6.91/maps4fs/generator/dtm/srtm.py +0 -226
- maps4fs-1.6.91/maps4fs/generator/dtm/usgs.py +0 -351
- {maps4fs-1.6.91 → maps4fs-1.7.5}/LICENSE.md +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/__init__.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/background.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/config.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/dem.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/dtm/__init__.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/game.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/grle.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/i3d.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/map.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/qgis.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/generator/satellite.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/logger.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/toolbox/__init__.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/toolbox/background.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs/toolbox/dem.py +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs.egg-info/dependency_links.txt +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs.egg-info/requires.txt +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/maps4fs.egg-info/top_level.txt +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/setup.cfg +0 -0
- {maps4fs-1.6.91 → maps4fs-1.7.5}/tests/test_generator.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.2
|
2
2
|
Name: maps4fs
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.7.5
|
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
|
@@ -36,7 +36,6 @@ Requires-Dist: pydantic
|
|
36
36
|
<a href="#How-To-Run">How-To-Run</a><br>
|
37
37
|
<a href="docs/FAQ.md">FAQ</a> •
|
38
38
|
<a href="docs/map_structure.md">Map Structure</a> •
|
39
|
-
<a href="docs/tips_and_hints.md">Tips and Hints</a> •
|
40
39
|
<a href="#Modder-Toolbox">Modder Toolbox</a><br>
|
41
40
|
<a href="#Supported-objects">Supported objects</a> •
|
42
41
|
<a href="#Generation-info">Generation info</a> •
|
@@ -69,16 +68,15 @@ Requires-Dist: pydantic
|
|
69
68
|
</div>
|
70
69
|
|
71
70
|
🗺️ Supports 2x2, 4x4, 8x8, 16x16 and any custom size maps<br>
|
72
|
-
🔄 Support map rotation
|
71
|
+
🔄 Support map rotation<br>
|
73
72
|
🌐 Supports custom [DTM Providers](#DTM-Providers) 🆕<br>
|
74
|
-
🌾 Automatically generates fields
|
75
|
-
🌽 Automatically generates farmlands
|
76
|
-
🌿 Automatically generates decorative foliage
|
77
|
-
🌲 Automatically generates forests
|
78
|
-
🌊 Automatically generates water planes
|
73
|
+
🌾 Automatically generates fields<br>
|
74
|
+
🌽 Automatically generates farmlands<br>
|
75
|
+
🌿 Automatically generates decorative foliage<br>
|
76
|
+
🌲 Automatically generates forests<br>
|
77
|
+
🌊 Automatically generates water planes<br>
|
79
78
|
📈 Automatically generates splines 🆕<br>
|
80
79
|
🛰️ Automatically downloads high resolution satellite images 🆕<br>
|
81
|
-
🏔️ Allows to use multiple DTM providers for elevation models 🆕<br>
|
82
80
|
🌍 Based on real-world data from OpenStreetMap<br>
|
83
81
|
🗺️ Supports [custom OSM maps](/docs/custom_osm.md)<br>
|
84
82
|
🏞️ Generates height map using SRTM dataset<br>
|
@@ -99,10 +97,14 @@ Requires-Dist: pydantic
|
|
99
97
|
🌿 Automatically generates decorative foliage.<br><br>
|
100
98
|
<img src="https://github.com/user-attachments/assets/27a5e541-a9f5-4504-b8d2-64aae9fb3e52"><br>
|
101
99
|
🌲 Automatically generates forests.<br><br>
|
100
|
+
<img src="https://github.com/user-attachments/assets/891911d7-081d-431e-a677-b4ae96870286"><br>
|
101
|
+
🌲 Allows to select trees for generation.<br><br>
|
102
102
|
<img src="https://github.com/user-attachments/assets/cce7d4e0-cba2-4dd2-b22d-03137fb2e860"><br>
|
103
103
|
🌊 Automatically generates water planes.<br><br>
|
104
104
|
<img src="https://github.com/user-attachments/assets/0b05b511-a595-48e7-a353-8298081314a4"><br>
|
105
105
|
📈 Automatically generates splines.<br><br>
|
106
|
+
<img src="https://github.com/user-attachments/assets/0957db9e-7b95-4951-969c-9d1edd9f073b"><br>
|
107
|
+
🖌️ Allows customization of the texture schema.<br><br>
|
106
108
|
<img src="https://github.com/user-attachments/assets/80e5923c-22c7-4dc0-8906-680902511f3a"><br>
|
107
109
|
🗒️ True-to-life blueprints for fast and precise modding.<br><br>
|
108
110
|
<img width="480" src="https://github.com/user-attachments/assets/1a8802d2-6a3b-4bfa-af2b-7c09478e199b"><br>
|
@@ -138,7 +140,7 @@ Check out the [Docker FAQ](docs/FAQ_docker.md) if you have any questions.<br>
|
|
138
140
|
```bash
|
139
141
|
pip install maps4fs
|
140
142
|
```
|
141
|
-
And refer to the [Python package](#option-3-python-package) section to learn how to use it.<br>
|
143
|
+
And refer to the [Python package or run from the source](#option-3-python-package-or-source-code) section to learn how to use it.<br>
|
142
144
|
|
143
145
|
## Overview
|
144
146
|
The core idea is coming from the awesome [maps4cim](https://github.com/klamann/maps4cim) project.<br>
|
@@ -198,7 +200,7 @@ docker run -d -p 8501:8501 --name maps4fs iwatkot/maps4fs
|
|
198
200
|
4. Fill in the required fields and click on the `Generate` button.
|
199
201
|
5. When the map is generated click on the `Download` button to get the map.
|
200
202
|
|
201
|
-
### Option 3: Python package
|
203
|
+
### Option 3: Python package or source code
|
202
204
|
🔴 Recommended for developers.
|
203
205
|
🗺️ Supported map sizes: 2x2, 4x4, 8x8, 16x16 km and any custom size.
|
204
206
|
⚙️ Advanced settings: enabled.
|
@@ -209,11 +211,50 @@ You can use the Python package to generate maps. Follow these steps:
|
|
209
211
|
```bash
|
210
212
|
pip install maps4fs
|
211
213
|
```
|
214
|
+
|
215
|
+
Or clone the repository and install the package from the source code:
|
216
|
+
```bash
|
217
|
+
git clone https://github.com/iwatkot/maps4fs.git
|
218
|
+
cd maps4fs
|
219
|
+
dev/create_venv.ps1 # for Windows
|
220
|
+
sh dev/create_venv.sh # for Linux
|
221
|
+
|
222
|
+
# Activate the virtual environment.
|
223
|
+
./venv/scripts/activate # for Windows
|
224
|
+
source venv/bin/activate # for Linux
|
225
|
+
|
226
|
+
# Edit the demo.py file to set the parameters.
|
227
|
+
python demo.py
|
228
|
+
```
|
229
|
+
|
230
|
+
|
212
231
|
2. Import the Game class and create an instance of it:
|
213
232
|
```python
|
214
233
|
import maps4fs as mfs
|
215
234
|
|
216
|
-
|
235
|
+
game_code = "fs25"
|
236
|
+
game = mfs.Game.from_code(game_code)
|
237
|
+
|
238
|
+
dtm_provider = mfs.SRTM30Provider
|
239
|
+
dtm_provider_settings = mfs.SRTM30ProviderSettings(easy_mode=True, power_factor=0)
|
240
|
+
|
241
|
+
lat, lon = 45.28, 20.23
|
242
|
+
coordinates = (lat, lon)
|
243
|
+
size = 2048
|
244
|
+
rotation = 25
|
245
|
+
|
246
|
+
map_directory = "map_directory"
|
247
|
+
os.makedirs(map_directory, exist_ok=True)
|
248
|
+
|
249
|
+
mp = mfs.Map(
|
250
|
+
game,
|
251
|
+
dtm_provider,
|
252
|
+
dtm_provider_settings,
|
253
|
+
coordinates,
|
254
|
+
size,
|
255
|
+
rotation,
|
256
|
+
map_directory,
|
257
|
+
)
|
217
258
|
```
|
218
259
|
In this case, the library will use the default templates, which should be present in the `data` directory, which should be placed in the current working directory.<br>
|
219
260
|
Structure example:<br>
|
@@ -226,28 +267,17 @@ Structure example:<br>
|
|
226
267
|
|
227
268
|
So it's recommended to download the `data` directory from the repository and place it in the root of your project.<br>
|
228
269
|
|
229
|
-
3.
|
230
|
-
```python
|
231
|
-
import maps4fs as mfs
|
232
|
-
|
233
|
-
map = mfs.Map(
|
234
|
-
game,
|
235
|
-
(52.5200, 13.4050), # Latitude and longitude of the map center.
|
236
|
-
height=1024, # The height of the map in meters.
|
237
|
-
width=1024, # The width of the map in meters.
|
238
|
-
map_directory="path/to/your/map/directory", # The directory where the map will be saved.
|
239
|
-
)
|
240
|
-
```
|
241
|
-
|
242
|
-
4. Generate the map:
|
270
|
+
3. Launch the generation process.
|
243
271
|
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.
|
244
272
|
```python
|
245
|
-
for
|
246
|
-
print(
|
273
|
+
for component_name in mp.generate():
|
274
|
+
print(f"Generating {component_name}...")
|
247
275
|
```
|
248
276
|
|
249
277
|
The map will be saved in the `map_directory` directory.
|
250
278
|
|
279
|
+
➡️ Check out the [demo.py](demo.py) file for a complete example.
|
280
|
+
|
251
281
|
## Modder Toolbox
|
252
282
|
The tool now has a Modder Toolbox, which is a set of tools to help you with various tasks. You can open the toolbox by switching to the `🧰 Modder Toolbox` tab in the StreamLit app.<br>
|
253
283
|
|
@@ -259,7 +289,12 @@ Tools are divided into categories, which are listed below.
|
|
259
289
|
#### For custom schemas
|
260
290
|
- **Tree Schema Editor** - allows you to view all the supported trees models and select the ones you need on your map. After it, you should click the Show updated schema button and copy the JSON schema to the clipboard. Then you can use it in the Expert settings to generate the map with the selected trees.
|
261
291
|
|
292
|
+
- **Texture Schema Editor** - allows you to view all the supported textures and edit their parameters, such as priority, OSM tags and so on. After editing, you should click the Show updated schema button and copy the JSON schema to the clipboard. Then you can use it in the Expert settings to generate the map with the updated textures.
|
293
|
+
|
262
294
|
#### For Textures and DEM
|
295
|
+
|
296
|
+
- **Fix custom OSM file** - this tool fixes the most common errors in the custom OSM file, but it can not guarantee that the file will be fixed completely if some non-common errors are present.
|
297
|
+
|
263
298
|
- **GeoTIFF windowing** - allows you to upload your GeoTIFF file and select the region of interest to extract it from the image. It's useful when you have high-resolution DEM data and want to create a height map using it.
|
264
299
|
|
265
300
|
#### For Background terrain
|
@@ -10,7 +10,6 @@
|
|
10
10
|
<a href="#How-To-Run">How-To-Run</a><br>
|
11
11
|
<a href="docs/FAQ.md">FAQ</a> •
|
12
12
|
<a href="docs/map_structure.md">Map Structure</a> •
|
13
|
-
<a href="docs/tips_and_hints.md">Tips and Hints</a> •
|
14
13
|
<a href="#Modder-Toolbox">Modder Toolbox</a><br>
|
15
14
|
<a href="#Supported-objects">Supported objects</a> •
|
16
15
|
<a href="#Generation-info">Generation info</a> •
|
@@ -43,16 +42,15 @@
|
|
43
42
|
</div>
|
44
43
|
|
45
44
|
🗺️ Supports 2x2, 4x4, 8x8, 16x16 and any custom size maps<br>
|
46
|
-
🔄 Support map rotation
|
45
|
+
🔄 Support map rotation<br>
|
47
46
|
🌐 Supports custom [DTM Providers](#DTM-Providers) 🆕<br>
|
48
|
-
🌾 Automatically generates fields
|
49
|
-
🌽 Automatically generates farmlands
|
50
|
-
🌿 Automatically generates decorative foliage
|
51
|
-
🌲 Automatically generates forests
|
52
|
-
🌊 Automatically generates water planes
|
47
|
+
🌾 Automatically generates fields<br>
|
48
|
+
🌽 Automatically generates farmlands<br>
|
49
|
+
🌿 Automatically generates decorative foliage<br>
|
50
|
+
🌲 Automatically generates forests<br>
|
51
|
+
🌊 Automatically generates water planes<br>
|
53
52
|
📈 Automatically generates splines 🆕<br>
|
54
53
|
🛰️ Automatically downloads high resolution satellite images 🆕<br>
|
55
|
-
🏔️ Allows to use multiple DTM providers for elevation models 🆕<br>
|
56
54
|
🌍 Based on real-world data from OpenStreetMap<br>
|
57
55
|
🗺️ Supports [custom OSM maps](/docs/custom_osm.md)<br>
|
58
56
|
🏞️ Generates height map using SRTM dataset<br>
|
@@ -73,10 +71,14 @@
|
|
73
71
|
🌿 Automatically generates decorative foliage.<br><br>
|
74
72
|
<img src="https://github.com/user-attachments/assets/27a5e541-a9f5-4504-b8d2-64aae9fb3e52"><br>
|
75
73
|
🌲 Automatically generates forests.<br><br>
|
74
|
+
<img src="https://github.com/user-attachments/assets/891911d7-081d-431e-a677-b4ae96870286"><br>
|
75
|
+
🌲 Allows to select trees for generation.<br><br>
|
76
76
|
<img src="https://github.com/user-attachments/assets/cce7d4e0-cba2-4dd2-b22d-03137fb2e860"><br>
|
77
77
|
🌊 Automatically generates water planes.<br><br>
|
78
78
|
<img src="https://github.com/user-attachments/assets/0b05b511-a595-48e7-a353-8298081314a4"><br>
|
79
79
|
📈 Automatically generates splines.<br><br>
|
80
|
+
<img src="https://github.com/user-attachments/assets/0957db9e-7b95-4951-969c-9d1edd9f073b"><br>
|
81
|
+
🖌️ Allows customization of the texture schema.<br><br>
|
80
82
|
<img src="https://github.com/user-attachments/assets/80e5923c-22c7-4dc0-8906-680902511f3a"><br>
|
81
83
|
🗒️ True-to-life blueprints for fast and precise modding.<br><br>
|
82
84
|
<img width="480" src="https://github.com/user-attachments/assets/1a8802d2-6a3b-4bfa-af2b-7c09478e199b"><br>
|
@@ -112,7 +114,7 @@ Check out the [Docker FAQ](docs/FAQ_docker.md) if you have any questions.<br>
|
|
112
114
|
```bash
|
113
115
|
pip install maps4fs
|
114
116
|
```
|
115
|
-
And refer to the [Python package](#option-3-python-package) section to learn how to use it.<br>
|
117
|
+
And refer to the [Python package or run from the source](#option-3-python-package-or-source-code) section to learn how to use it.<br>
|
116
118
|
|
117
119
|
## Overview
|
118
120
|
The core idea is coming from the awesome [maps4cim](https://github.com/klamann/maps4cim) project.<br>
|
@@ -172,7 +174,7 @@ docker run -d -p 8501:8501 --name maps4fs iwatkot/maps4fs
|
|
172
174
|
4. Fill in the required fields and click on the `Generate` button.
|
173
175
|
5. When the map is generated click on the `Download` button to get the map.
|
174
176
|
|
175
|
-
### Option 3: Python package
|
177
|
+
### Option 3: Python package or source code
|
176
178
|
🔴 Recommended for developers.
|
177
179
|
🗺️ Supported map sizes: 2x2, 4x4, 8x8, 16x16 km and any custom size.
|
178
180
|
⚙️ Advanced settings: enabled.
|
@@ -183,11 +185,50 @@ You can use the Python package to generate maps. Follow these steps:
|
|
183
185
|
```bash
|
184
186
|
pip install maps4fs
|
185
187
|
```
|
188
|
+
|
189
|
+
Or clone the repository and install the package from the source code:
|
190
|
+
```bash
|
191
|
+
git clone https://github.com/iwatkot/maps4fs.git
|
192
|
+
cd maps4fs
|
193
|
+
dev/create_venv.ps1 # for Windows
|
194
|
+
sh dev/create_venv.sh # for Linux
|
195
|
+
|
196
|
+
# Activate the virtual environment.
|
197
|
+
./venv/scripts/activate # for Windows
|
198
|
+
source venv/bin/activate # for Linux
|
199
|
+
|
200
|
+
# Edit the demo.py file to set the parameters.
|
201
|
+
python demo.py
|
202
|
+
```
|
203
|
+
|
204
|
+
|
186
205
|
2. Import the Game class and create an instance of it:
|
187
206
|
```python
|
188
207
|
import maps4fs as mfs
|
189
208
|
|
190
|
-
|
209
|
+
game_code = "fs25"
|
210
|
+
game = mfs.Game.from_code(game_code)
|
211
|
+
|
212
|
+
dtm_provider = mfs.SRTM30Provider
|
213
|
+
dtm_provider_settings = mfs.SRTM30ProviderSettings(easy_mode=True, power_factor=0)
|
214
|
+
|
215
|
+
lat, lon = 45.28, 20.23
|
216
|
+
coordinates = (lat, lon)
|
217
|
+
size = 2048
|
218
|
+
rotation = 25
|
219
|
+
|
220
|
+
map_directory = "map_directory"
|
221
|
+
os.makedirs(map_directory, exist_ok=True)
|
222
|
+
|
223
|
+
mp = mfs.Map(
|
224
|
+
game,
|
225
|
+
dtm_provider,
|
226
|
+
dtm_provider_settings,
|
227
|
+
coordinates,
|
228
|
+
size,
|
229
|
+
rotation,
|
230
|
+
map_directory,
|
231
|
+
)
|
191
232
|
```
|
192
233
|
In this case, the library will use the default templates, which should be present in the `data` directory, which should be placed in the current working directory.<br>
|
193
234
|
Structure example:<br>
|
@@ -200,28 +241,17 @@ Structure example:<br>
|
|
200
241
|
|
201
242
|
So it's recommended to download the `data` directory from the repository and place it in the root of your project.<br>
|
202
243
|
|
203
|
-
3.
|
204
|
-
```python
|
205
|
-
import maps4fs as mfs
|
206
|
-
|
207
|
-
map = mfs.Map(
|
208
|
-
game,
|
209
|
-
(52.5200, 13.4050), # Latitude and longitude of the map center.
|
210
|
-
height=1024, # The height of the map in meters.
|
211
|
-
width=1024, # The width of the map in meters.
|
212
|
-
map_directory="path/to/your/map/directory", # The directory where the map will be saved.
|
213
|
-
)
|
214
|
-
```
|
215
|
-
|
216
|
-
4. Generate the map:
|
244
|
+
3. Launch the generation process.
|
217
245
|
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.
|
218
246
|
```python
|
219
|
-
for
|
220
|
-
print(
|
247
|
+
for component_name in mp.generate():
|
248
|
+
print(f"Generating {component_name}...")
|
221
249
|
```
|
222
250
|
|
223
251
|
The map will be saved in the `map_directory` directory.
|
224
252
|
|
253
|
+
➡️ Check out the [demo.py](demo.py) file for a complete example.
|
254
|
+
|
225
255
|
## Modder Toolbox
|
226
256
|
The tool now has a Modder Toolbox, which is a set of tools to help you with various tasks. You can open the toolbox by switching to the `🧰 Modder Toolbox` tab in the StreamLit app.<br>
|
227
257
|
|
@@ -233,7 +263,12 @@ Tools are divided into categories, which are listed below.
|
|
233
263
|
#### For custom schemas
|
234
264
|
- **Tree Schema Editor** - allows you to view all the supported trees models and select the ones you need on your map. After it, you should click the Show updated schema button and copy the JSON schema to the clipboard. Then you can use it in the Expert settings to generate the map with the selected trees.
|
235
265
|
|
266
|
+
- **Texture Schema Editor** - allows you to view all the supported textures and edit their parameters, such as priority, OSM tags and so on. After editing, you should click the Show updated schema button and copy the JSON schema to the clipboard. Then you can use it in the Expert settings to generate the map with the updated textures.
|
267
|
+
|
236
268
|
#### For Textures and DEM
|
269
|
+
|
270
|
+
- **Fix custom OSM file** - this tool fixes the most common errors in the custom OSM file, but it can not guarantee that the file will be fixed completely if some non-common errors are present.
|
271
|
+
|
237
272
|
- **GeoTIFF windowing** - allows you to upload your GeoTIFF file and select the region of interest to extract it from the image. It's useful when you have high-resolution DEM data and want to create a height map using it.
|
238
273
|
|
239
274
|
#### For Background terrain
|
@@ -1,7 +1,8 @@
|
|
1
1
|
# pylint: disable=missing-module-docstring
|
2
2
|
from maps4fs.generator.dtm.dtm import DTMProvider
|
3
|
-
from maps4fs.generator.dtm.srtm import SRTM30Provider
|
4
|
-
from maps4fs.generator.dtm.usgs import USGSProvider
|
3
|
+
from maps4fs.generator.dtm.srtm import SRTM30Provider, SRTM30ProviderSettings
|
4
|
+
from maps4fs.generator.dtm.usgs import USGSProvider, USGSProviderSettings
|
5
|
+
from maps4fs.generator.dtm.nrw import NRWProvider, NRWProviderSettings
|
5
6
|
from maps4fs.generator.game import Game
|
6
7
|
from maps4fs.generator.map import Map
|
7
8
|
from maps4fs.generator.settings import (
|
@@ -9,6 +10,7 @@ from maps4fs.generator.settings import (
|
|
9
10
|
DEMSettings,
|
10
11
|
GRLESettings,
|
11
12
|
I3DSettings,
|
13
|
+
SatelliteSettings,
|
12
14
|
SettingsModel,
|
13
15
|
SplineSettings,
|
14
16
|
TextureSettings,
|
@@ -188,8 +188,7 @@ class Component:
|
|
188
188
|
self,
|
189
189
|
coordinates: tuple[float, float] | None = None,
|
190
190
|
distance: int | None = None,
|
191
|
-
|
192
|
-
) -> tuple[int, int, int, int]:
|
191
|
+
) -> tuple[float, float, float, float]:
|
193
192
|
"""Calculates the bounding box of the map from the coordinates and the height and
|
194
193
|
width of the map.
|
195
194
|
If coordinates and distance are not provided, the instance variables are used.
|
@@ -199,24 +198,23 @@ class Component:
|
|
199
198
|
of the map. Defaults to None.
|
200
199
|
distance (int, optional): The distance from the center of the map to the edge of the
|
201
200
|
map in all directions. Defaults to None.
|
202
|
-
project_utm (bool, optional): Whether to project the bounding box to UTM.
|
203
201
|
|
204
202
|
Returns:
|
205
|
-
tuple[
|
203
|
+
tuple[float, float, float, float]: The bounding box of the map.
|
206
204
|
"""
|
207
205
|
coordinates = coordinates or self.coordinates
|
208
206
|
distance = distance or int(self.map_rotated_size / 2)
|
209
207
|
|
210
208
|
west, south, east, north = ox.utils_geo.bbox_from_point( # type: ignore
|
211
|
-
coordinates,
|
209
|
+
coordinates,
|
210
|
+
dist=distance,
|
212
211
|
)
|
213
212
|
|
214
213
|
bbox = north, south, east, west
|
215
214
|
self.logger.debug(
|
216
|
-
"Calculated bounding box for component: %s: %s,
|
215
|
+
"Calculated bounding box for component: %s: %s, distance: %s",
|
217
216
|
self.__class__.__name__,
|
218
217
|
bbox,
|
219
|
-
project_utm,
|
220
218
|
distance,
|
221
219
|
)
|
222
220
|
return bbox
|
@@ -225,7 +223,7 @@ class Component:
|
|
225
223
|
"""Saves the bounding box of the map to the component instance from the coordinates and the
|
226
224
|
height and width of the map.
|
227
225
|
"""
|
228
|
-
self.bbox = self.get_bbox(
|
226
|
+
self.bbox = self.get_bbox()
|
229
227
|
self.logger.debug("Saved bounding box: %s", self.bbox)
|
230
228
|
|
231
229
|
@property
|
@@ -544,17 +542,10 @@ class Component:
|
|
544
542
|
"""
|
545
543
|
|
546
544
|
scaling_factor = 1 / self.map.dem_settings.multiplier
|
547
|
-
self.logger.debug("Z scaling factor including DEM multiplier: %s", scaling_factor)
|
548
545
|
|
549
546
|
if self.map.shared_settings.height_scale_multiplier:
|
550
547
|
scaling_factor *= self.map.shared_settings.height_scale_multiplier
|
551
|
-
self.logger.debug(
|
552
|
-
"Z scaling factor including height scale multiplier: %s", scaling_factor
|
553
|
-
)
|
554
548
|
if self.map.shared_settings.mesh_z_scaling_factor:
|
555
549
|
scaling_factor *= 1 / self.map.shared_settings.mesh_z_scaling_factor
|
556
|
-
self.logger.debug(
|
557
|
-
"Z scaling factor including mesh z scaling factor: %s", scaling_factor
|
558
|
-
)
|
559
550
|
|
560
551
|
return scaling_factor
|