maps4fs 2.0.0__tar.gz → 2.0.3__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.
Files changed (64) hide show
  1. {maps4fs-2.0.0 → maps4fs-2.0.3}/PKG-INFO +4 -43
  2. {maps4fs-2.0.0 → maps4fs-2.0.3}/README.md +2 -42
  3. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/__init__.py +3 -2
  4. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/dem.py +3 -4
  5. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/map.py +2 -1
  6. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs.egg-info/PKG-INFO +4 -43
  7. maps4fs-2.0.3/maps4fs.egg-info/SOURCES.txt +31 -0
  8. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs.egg-info/requires.txt +1 -0
  9. {maps4fs-2.0.0 → maps4fs-2.0.3}/pyproject.toml +2 -1
  10. maps4fs-2.0.0/maps4fs/generator/dtm/__init__.py +0 -26
  11. maps4fs-2.0.0/maps4fs/generator/dtm/arctic.py +0 -74
  12. maps4fs-2.0.0/maps4fs/generator/dtm/baden.py +0 -31
  13. maps4fs-2.0.0/maps4fs/generator/dtm/base/wcs.py +0 -80
  14. maps4fs-2.0.0/maps4fs/generator/dtm/base/wms.py +0 -71
  15. maps4fs-2.0.0/maps4fs/generator/dtm/bavaria.py +0 -113
  16. maps4fs-2.0.0/maps4fs/generator/dtm/canada.py +0 -37
  17. maps4fs-2.0.0/maps4fs/generator/dtm/czech.py +0 -36
  18. maps4fs-2.0.0/maps4fs/generator/dtm/denmark.py +0 -50
  19. maps4fs-2.0.0/maps4fs/generator/dtm/dtm.py +0 -543
  20. maps4fs-2.0.0/maps4fs/generator/dtm/england.py +0 -31
  21. maps4fs-2.0.0/maps4fs/generator/dtm/finland.py +0 -56
  22. maps4fs-2.0.0/maps4fs/generator/dtm/flanders.py +0 -34
  23. maps4fs-2.0.0/maps4fs/generator/dtm/france.py +0 -69
  24. maps4fs-2.0.0/maps4fs/generator/dtm/hessen.py +0 -31
  25. maps4fs-2.0.0/maps4fs/generator/dtm/italy.py +0 -40
  26. maps4fs-2.0.0/maps4fs/generator/dtm/lithuania.py +0 -66
  27. maps4fs-2.0.0/maps4fs/generator/dtm/mv.py +0 -42
  28. maps4fs-2.0.0/maps4fs/generator/dtm/niedersachsen.py +0 -38
  29. maps4fs-2.0.0/maps4fs/generator/dtm/norway.py +0 -41
  30. maps4fs-2.0.0/maps4fs/generator/dtm/nrw.py +0 -30
  31. maps4fs-2.0.0/maps4fs/generator/dtm/rema.py +0 -74
  32. maps4fs-2.0.0/maps4fs/generator/dtm/sachsenanhalt.py +0 -36
  33. maps4fs-2.0.0/maps4fs/generator/dtm/scotland.py +0 -118
  34. maps4fs-2.0.0/maps4fs/generator/dtm/spain.py +0 -33
  35. maps4fs-2.0.0/maps4fs/generator/dtm/srtm.py +0 -122
  36. maps4fs-2.0.0/maps4fs/generator/dtm/switzerland.py +0 -104
  37. maps4fs-2.0.0/maps4fs/generator/dtm/thuringia.py +0 -60
  38. maps4fs-2.0.0/maps4fs/generator/dtm/usgs_wcs.py +0 -35
  39. maps4fs-2.0.0/maps4fs/generator/dtm/utils.py +0 -61
  40. maps4fs-2.0.0/maps4fs.egg-info/SOURCES.txt +0 -61
  41. {maps4fs-2.0.0 → maps4fs-2.0.3}/LICENSE.md +0 -0
  42. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/__init__.py +0 -0
  43. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/__init__.py +0 -0
  44. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/background.py +0 -0
  45. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/base/__init__.py +0 -0
  46. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/base/component.py +0 -0
  47. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/base/component_image.py +0 -0
  48. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/base/component_mesh.py +0 -0
  49. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/base/component_xml.py +0 -0
  50. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/config.py +0 -0
  51. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/grle.py +0 -0
  52. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/i3d.py +0 -0
  53. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/layer.py +0 -0
  54. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/satellite.py +0 -0
  55. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/component/texture.py +0 -0
  56. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/game.py +0 -0
  57. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/qgis.py +0 -0
  58. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/settings.py +0 -0
  59. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/generator/statistics.py +0 -0
  60. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs/logger.py +0 -0
  61. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs.egg-info/dependency_links.txt +0 -0
  62. {maps4fs-2.0.0 → maps4fs-2.0.3}/maps4fs.egg-info/top_level.txt +0 -0
  63. {maps4fs-2.0.0 → maps4fs-2.0.3}/setup.cfg +0 -0
  64. {maps4fs-2.0.0 → maps4fs-2.0.3}/tests/test_generator.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maps4fs
3
- Version: 2.0.0
3
+ Version: 2.0.3
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
@@ -26,6 +26,7 @@ Requires-Dist: pygmdl
26
26
  Requires-Dist: owslib
27
27
  Requires-Dist: tqdm
28
28
  Requires-Dist: scipy
29
+ Requires-Dist: pydtmdl
29
30
  Dynamic: license-file
30
31
 
31
32
  ⚠️ Learn more about the 2.0 changes in the [migration guide](docs/migration.md).
@@ -65,7 +66,6 @@ Dynamic: license-file
65
66
  <a href="#Resources">Resources</a> •
66
67
  <a href="#Bugs-and-feature-requests">Bugs and feature requests</a><br>
67
68
  <a href="docs/procedural_generation.md">Procedural Generation</a> •
68
- <a href="#DTM-Providers">DTM Providers</a> •
69
69
  <a href="#Special-thanks">Special thanks</a>
70
70
  </p>
71
71
 
@@ -87,7 +87,7 @@ Dynamic: license-file
87
87
  🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi) 🆕<br>
88
88
  ✂️ Supports map scaling<br>
89
89
  🔄 Support map rotation<br>
90
- 🌐 Supports custom [DTM Providers](#DTM-Providers)<br>
90
+ 🌐 Supports custom [DTM Providers](https://github.com/iwatkot/pydtmdl)<br>
91
91
  🌾 Automatically generates fields<br>
92
92
  🌽 Automatically generates farmlands<br>
93
93
  🌿 Automatically generates decorative foliage<br>
@@ -362,7 +362,7 @@ You can also specify any custom size of the map. Be aware that Giants Editor sup
362
362
  This setting can be useful if you want add some scaling to your map. For example, you can select a region of 3000 meters in real world and set the output size to 2048 meters. In this case, the map will be generated with a size of 2048x2048 meters, but it will contain the region of 3000x3000 meters in real world.
363
363
 
364
364
  ### DTM Provider
365
- DTM Provider is a source of the height map data. will find the list of available providers in the [DTM Providers](#dtm-providers) section. The default provider is `SRTM30Provider` which is available all aroung the globe, but the resolution is not very high. If you want to use a different provider, you can select it in the dropdown list. You will only see the providers that are available for the selected region. It's better to use the provider that has the highest resolution for the selected region.
365
+ DTM Provider is a source of the height map data. will find the list of available providers in the [pydtmdl](https://github.com/iwatkot/pydtmdl) repository. The default provider is `SRTM30Provider` which is available all aroung the globe, but the resolution is not very high. If you want to use a different provider, you can select it in the dropdown list. You will only see the providers that are available for the selected region. It's better to use the provider that has the highest resolution for the selected region.
366
366
  **NOTE:** Some of the providers are community-developed and may not work properly. I do not provide any support for them. If you have any issues with them, please contact the provider's author.
367
367
 
368
368
  ### Map Rotation
@@ -711,45 +711,6 @@ To create a basic map, you only need the Giants Editor. But if you want to creat
711
711
  ➡️ Please, before creating an issue or asking some questions, check the [FAQ](docs/FAQ.md) section.<br>
712
712
  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) or on Discord: `iwatkot`.
713
713
 
714
- ## DTM Providers
715
-
716
- The generator supports adding the own DTM providers, please refer to the [DTM Providers](docs/dtm_providers.md) section to learn how to add the custom DTM provider.
717
-
718
- ### Supported DTM providers
719
-
720
- ![coverage map](https://github.com/user-attachments/assets/be5c5ce1-7318-4352-97eb-efba7ec587cd)
721
-
722
- In addition to SRTM 30m, which provides global coverage, the map above highlights all countries and/or regions where higher resolution coverage is provided by one of the DTM providers.
723
-
724
- | Provider Name | Resolution | Developer |
725
- | ---------------------------------- | ------------ | ------------------------------------------- |
726
- | 🌎 SRTM30 | 30 meters | [iwatkot](https://github.com/iwatkot) |
727
- | 🌎 ArcticDEM | 2 meters | [kbrandwijk](https://github.com/kbrandwijk) |
728
- | 🌎 REMA Antarctica | 2 meters | [kbrandwijk](https://github.com/kbrandwijk) |
729
- | 🇺🇸 USGS | 1-90 meters | [ZenJakey](https://github.com/ZenJakey) |
730
- | 🏴󠁧󠁢󠁥󠁮󠁧󠁿 England | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
731
- | 🏴󠁧󠁢󠁳󠁣󠁴󠁿 Scotland | 0.25-1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
732
- | 🇩🇪 Hessen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
733
- | 🇩🇪 Niedersachsen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
734
- | 🇩🇪 Bayern, Germany | 1 meter | [H4rdB4se](https://github.com/H4rdB4se) |
735
- | 🇩🇪 Nordrhein-Westfalen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
736
- | 🇩🇪 Mecklenburg-Vorpommern, Germany | 1-25 meter | [kbrandwijk](https://github.com/kbrandwijk) |
737
- | 🇩🇪 Baden-Württemberg, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
738
- | 🇩🇪 Sachsen-Anhalt, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
739
- | 🇩🇪 Thüringen, Germany | 1 meter | [H4rdB4se](https://github.com/H4rdB4se) |
740
- | 🇨🇦 Canada | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
741
- | 🇧🇪 Flanders, Belgium | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
742
- | 🇫🇷 France | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
743
- | 🇮🇹 Italy | 10 meter | [kbrandwijk](https://github.com/kbrandwijk) |
744
- | 🇳🇴 Norway | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
745
- | 🇪🇸 Spain | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
746
- | 🇫🇮 Finland | 2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
747
- | 🇩🇰 Denmark | 0.4 meter | [kbrandwijk](https://github.com/kbrandwijk) |
748
- | 🇨🇭 Switzerland | 0.5-2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
749
- | 🇨🇿 Czech Republic | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
750
- | 🇱🇹 Lithuania | 1 meter | [Tox3](https://github.com/Tox3) |
751
-
752
-
753
714
  ## Special thanks
754
715
 
755
716
  Of course, first of all, thanks to the direct [contributors](https://github.com/iwatkot/maps4fs/graphs/contributors) of the project.
@@ -35,7 +35,6 @@
35
35
  <a href="#Resources">Resources</a> •
36
36
  <a href="#Bugs-and-feature-requests">Bugs and feature requests</a><br>
37
37
  <a href="docs/procedural_generation.md">Procedural Generation</a> •
38
- <a href="#DTM-Providers">DTM Providers</a> •
39
38
  <a href="#Special-thanks">Special thanks</a>
40
39
  </p>
41
40
 
@@ -57,7 +56,7 @@
57
56
  🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi) 🆕<br>
58
57
  ✂️ Supports map scaling<br>
59
58
  🔄 Support map rotation<br>
60
- 🌐 Supports custom [DTM Providers](#DTM-Providers)<br>
59
+ 🌐 Supports custom [DTM Providers](https://github.com/iwatkot/pydtmdl)<br>
61
60
  🌾 Automatically generates fields<br>
62
61
  🌽 Automatically generates farmlands<br>
63
62
  🌿 Automatically generates decorative foliage<br>
@@ -332,7 +331,7 @@ You can also specify any custom size of the map. Be aware that Giants Editor sup
332
331
  This setting can be useful if you want add some scaling to your map. For example, you can select a region of 3000 meters in real world and set the output size to 2048 meters. In this case, the map will be generated with a size of 2048x2048 meters, but it will contain the region of 3000x3000 meters in real world.
333
332
 
334
333
  ### DTM Provider
335
- DTM Provider is a source of the height map data. will find the list of available providers in the [DTM Providers](#dtm-providers) section. The default provider is `SRTM30Provider` which is available all aroung the globe, but the resolution is not very high. If you want to use a different provider, you can select it in the dropdown list. You will only see the providers that are available for the selected region. It's better to use the provider that has the highest resolution for the selected region.
334
+ DTM Provider is a source of the height map data. will find the list of available providers in the [pydtmdl](https://github.com/iwatkot/pydtmdl) repository. The default provider is `SRTM30Provider` which is available all aroung the globe, but the resolution is not very high. If you want to use a different provider, you can select it in the dropdown list. You will only see the providers that are available for the selected region. It's better to use the provider that has the highest resolution for the selected region.
336
335
  **NOTE:** Some of the providers are community-developed and may not work properly. I do not provide any support for them. If you have any issues with them, please contact the provider's author.
337
336
 
338
337
  ### Map Rotation
@@ -681,45 +680,6 @@ To create a basic map, you only need the Giants Editor. But if you want to creat
681
680
  ➡️ Please, before creating an issue or asking some questions, check the [FAQ](docs/FAQ.md) section.<br>
682
681
  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) or on Discord: `iwatkot`.
683
682
 
684
- ## DTM Providers
685
-
686
- The generator supports adding the own DTM providers, please refer to the [DTM Providers](docs/dtm_providers.md) section to learn how to add the custom DTM provider.
687
-
688
- ### Supported DTM providers
689
-
690
- ![coverage map](https://github.com/user-attachments/assets/be5c5ce1-7318-4352-97eb-efba7ec587cd)
691
-
692
- In addition to SRTM 30m, which provides global coverage, the map above highlights all countries and/or regions where higher resolution coverage is provided by one of the DTM providers.
693
-
694
- | Provider Name | Resolution | Developer |
695
- | ---------------------------------- | ------------ | ------------------------------------------- |
696
- | 🌎 SRTM30 | 30 meters | [iwatkot](https://github.com/iwatkot) |
697
- | 🌎 ArcticDEM | 2 meters | [kbrandwijk](https://github.com/kbrandwijk) |
698
- | 🌎 REMA Antarctica | 2 meters | [kbrandwijk](https://github.com/kbrandwijk) |
699
- | 🇺🇸 USGS | 1-90 meters | [ZenJakey](https://github.com/ZenJakey) |
700
- | 🏴󠁧󠁢󠁥󠁮󠁧󠁿 England | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
701
- | 🏴󠁧󠁢󠁳󠁣󠁴󠁿 Scotland | 0.25-1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
702
- | 🇩🇪 Hessen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
703
- | 🇩🇪 Niedersachsen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
704
- | 🇩🇪 Bayern, Germany | 1 meter | [H4rdB4se](https://github.com/H4rdB4se) |
705
- | 🇩🇪 Nordrhein-Westfalen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
706
- | 🇩🇪 Mecklenburg-Vorpommern, Germany | 1-25 meter | [kbrandwijk](https://github.com/kbrandwijk) |
707
- | 🇩🇪 Baden-Württemberg, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
708
- | 🇩🇪 Sachsen-Anhalt, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
709
- | 🇩🇪 Thüringen, Germany | 1 meter | [H4rdB4se](https://github.com/H4rdB4se) |
710
- | 🇨🇦 Canada | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
711
- | 🇧🇪 Flanders, Belgium | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
712
- | 🇫🇷 France | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
713
- | 🇮🇹 Italy | 10 meter | [kbrandwijk](https://github.com/kbrandwijk) |
714
- | 🇳🇴 Norway | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
715
- | 🇪🇸 Spain | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
716
- | 🇫🇮 Finland | 2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
717
- | 🇩🇰 Denmark | 0.4 meter | [kbrandwijk](https://github.com/kbrandwijk) |
718
- | 🇨🇭 Switzerland | 0.5-2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
719
- | 🇨🇿 Czech Republic | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
720
- | 🇱🇹 Lithuania | 1 meter | [Tox3](https://github.com/Tox3) |
721
-
722
-
723
683
  ## Special thanks
724
684
 
725
685
  Of course, first of all, thanks to the direct [contributors](https://github.com/iwatkot/maps4fs/graphs/contributors) of the project.
@@ -1,8 +1,9 @@
1
1
  # pylint: disable=missing-module-docstring
2
+ import pydtmdl.providers as dtm
3
+ from pydtmdl import DTMProvider
4
+
2
5
  import maps4fs.generator.component as component
3
- import maps4fs.generator.dtm as dtm
4
6
  import maps4fs.generator.settings as settings
5
- from maps4fs.generator.dtm.dtm import DTMProvider
6
7
  from maps4fs.generator.game import Game
7
8
  from maps4fs.generator.map import Map
8
9
  from maps4fs.logger import Logger
@@ -5,12 +5,12 @@ from typing import Any
5
5
 
6
6
  import cv2
7
7
  import numpy as np
8
+ from pydtmdl import DTMProvider
8
9
 
9
10
  # import rasterio # type: ignore
10
11
  from pympler import asizeof # type: ignore
11
12
 
12
13
  from maps4fs.generator.component.base.component_image import ImageComponent
13
- from maps4fs.generator.dtm.dtm import DTMProvider
14
14
 
15
15
 
16
16
  # pylint: disable=R0903, R0902
@@ -46,7 +46,6 @@ class DEM(ImageComponent):
46
46
  size=self.map_rotated_size,
47
47
  directory=self.temp_dir,
48
48
  logger=self.logger,
49
- map=self.map,
50
49
  )
51
50
 
52
51
  self.info: dict[str, Any] = {}
@@ -159,7 +158,7 @@ class DEM(ImageComponent):
159
158
 
160
159
  self.update_info("original", data)
161
160
 
162
- # Check if the data contains any non zero values, otherwise raise an error.
161
+ # Check if the data contains any non-zero values, otherwise raise an error.
163
162
  if not np.any(data):
164
163
  self.logger.error("DTM provider returned empty data.")
165
164
  raise ValueError("DTM provider returned empty data. Try using different DTM provider.")
@@ -275,7 +274,7 @@ class DEM(ImageComponent):
275
274
  np.ndarray: Multiplied DEM data.
276
275
  """
277
276
  multiplier = self.map.dem_settings.multiplier
278
- if not multiplier != 1:
277
+ if multiplier == 1:
279
278
  return data
280
279
 
281
280
  multiplied_data = data * multiplier
@@ -11,9 +11,10 @@ from xml.etree import ElementTree as ET
11
11
  import osmnx as ox
12
12
  from geopy.geocoders import Nominatim
13
13
  from osmnx._errors import InsufficientResponseError
14
+ from pydtmdl import DTMProvider
15
+ from pydtmdl.base.dtm import DTMProviderSettings
14
16
 
15
17
  from maps4fs.generator.component import Background, Component, Layer, Texture
16
- from maps4fs.generator.dtm.dtm import DTMProvider, DTMProviderSettings
17
18
  from maps4fs.generator.game import FS25, Game
18
19
  from maps4fs.generator.settings import (
19
20
  BackgroundSettings,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maps4fs
3
- Version: 2.0.0
3
+ Version: 2.0.3
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
@@ -26,6 +26,7 @@ Requires-Dist: pygmdl
26
26
  Requires-Dist: owslib
27
27
  Requires-Dist: tqdm
28
28
  Requires-Dist: scipy
29
+ Requires-Dist: pydtmdl
29
30
  Dynamic: license-file
30
31
 
31
32
  ⚠️ Learn more about the 2.0 changes in the [migration guide](docs/migration.md).
@@ -65,7 +66,6 @@ Dynamic: license-file
65
66
  <a href="#Resources">Resources</a> •
66
67
  <a href="#Bugs-and-feature-requests">Bugs and feature requests</a><br>
67
68
  <a href="docs/procedural_generation.md">Procedural Generation</a> •
68
- <a href="#DTM-Providers">DTM Providers</a> •
69
69
  <a href="#Special-thanks">Special thanks</a>
70
70
  </p>
71
71
 
@@ -87,7 +87,7 @@ Dynamic: license-file
87
87
  🔗 Generate maps using an [API](https://github.com/iwatkot/maps4fsapi) 🆕<br>
88
88
  ✂️ Supports map scaling<br>
89
89
  🔄 Support map rotation<br>
90
- 🌐 Supports custom [DTM Providers](#DTM-Providers)<br>
90
+ 🌐 Supports custom [DTM Providers](https://github.com/iwatkot/pydtmdl)<br>
91
91
  🌾 Automatically generates fields<br>
92
92
  🌽 Automatically generates farmlands<br>
93
93
  🌿 Automatically generates decorative foliage<br>
@@ -362,7 +362,7 @@ You can also specify any custom size of the map. Be aware that Giants Editor sup
362
362
  This setting can be useful if you want add some scaling to your map. For example, you can select a region of 3000 meters in real world and set the output size to 2048 meters. In this case, the map will be generated with a size of 2048x2048 meters, but it will contain the region of 3000x3000 meters in real world.
363
363
 
364
364
  ### DTM Provider
365
- DTM Provider is a source of the height map data. will find the list of available providers in the [DTM Providers](#dtm-providers) section. The default provider is `SRTM30Provider` which is available all aroung the globe, but the resolution is not very high. If you want to use a different provider, you can select it in the dropdown list. You will only see the providers that are available for the selected region. It's better to use the provider that has the highest resolution for the selected region.
365
+ DTM Provider is a source of the height map data. will find the list of available providers in the [pydtmdl](https://github.com/iwatkot/pydtmdl) repository. The default provider is `SRTM30Provider` which is available all aroung the globe, but the resolution is not very high. If you want to use a different provider, you can select it in the dropdown list. You will only see the providers that are available for the selected region. It's better to use the provider that has the highest resolution for the selected region.
366
366
  **NOTE:** Some of the providers are community-developed and may not work properly. I do not provide any support for them. If you have any issues with them, please contact the provider's author.
367
367
 
368
368
  ### Map Rotation
@@ -711,45 +711,6 @@ To create a basic map, you only need the Giants Editor. But if you want to creat
711
711
  ➡️ Please, before creating an issue or asking some questions, check the [FAQ](docs/FAQ.md) section.<br>
712
712
  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) or on Discord: `iwatkot`.
713
713
 
714
- ## DTM Providers
715
-
716
- The generator supports adding the own DTM providers, please refer to the [DTM Providers](docs/dtm_providers.md) section to learn how to add the custom DTM provider.
717
-
718
- ### Supported DTM providers
719
-
720
- ![coverage map](https://github.com/user-attachments/assets/be5c5ce1-7318-4352-97eb-efba7ec587cd)
721
-
722
- In addition to SRTM 30m, which provides global coverage, the map above highlights all countries and/or regions where higher resolution coverage is provided by one of the DTM providers.
723
-
724
- | Provider Name | Resolution | Developer |
725
- | ---------------------------------- | ------------ | ------------------------------------------- |
726
- | 🌎 SRTM30 | 30 meters | [iwatkot](https://github.com/iwatkot) |
727
- | 🌎 ArcticDEM | 2 meters | [kbrandwijk](https://github.com/kbrandwijk) |
728
- | 🌎 REMA Antarctica | 2 meters | [kbrandwijk](https://github.com/kbrandwijk) |
729
- | 🇺🇸 USGS | 1-90 meters | [ZenJakey](https://github.com/ZenJakey) |
730
- | 🏴󠁧󠁢󠁥󠁮󠁧󠁿 England | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
731
- | 🏴󠁧󠁢󠁳󠁣󠁴󠁿 Scotland | 0.25-1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
732
- | 🇩🇪 Hessen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
733
- | 🇩🇪 Niedersachsen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
734
- | 🇩🇪 Bayern, Germany | 1 meter | [H4rdB4se](https://github.com/H4rdB4se) |
735
- | 🇩🇪 Nordrhein-Westfalen, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
736
- | 🇩🇪 Mecklenburg-Vorpommern, Germany | 1-25 meter | [kbrandwijk](https://github.com/kbrandwijk) |
737
- | 🇩🇪 Baden-Württemberg, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
738
- | 🇩🇪 Sachsen-Anhalt, Germany | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
739
- | 🇩🇪 Thüringen, Germany | 1 meter | [H4rdB4se](https://github.com/H4rdB4se) |
740
- | 🇨🇦 Canada | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
741
- | 🇧🇪 Flanders, Belgium | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
742
- | 🇫🇷 France | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
743
- | 🇮🇹 Italy | 10 meter | [kbrandwijk](https://github.com/kbrandwijk) |
744
- | 🇳🇴 Norway | 1 meter | [kbrandwijk](https://github.com/kbrandwijk) |
745
- | 🇪🇸 Spain | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
746
- | 🇫🇮 Finland | 2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
747
- | 🇩🇰 Denmark | 0.4 meter | [kbrandwijk](https://github.com/kbrandwijk) |
748
- | 🇨🇭 Switzerland | 0.5-2 meter | [kbrandwijk](https://github.com/kbrandwijk) |
749
- | 🇨🇿 Czech Republic | 5 meter | [kbrandwijk](https://github.com/kbrandwijk) |
750
- | 🇱🇹 Lithuania | 1 meter | [Tox3](https://github.com/Tox3) |
751
-
752
-
753
714
  ## Special thanks
754
715
 
755
716
  Of course, first of all, thanks to the direct [contributors](https://github.com/iwatkot/maps4fs/graphs/contributors) of the project.
@@ -0,0 +1,31 @@
1
+ LICENSE.md
2
+ README.md
3
+ pyproject.toml
4
+ maps4fs/__init__.py
5
+ maps4fs/logger.py
6
+ maps4fs.egg-info/PKG-INFO
7
+ maps4fs.egg-info/SOURCES.txt
8
+ maps4fs.egg-info/dependency_links.txt
9
+ maps4fs.egg-info/requires.txt
10
+ maps4fs.egg-info/top_level.txt
11
+ maps4fs/generator/__init__.py
12
+ maps4fs/generator/game.py
13
+ maps4fs/generator/map.py
14
+ maps4fs/generator/qgis.py
15
+ maps4fs/generator/settings.py
16
+ maps4fs/generator/statistics.py
17
+ maps4fs/generator/component/__init__.py
18
+ maps4fs/generator/component/background.py
19
+ maps4fs/generator/component/config.py
20
+ maps4fs/generator/component/dem.py
21
+ maps4fs/generator/component/grle.py
22
+ maps4fs/generator/component/i3d.py
23
+ maps4fs/generator/component/layer.py
24
+ maps4fs/generator/component/satellite.py
25
+ maps4fs/generator/component/texture.py
26
+ maps4fs/generator/component/base/__init__.py
27
+ maps4fs/generator/component/base/component.py
28
+ maps4fs/generator/component/base/component_image.py
29
+ maps4fs/generator/component/base/component_mesh.py
30
+ maps4fs/generator/component/base/component_xml.py
31
+ tests/test_generator.py
@@ -11,3 +11,4 @@ pygmdl
11
11
  owslib
12
12
  tqdm
13
13
  scipy
14
+ pydtmdl
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maps4fs"
7
- version = "2.0.0"
7
+ version = "2.0.3"
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"}
@@ -30,6 +30,7 @@ dependencies = [
30
30
  "owslib",
31
31
  "tqdm",
32
32
  "scipy",
33
+ "pydtmdl",
33
34
  ]
34
35
 
35
36
  [project.urls]
@@ -1,26 +0,0 @@
1
- # pylint: disable=missing-module-docstring
2
- from maps4fs.generator.dtm.arctic import ArcticProvider
3
- from maps4fs.generator.dtm.baden import BadenWurttembergProvider
4
- from maps4fs.generator.dtm.bavaria import BavariaProvider
5
- from maps4fs.generator.dtm.canada import CanadaProvider
6
- from maps4fs.generator.dtm.czech import CzechProvider
7
- from maps4fs.generator.dtm.denmark import DenmarkProvider
8
- from maps4fs.generator.dtm.england import England1MProvider
9
- from maps4fs.generator.dtm.finland import FinlandProvider
10
- from maps4fs.generator.dtm.flanders import FlandersProvider
11
- from maps4fs.generator.dtm.france import FranceProvider
12
- from maps4fs.generator.dtm.hessen import HessenProvider
13
- from maps4fs.generator.dtm.italy import ItalyProvider
14
- from maps4fs.generator.dtm.lithuania import LithuaniaProvider
15
- from maps4fs.generator.dtm.mv import MecklenburgVorpommernProvider
16
- from maps4fs.generator.dtm.niedersachsen import NiedersachsenProvider
17
- from maps4fs.generator.dtm.norway import NorwayProvider
18
- from maps4fs.generator.dtm.nrw import NRWProvider
19
- from maps4fs.generator.dtm.rema import REMAProvider
20
- from maps4fs.generator.dtm.sachsenanhalt import SachsenAnhaltProvider
21
- from maps4fs.generator.dtm.scotland import ScotlandProvider
22
- from maps4fs.generator.dtm.spain import SpainProvider
23
- from maps4fs.generator.dtm.srtm import SRTM30Provider
24
- from maps4fs.generator.dtm.switzerland import SwitzerlandProvider
25
- from maps4fs.generator.dtm.thuringia import ThuringiaProvider
26
- from maps4fs.generator.dtm.usgs_wcs import USGSWCSProvider
@@ -1,74 +0,0 @@
1
- """This module contains provider of Arctic data."""
2
-
3
- import os
4
-
5
- import requests
6
-
7
- from maps4fs.generator.dtm.dtm import DTMProvider
8
-
9
-
10
- class ArcticProvider(DTMProvider):
11
- """Provider of Arctic data."""
12
-
13
- _code = "arctic"
14
- _name = "ArcticDEM"
15
- _region = "Global"
16
- _icon = "🌍"
17
- _resolution = 2
18
- _author = "[kbrandwijk](https://github.com/kbrandwijk)"
19
- _is_community = True
20
-
21
- _extents = [(83.98823036056658, 50.7492704708152, 179.99698443265999, -180)]
22
-
23
- _instructions = (
24
- "This provider source includes 2 meter DEM data for the entire Arctic region above 50 "
25
- "degrees North. The tiles are very big, around 1 GB each, so downloading and processing "
26
- "them can take a long time."
27
- )
28
-
29
- _url = "https://stac.pgc.umn.edu/api/v1/collections/arcticdem-mosaics-v4.1-2m/items"
30
-
31
- def download_tiles(self):
32
- download_urls = self.get_download_urls()
33
- all_tif_files = self.download_tif_files(download_urls, self.shared_tiff_path)
34
- return all_tif_files
35
-
36
- def __init__(self, *args, **kwargs):
37
- super().__init__(*args, **kwargs)
38
- self.shared_tiff_path = os.path.join(self._tile_directory, "shared")
39
- os.makedirs(self.shared_tiff_path, exist_ok=True)
40
-
41
- def get_download_urls(self) -> list[str]:
42
- """Get download URLs of the GeoTIFF files from the OGC API.
43
-
44
- Returns:
45
- list: List of download URLs.
46
- """
47
- urls = []
48
-
49
- try:
50
- # Make the GET request
51
- north, south, east, west = self.get_bbox()
52
- response = requests.get( # pylint: disable=W3101
53
- self.url, # type: ignore
54
- params={
55
- "bbox": f"{west},{south},{east},{north}",
56
- "limit": "100",
57
- },
58
- timeout=60,
59
- )
60
- self.logger.debug("Getting file locations from ArcticDEM OGC API...")
61
-
62
- # Check if the request was successful (HTTP status code 200)
63
- if response.status_code == 200:
64
- # Parse the JSON response
65
- json_data = response.json()
66
- items = json_data["features"]
67
- for item in items:
68
- urls.append(item["assets"]["dem"]["href"])
69
- else:
70
- self.logger.error("Failed to get data. HTTP Status Code: %s", response.status_code)
71
- except requests.exceptions.RequestException as e:
72
- self.logger.error("Failed to get data. Error: %s", e)
73
- self.logger.debug("Received %s urls", len(urls))
74
- return urls
@@ -1,31 +0,0 @@
1
- """This module contains provider of Baden-Württemberg data."""
2
-
3
- from maps4fs.generator.dtm.base.wcs import WCSProvider
4
- from maps4fs.generator.dtm.dtm import DTMProvider
5
-
6
-
7
- class BadenWurttembergProvider(WCSProvider, DTMProvider):
8
- """Provider of Baden-Württemberg data."""
9
-
10
- _code = "baden"
11
- _name = "Baden-Württemberg"
12
- _region = "DE"
13
- _icon = "🇩🇪"
14
- _resolution = "1"
15
- _author = "[kbrandwijk](https://github.com/kbrandwijk)"
16
- _is_community = True
17
- _instructions = None
18
- _is_base = False
19
- _extents = [(49.79645444804715, 47.52877040346605, 10.54203149250156, 7.444081717803481)]
20
-
21
- _url = "https://owsproxy.lgl-bw.de/owsproxy/wcs/WCS_INSP_BW_Hoehe_Coverage_DGM1"
22
- _wcs_version = "2.0.1"
23
- _source_crs = "EPSG:25832"
24
- _tile_size = 1000
25
-
26
- def get_wcs_parameters(self, tile):
27
- return {
28
- "identifier": ["EL.ElevationGridCoverage"],
29
- "subsets": [("E", str(tile[1]), str(tile[3])), ("N", str(tile[0]), str(tile[2]))],
30
- "format": "image/tiff",
31
- }
@@ -1,80 +0,0 @@
1
- """This module contains the base WCS provider."""
2
-
3
- import os
4
- from abc import abstractmethod
5
-
6
- from owslib.wcs import WebCoverageService
7
- from tqdm import tqdm
8
-
9
- from maps4fs.generator.dtm import utils
10
- from maps4fs.generator.dtm.dtm import DTMProvider
11
-
12
-
13
- # pylint: disable=too-many-locals
14
- class WCSProvider(DTMProvider):
15
- """Generic provider of WCS sources."""
16
-
17
- _is_base = True
18
- _wcs_version = "2.0.1"
19
- _source_crs: str = "EPSG:4326"
20
- _tile_size: float = 0.02
21
-
22
- @abstractmethod
23
- def get_wcs_parameters(self, tile: tuple[float, float, float, float]) -> dict:
24
- """Get the parameters for the WCS request.
25
-
26
- Arguments:
27
- tile (tuple): The tile to download.
28
-
29
- Returns:
30
- dict: The parameters for the WCS request.
31
- """
32
-
33
- def get_wcs_instance_parameters(self) -> dict:
34
- """Get the parameters for the WCS instance.
35
-
36
- Returns:
37
- dict: The parameters for the WCS instance.
38
- """
39
- return {
40
- "url": self._url,
41
- "version": self._wcs_version,
42
- "timeout": 120,
43
- }
44
-
45
- def __init__(self, *args, **kwargs):
46
- super().__init__(*args, **kwargs)
47
- self.shared_tiff_path = os.path.join(self._tile_directory, "shared")
48
- os.makedirs(self.shared_tiff_path, exist_ok=True)
49
-
50
- def download_tiles(self) -> list[str]:
51
- bbox = self.get_bbox()
52
- bbox = utils.transform_bbox(bbox, self._source_crs)
53
- tiles = utils.tile_bbox(bbox, self._tile_size)
54
-
55
- all_tif_files = self.download_all_tiles(tiles)
56
- return all_tif_files
57
-
58
- def download_all_tiles(self, tiles: list[tuple[float, float, float, float]]) -> list[str]:
59
- """Download tiles from the NI provider.
60
-
61
- Arguments:
62
- tiles (list): List of tiles to download.
63
-
64
- Returns:
65
- list: List of paths to the downloaded GeoTIFF files.
66
- """
67
- all_tif_files = []
68
- params = self.get_wcs_instance_parameters()
69
- wcs = WebCoverageService(**params)
70
-
71
- for tile in tqdm(tiles, desc="Downloading tiles", unit="tile"):
72
- file_name = "_".join(map(str, tile)) + ".tif"
73
- file_path = os.path.join(self.shared_tiff_path, file_name)
74
- if not os.path.exists(file_path):
75
- output = wcs.getCoverage(**self.get_wcs_parameters(tile))
76
- with open(file_path, "wb") as f:
77
- f.write(output.read())
78
-
79
- all_tif_files.append(file_path)
80
- return all_tif_files
@@ -1,71 +0,0 @@
1
- """This module contains the base WMS provider."""
2
-
3
- import os
4
- from abc import abstractmethod
5
-
6
- from owslib.wms import WebMapService
7
- from tqdm import tqdm
8
-
9
- from maps4fs.generator.dtm import utils
10
- from maps4fs.generator.dtm.dtm import DTMProvider
11
-
12
-
13
- # pylint: disable=too-many-locals
14
- class WMSProvider(DTMProvider):
15
- """Generic provider of WMS sources."""
16
-
17
- _is_base = True
18
- _wms_version = "1.3.0"
19
- _source_crs: str = "EPSG:4326"
20
- _tile_size: float = 0.02
21
-
22
- @abstractmethod
23
- def get_wms_parameters(self, tile: tuple[float, float, float, float]) -> dict:
24
- """Get the parameters for the WMS request.
25
-
26
- Arguments:
27
- tile (tuple): The tile to download.
28
-
29
- Returns:
30
- dict: The parameters for the WMS request.
31
- """
32
-
33
- def __init__(self, *args, **kwargs):
34
- super().__init__(*args, **kwargs)
35
- self.shared_tiff_path = os.path.join(self._tile_directory, "shared")
36
- os.makedirs(self.shared_tiff_path, exist_ok=True)
37
-
38
- def download_tiles(self) -> list[str]:
39
- bbox = self.get_bbox()
40
- bbox = utils.transform_bbox(bbox, self._source_crs)
41
- tiles = utils.tile_bbox(bbox, self._tile_size)
42
-
43
- all_tif_files = self.download_all_tiles(tiles)
44
- return all_tif_files
45
-
46
- def download_all_tiles(self, tiles: list[tuple[float, float, float, float]]) -> list[str]:
47
- """Download tiles from the WMS provider.
48
-
49
- Arguments:
50
- tiles (list): List of tiles to download.
51
-
52
- Returns:
53
- list: List of paths to the downloaded GeoTIFF files.
54
- """
55
- all_tif_files = []
56
- wms = WebMapService(
57
- self._url,
58
- version=self._wms_version,
59
- # auth=Authentication(verify=False),
60
- timeout=600,
61
- )
62
- for tile in tqdm(tiles, desc="Downloading tiles", unit="tile"):
63
- file_name = "_".join(map(str, tile)) + ".tif"
64
- file_path = os.path.join(self.shared_tiff_path, file_name)
65
- if not os.path.exists(file_path):
66
- output = wms.getmap(**self.get_wms_parameters(tile))
67
- with open(file_path, "wb") as f:
68
- f.write(output.read())
69
-
70
- all_tif_files.append(file_path)
71
- return all_tif_files