diff --git a/maps4fs/generator/dem.py b/maps4fs/generator/dem.py index df3302ff..773c3226 100644 --- a/maps4fs/generator/dem.py +++ b/maps4fs/generator/dem.py @@ -125,6 +125,13 @@ def process(self) -> None: "Gaussion blur applied to DEM data with kernel size %s.", self.blur_radius, ) + self.logger.debug( + "DEM data was blurred. Shape: %s, dtype: %s. Min: %s, max: %s.", + resampled_data.shape, + resampled_data.dtype, + resampled_data.min(), + resampled_data.max(), + ) cv2.imwrite(self._dem_path, resampled_data) self.logger.debug("DEM data was saved to %s.", self._dem_path) @@ -244,13 +251,28 @@ def colored_preview(self) -> str: self.logger.debug("Creating colored preview of DEM data in %s.", colored_dem_path) - dem_data = cv2.imread(self._dem_path, cv2.IMREAD_GRAYSCALE) + dem_data = cv2.imread(self._dem_path, cv2.IMREAD_UNCHANGED) + + self.logger.debug( + "DEM data before normalization. Shape: %s, dtype: %s. Min: %s, max: %s.", + dem_data.shape, + dem_data.dtype, + dem_data.min(), + dem_data.max(), + ) - # Create an empty array with the same shape and type as dem_data + # Create an empty array with the same shape and type as dem_data. dem_data_normalized = np.empty_like(dem_data) # Normalize the DEM data to the range [0, 255] cv2.normalize(dem_data, dem_data_normalized, 0, 255, cv2.NORM_MINMAX) + self.logger.debug( + "DEM data after normalization. Shape: %s, dtype: %s. Min: %s, max: %s.", + dem_data_normalized.shape, + dem_data_normalized.dtype, + dem_data_normalized.min(), + dem_data_normalized.max(), + ) dem_data_colored = cv2.applyColorMap(dem_data_normalized, cv2.COLORMAP_JET) cv2.imwrite(colored_dem_path, dem_data_colored) diff --git a/pyproject.toml b/pyproject.toml index 0248fd97..fcb77219 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "maps4fs" -version = "0.7.6" +version = "0.7.7" description = "Generate map templates for Farming Simulator from real places." authors = [{name = "iwatkot", email = "iwatkot@gmail.com"}] license = {text = "MIT License"} diff --git a/webui/webui.py b/webui/webui.py index 3682e057..796d8312 100644 --- a/webui/webui.py +++ b/webui/webui.py @@ -42,7 +42,7 @@ def add_widgets(self) -> None: st.write("Enter latitude and longitude of the center point of the map:") self.lat_lon_input = st.text_input( "Latitude and Longitude", - "45.26, 19.80", + "45.28571409289627, 20.237433441210115", key="lat_lon", label_visibility="collapsed", )