Skip to content

Commit

Permalink
Removed float multiplier
Browse files Browse the repository at this point in the history
* Removed float multiplier.

* Version update.
  • Loading branch information
iwatkot authored Dec 8, 2024
1 parent 42bb0b4 commit d14eeae
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
8 changes: 5 additions & 3 deletions maps4fs/generator/dem.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from maps4fs.generator.component import Component

SRTM = "https://elevation-tiles-prod.s3.amazonaws.com/skadi/{latitude_band}/{tile_name}.hgt.gz"
DEFAULT_MULTIPLIER = 1.0
DEFAULT_MULTIPLIER = 1
DEFAULT_BLUR_RADIUS = 35
DEFAULT_PLATEAU = 0

Expand Down Expand Up @@ -146,9 +146,10 @@ def process(self) -> None:
self.logger.debug("Size of resampled data: %s MB.", size_of_resampled_data)

self.logger.debug(
"Maximum value in resampled data: %s, minimum value: %s.",
"Maximum value in resampled data: %s, minimum value: %s. Data type: %s.",
resampled_data.max(),
resampled_data.min(),
resampled_data.dtype,
)

if self.auto_process:
Expand All @@ -159,10 +160,11 @@ def process(self) -> None:
resampled_data = resampled_data * self.multiplier

self.logger.debug(
"DEM data was multiplied by %s. Min: %s, max: %s.",
"DEM data was multiplied by %s. Min: %s, max: %s. Data type: %s.",
self.multiplier,
resampled_data.min(),
resampled_data.max(),
resampled_data.dtype,
)

size_of_resampled_data = asizeof.asizeof(resampled_data) / 1024 / 1024
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "maps4fs"
version = "0.9.92"
version = "0.9.93"
description = "Generate map templates for Farming Simulator from real places."
authors = [{name = "iwatkot", email = "iwatkot@gmail.com"}]
license = {text = "MIT License"}
Expand Down
6 changes: 3 additions & 3 deletions webui/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ def add_left_widgets(self) -> None:
self.multiplier_input = st.number_input(
"Multiplier",
value=DEFAULT_MULTIPLIER,
min_value=0.0,
max_value=10000.0,
step=0.01,
min_value=0,
max_value=10000,
step=1,
key="multiplier",
label_visibility="collapsed",
)
Expand Down
1 change: 0 additions & 1 deletion webui/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class Messages:
"This multiplier can be used to make the terrain more pronounced. "
"By default the DEM file will be exact copy of the real terrain. "
"If you want to make it more steep, you can increase this value. "
"Or make it smaller to make the terrain more flat."
)
DEM_BLUR_RADIUS_INFO = (
"This value is used to blur the elevation map. Without blurring the terrain "
Expand Down

0 comments on commit d14eeae

Please sign in to comment.