[Git][debian-gis-team/saga][upstream] New upstream version 9.7.1+dfsg
Bas Couwenberg (@sebastic)
gitlab at salsa.debian.org
Thu Jan 9 11:40:18 GMT 2025
Bas Couwenberg pushed to branch upstream at Debian GIS Project / saga
Commits:
1c08cee4 by Bas Couwenberg at 2025-01-09T12:29:03+01:00
New upstream version 9.7.1+dfsg
- - - - -
28 changed files:
- saga-gis/src/accessories/helper/doxygen_saga_api_chm
- saga-gis/src/accessories/helper/doxygen_saga_api_html
- saga-gis/src/accessories/helper/make_saga_release.bat
- saga-gis/src/accessories/helper/saga_setup_x64.iss
- saga-gis/src/accessories/python/tools/climate_tools.py
- saga-gis/src/accessories/python/tools/io_grid_image.py
- saga-gis/src/accessories/python/tools/io_webservices.py
- saga-gis/src/accessories/python/tools/ta_lighting.py
- saga-gis/src/saga_core/saga_api/grid_io.cpp
- saga-gis/src/saga_core/saga_api/grids.cpp
- saga-gis/src/saga_core/saga_api/parameter.cpp
- saga-gis/src/saga_core/saga_api/pointcloud.cpp
- saga-gis/src/saga_core/saga_api/saga_api.h
- saga-gis/src/saga_core/saga_api/shapes_io.cpp
- saga-gis/src/saga_core/saga_api/table_io.cpp
- saga-gis/src/saga_core/saga_api/tin.cpp
- saga-gis/src/saga_core/saga_cmd/man/saga_cmd.1
- saga-gis/src/saga_core/saga_gui/man/saga_gui.1
- saga-gis/src/saga_core/saga_gui/wksp_data_menu_file.cpp
- saga-gis/src/saga_core/saga_gui/wksp_grid.cpp
- saga-gis/src/saga_core/saga_gui/wksp_layer.cpp
- saga-gis/src/tools/grid/grid_gridding/Shapes2Grid.cpp
- saga-gis/src/tools/io/io_grid_image/grid_export.cpp
- saga-gis/src/tools/io/io_grid_image/grid_to_kml.cpp
- saga-gis/src/tools/io/io_webservices/global_tiles.cpp
- saga-gis/src/tools/io/io_webservices/global_tiles.h
- saga-gis/src/tools/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp
- saga-gis/version.cmake
Changes:
=====================================
saga-gis/src/accessories/helper/doxygen_saga_api_chm
=====================================
@@ -38,7 +38,7 @@ PROJECT_NAME = "SAGA API"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-#PROJECT_NUMBER = v9.7.0 # omit patch number
+#PROJECT_NUMBER = v9.7.1 # omit patch number
PROJECT_NUMBER = v9.7
# Using the PROJECT_BRIEF tag one can provide an optional one line description
@@ -59,7 +59,7 @@ PROJECT_LOGO = ../../../saga_core/saga_gui/res/saga_icon_64.png
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = saga-9.7.0_api_doc
+OUTPUT_DIRECTORY = saga-9.7.1_api_doc
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
@@ -1372,7 +1372,7 @@ GENERATE_HTMLHELP = YES
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-CHM_FILE = ../../saga-9.7.0_api.chm
+CHM_FILE = ../../saga-9.7.1_api.chm
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler (hhc.exe). If non-empty,
=====================================
saga-gis/src/accessories/helper/doxygen_saga_api_html
=====================================
@@ -38,7 +38,7 @@ PROJECT_NAME = "SAGA API"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-#PROJECT_NUMBER = v9.7.0 # omit patch number
+#PROJECT_NUMBER = v9.7.1 # omit patch number
PROJECT_NUMBER = v9.7
# Using the PROJECT_BRIEF tag one can provide an optional one line description
@@ -59,7 +59,7 @@ PROJECT_LOGO = ../../../saga_core/saga_gui/res/saga_icon_64.png
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.
-OUTPUT_DIRECTORY = saga-9.7.0_api_doc
+OUTPUT_DIRECTORY = saga-9.7.1_api_doc
# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
@@ -1372,7 +1372,7 @@ GENERATE_HTMLHELP = NO
# written to the html output directory.
# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-CHM_FILE = ../../saga-9.7.0_api.chm
+CHM_FILE = ../../saga-9.7.1_api.chm
# The HHC_LOCATION tag can be used to specify the location (absolute path
# including file name) of the HTML help compiler (hhc.exe). If non-empty,
=====================================
saga-gis/src/accessories/helper/make_saga_release.bat
=====================================
@@ -30,15 +30,15 @@ REM ___________________________________
REM Version
SET SAGA_VERSION=9.7
-SET SAGA_RELEASE=9.7.0
-SET SAGA_VERSION_NEXT=9.8
-SET SAGA_RELEASE_NEXT=9.8.0
+SET SAGA_RELEASE=9.7.1
+SET SAGA_VERSION_NEXT=9.7
+SET SAGA_RELEASE_NEXT=9.7.2
SET SAGA_RELEASE_NAME=saga-%SAGA_RELEASE%
REM !!! For all bug-fix-releases !!!
REM Don't forget to activate the variable
REM - SWITCH_TO_BRANCH -
-REM SET SWITCH_TO_BRANCH=saga-%SAGA_VERSION%
+SET SWITCH_TO_BRANCH=saga-%SAGA_VERSION%
REM ___________________________________
=====================================
saga-gis/src/accessories/helper/saga_setup_x64.iss
=====================================
@@ -1,5 +1,5 @@
-; To build installer (for example, saga-9.7.0_setup.exe).
-; - Unzip the SAGA binary files in their own folder (for example, saga-9.7.0.zip).
+; To build installer (for example, saga-9.7.1_setup.exe).
+; - Unzip the SAGA binary files in their own folder (for example, saga-9.7.1.zip).
; - Place saga.iss and saga_readme.rtf in the SAGA folder (contains saga_gui.exe, etc.).
; - Open saga.iss in Inno Setup.
; - Choose Build | Compile.
@@ -7,7 +7,7 @@
[Setup]
AppName=SAGA - System for Automated Geoscientific Analyses
-AppVerName=SAGA 9.7.0
+AppVerName=SAGA 9.7.1
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
@@ -22,9 +22,9 @@ Compression=lzma
SolidCompression=yes
OutputDir=.
-OutputBaseFilename=saga-9.7.0_x64_setup
+OutputBaseFilename=saga-9.7.1_x64_setup
-VersionInfoVersion=9.7.0.0
+VersionInfoVersion=9.7.1.0
VersionInfoCompany=SAGA User Group Association
VersionInfoCopyright=(c) 2005-2023 by O. Conrad
VersionInfoDescription=SAGA single-file installer
@@ -51,5 +51,5 @@ Name: "{commondesktop}\SAGA"; Filename: "{app}\saga_gui.exe"; WorkingDir: "{app}
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\saga_gui.exe"; ValueType: string; ValueName: ""; ValueData: "{app}\saga_gui.exe"; Flags: uninsdeletekey
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\saga_gui.exe"; ValueType: string; ValueName: "Path"; ValueData: "{app}"
-Root: HKLM; Subkey: "SOFTWARE\SAGA User Group Association\SAGA\9.7.0"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletekey
-Root: HKLM; Subkey: "SOFTWARE\SAGA User Group Association\SAGA\9.7.0"; ValueType: string; ValueName: "Version"; ValueData: "9.7.0.0"
+Root: HKLM; Subkey: "SOFTWARE\SAGA User Group Association\SAGA\9.7.1"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletekey
+Root: HKLM; Subkey: "SOFTWARE\SAGA User Group Association\SAGA\9.7.1"; ValueType: string; ValueName: "Version"; ValueData: "9.7.1.0"
=====================================
saga-gis/src/accessories/python/tools/climate_tools.py
=====================================
@@ -617,8 +617,8 @@ def Evapotranspiration_Grid(T=None, T_MIN=None, T_MAX=None, RH=None, SR=None, WS
- SR_EST [`boolean`] : Estimate Solar Radiation. Default: 0 Estimate solar radiation from date, latitudinal position and sunshine duration as percentage of its potential maximum.
- SUNSHINE [`floating point number`] : Sunshine Duration. Minimum: 0.000000 Maximum: 100.000000 Default: 50.000000 Daily sunshine duration as percentage of its potential maximum.
- TIME [`choice`] : Time. Available Choices: [0] day [1] month Default: 0
- - MONTH [`choice`] : Month. Available Choices: [0] January [1] February [2] March [3] April [4] May [5] June [6] July [7] August [8] September [9] October [10] November [11] December Default: 11
- - DAY [`integer number`] : Day of Month. Minimum: 1 Maximum: 31 Default: 17
+ - MONTH [`choice`] : Month. Available Choices: [0] January [1] February [2] March [3] April [4] May [5] June [6] July [7] August [8] September [9] October [10] November [11] December Default: 0
+ - DAY [`integer number`] : Day of Month. Minimum: 1 Maximum: 31 Default: 8
- LAT [`floating point number`] : Latitude. Minimum: -90.000000 Maximum: 90.000000 Default: 53.000000 [Degree]
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
@@ -680,8 +680,8 @@ def run_tool_climate_tools_8(T=None, T_MIN=None, T_MAX=None, RH=None, SR=None, W
- SR_EST [`boolean`] : Estimate Solar Radiation. Default: 0 Estimate solar radiation from date, latitudinal position and sunshine duration as percentage of its potential maximum.
- SUNSHINE [`floating point number`] : Sunshine Duration. Minimum: 0.000000 Maximum: 100.000000 Default: 50.000000 Daily sunshine duration as percentage of its potential maximum.
- TIME [`choice`] : Time. Available Choices: [0] day [1] month Default: 0
- - MONTH [`choice`] : Month. Available Choices: [0] January [1] February [2] March [3] April [4] May [5] June [6] July [7] August [8] September [9] October [10] November [11] December Default: 11
- - DAY [`integer number`] : Day of Month. Minimum: 1 Maximum: 31 Default: 17
+ - MONTH [`choice`] : Month. Available Choices: [0] January [1] February [2] March [3] April [4] May [5] June [6] July [7] August [8] September [9] October [10] November [11] December Default: 0
+ - DAY [`integer number`] : Day of Month. Minimum: 1 Maximum: 31 Default: 8
- LAT [`floating point number`] : Latitude. Minimum: -90.000000 Maximum: 90.000000 Default: 53.000000 [Degree]
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
@@ -728,7 +728,7 @@ def Sunrise_and_Sunset(TARGET=None, SUNRISE=None, SUNSET=None, LENGTH=None, DAY=
- SUNRISE [`output grid`] : Sunrise
- SUNSET [`output grid`] : Sunset
- LENGTH [`output grid`] : Day Length
- - DAY [`date`] : Day of Month. Default: 2024-12-17
+ - DAY [`date`] : Day of Month. Default: 2025-01-09
- TIME [`choice`] : Time. Available Choices: [0] local [1] world Default: 0
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
@@ -759,7 +759,7 @@ def run_tool_climate_tools_9(TARGET=None, SUNRISE=None, SUNSET=None, LENGTH=None
- SUNRISE [`output grid`] : Sunrise
- SUNSET [`output grid`] : Sunset
- LENGTH [`output grid`] : Day Length
- - DAY [`date`] : Day of Month. Default: 2024-12-17
+ - DAY [`date`] : Day of Month. Default: 2025-01-09
- TIME [`choice`] : Time. Available Choices: [0] local [1] world Default: 0
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
@@ -1622,9 +1622,9 @@ def PhenIps_Table(WEATHER=None, PHENOLOGY=None, SUMMARY=None, ATMEAN=None, ATMAX
- DDTOTAL [`floating point number`] : Thermal Sum for Total Development. Minimum: 0.000000 Default: 557.000000 Degree Days
- RISK_DAYMAX [`floating point number`] : Day of Maximum Risk after Onset. Minimum: 0.000000 Default: 5.000000 Days
- RISK_DECAY [`floating point number`] : Decay of Risk after Maximum. Minimum: 1.000000 Default: 10.000000 Days
- - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2024-04-01
- - YD_END_ONSET [`date`] : End of Breeding. Default: 2024-08-31
- - YD_END [`date`] : End of Development. Default: 2024-10-31
+ - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2025-04-01
+ - YD_END_ONSET [`date`] : End of Breeding. Default: 2025-08-31
+ - YD_END [`date`] : End of Development. Default: 2025-10-31
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -1679,9 +1679,9 @@ def run_tool_climate_tools_21(WEATHER=None, PHENOLOGY=None, SUMMARY=None, ATMEAN
- DDTOTAL [`floating point number`] : Thermal Sum for Total Development. Minimum: 0.000000 Default: 557.000000 Degree Days
- RISK_DAYMAX [`floating point number`] : Day of Maximum Risk after Onset. Minimum: 0.000000 Default: 5.000000 Days
- RISK_DECAY [`floating point number`] : Decay of Risk after Maximum. Minimum: 1.000000 Default: 10.000000 Days
- - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2024-04-01
- - YD_END_ONSET [`date`] : End of Breeding. Default: 2024-08-31
- - YD_END [`date`] : End of Development. Default: 2024-10-31
+ - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2025-04-01
+ - YD_END_ONSET [`date`] : End of Breeding. Default: 2025-08-31
+ - YD_END [`date`] : End of Development. Default: 2025-10-31
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -1747,9 +1747,9 @@ def PhenIps_Grids_Annual(ATMEAN=None, ATMAX=None, SIREL=None, LAT_GRID=None, GEN
- DDTOTAL [`floating point number`] : Thermal Sum for Total Development. Minimum: 0.000000 Default: 557.000000 Degree Days
- RISK_DAYMAX [`floating point number`] : Day of Maximum Risk after Onset. Minimum: 0.000000 Default: 5.000000 Days
- RISK_DECAY [`floating point number`] : Decay of Risk after Maximum. Minimum: 1.000000 Default: 10.000000 Days
- - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2024-04-01
- - YD_END_ONSET [`date`] : End of Breeding. Default: 2024-08-31
- - YD_END [`date`] : End of Development. Default: 2024-10-31
+ - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2025-04-01
+ - YD_END_ONSET [`date`] : End of Breeding. Default: 2025-08-31
+ - YD_END [`date`] : End of Development. Default: 2025-10-31
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -1826,9 +1826,9 @@ def run_tool_climate_tools_22(ATMEAN=None, ATMAX=None, SIREL=None, LAT_GRID=None
- DDTOTAL [`floating point number`] : Thermal Sum for Total Development. Minimum: 0.000000 Default: 557.000000 Degree Days
- RISK_DAYMAX [`floating point number`] : Day of Maximum Risk after Onset. Minimum: 0.000000 Default: 5.000000 Days
- RISK_DECAY [`floating point number`] : Decay of Risk after Maximum. Minimum: 1.000000 Default: 10.000000 Days
- - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2024-04-01
- - YD_END_ONSET [`date`] : End of Breeding. Default: 2024-08-31
- - YD_END [`date`] : End of Development. Default: 2024-10-31
+ - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2025-04-01
+ - YD_END_ONSET [`date`] : End of Breeding. Default: 2025-08-31
+ - YD_END [`date`] : End of Development. Default: 2025-10-31
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -1907,11 +1907,11 @@ def PhenIps_Grids_Days(ATMEAN=None, ATMAX=None, SIREL=None, LAT_GRID=None, GENER
- DDTOTAL [`floating point number`] : Thermal Sum for Total Development. Minimum: 0.000000 Default: 557.000000 Degree Days
- RISK_DAYMAX [`floating point number`] : Day of Maximum Risk after Onset. Minimum: 0.000000 Default: 5.000000 Days
- RISK_DECAY [`floating point number`] : Decay of Risk after Maximum. Minimum: 1.000000 Default: 10.000000 Days
- - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2024-04-01
- - YD_END_ONSET [`date`] : End of Breeding. Default: 2024-08-31
- - YD_END [`date`] : End of Development. Default: 2024-10-31
+ - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2025-04-01
+ - YD_END_ONSET [`date`] : End of Breeding. Default: 2025-08-31
+ - YD_END [`date`] : End of Development. Default: 2025-10-31
- RESET [`boolean`] : Reset. Default: 1
- - DAY [`date`] : Start Day. Default: 2024-12-17
+ - DAY [`date`] : Start Day. Default: 2025-01-09
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -1994,11 +1994,11 @@ def run_tool_climate_tools_23(ATMEAN=None, ATMAX=None, SIREL=None, LAT_GRID=None
- DDTOTAL [`floating point number`] : Thermal Sum for Total Development. Minimum: 0.000000 Default: 557.000000 Degree Days
- RISK_DAYMAX [`floating point number`] : Day of Maximum Risk after Onset. Minimum: 0.000000 Default: 5.000000 Days
- RISK_DECAY [`floating point number`] : Decay of Risk after Maximum. Minimum: 1.000000 Default: 10.000000 Days
- - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2024-04-01
- - YD_END_ONSET [`date`] : End of Breeding. Default: 2024-08-31
- - YD_END [`date`] : End of Development. Default: 2024-10-31
+ - YD_BEGIN [`date`] : Begin of Parental Development. Default: 2025-04-01
+ - YD_END_ONSET [`date`] : End of Breeding. Default: 2025-08-31
+ - YD_END [`date`] : End of Development. Default: 2025-10-31
- RESET [`boolean`] : Reset. Default: 1
- - DAY [`date`] : Start Day. Default: 2024-12-17
+ - DAY [`date`] : Start Day. Default: 2025-01-09
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -2066,7 +2066,7 @@ def Soil_Water_Balance_Days(TAVG=None, TMIN=None, TMAX=None, PSUM=None, LAT_GRID
- SWC_SURFACE [`floating point number`] : Top Soil Water Capacity. Minimum: 0.000000 Default: 30.000000
- SWT_RESIST [`floating point number`] : Transpiration Resistance. Minimum: 0.010000 Default: 0.500000
- RESET [`boolean`] : Reset. Default: 1
- - DAY [`date`] : Start Day. Default: 2024-12-17
+ - DAY [`date`] : Start Day. Default: 2025-01-09
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -2115,7 +2115,7 @@ def run_tool_climate_tools_24(TAVG=None, TMIN=None, TMAX=None, PSUM=None, LAT_GR
- SWC_SURFACE [`floating point number`] : Top Soil Water Capacity. Minimum: 0.000000 Default: 30.000000
- SWT_RESIST [`floating point number`] : Transpiration Resistance. Minimum: 0.010000 Default: 0.500000
- RESET [`boolean`] : Reset. Default: 1
- - DAY [`date`] : Start Day. Default: 2024-12-17
+ - DAY [`date`] : Start Day. Default: 2025-01-09
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -2701,8 +2701,8 @@ def Daily_Solar_Radiation(LATITUDE=None, SOLARRAD=None, MONTH=None, DAY=None, SU
----------
- LATITUDE [`input grid`] : Latitude. [Degree]
- SOLARRAD [`output grid`] : Solar Radiation. [J/cm²]
- - MONTH [`choice`] : Month. Available Choices: [0] January [1] February [2] March [3] April [4] May [5] June [6] July [7] August [8] September [9] October [10] November [11] December Default: 11
- - DAY [`integer number`] : Day of Month. Minimum: 1 Maximum: 31 Default: 17
+ - MONTH [`choice`] : Month. Available Choices: [0] January [1] February [2] March [3] April [4] May [5] June [6] July [7] August [8] September [9] October [10] November [11] December Default: 0
+ - DAY [`integer number`] : Day of Month. Minimum: 1 Maximum: 31 Default: 8
- SUNSHINE [`floating point number`] : Sunshine Duration. Minimum: 0.000000 Maximum: 100.000000 Default: 50.000000 Daily sunshine duration as percentage of its potential maximum.
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
@@ -2731,8 +2731,8 @@ def run_tool_climate_tools_31(LATITUDE=None, SOLARRAD=None, MONTH=None, DAY=None
----------
- LATITUDE [`input grid`] : Latitude. [Degree]
- SOLARRAD [`output grid`] : Solar Radiation. [J/cm²]
- - MONTH [`choice`] : Month. Available Choices: [0] January [1] February [2] March [3] April [4] May [5] June [6] July [7] August [8] September [9] October [10] November [11] December Default: 11
- - DAY [`integer number`] : Day of Month. Minimum: 1 Maximum: 31 Default: 17
+ - MONTH [`choice`] : Month. Available Choices: [0] January [1] February [2] March [3] April [4] May [5] June [6] July [7] August [8] September [9] October [10] November [11] December Default: 0
+ - DAY [`integer number`] : Day of Month. Minimum: 1 Maximum: 31 Default: 8
- SUNSHINE [`floating point number`] : Sunshine Duration. Minimum: 0.000000 Maximum: 100.000000 Default: 50.000000 Daily sunshine duration as percentage of its potential maximum.
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
=====================================
saga-gis/src/accessories/python/tools/io_grid_image.py
=====================================
@@ -220,10 +220,10 @@ def Export_Grid_to_KML(GRID=None, SHADE=None, FILE=None, FORMAT=None, COLOURING=
- SHADE [`optional input grid`] : Shade
- FILE [`file path`] : File
- FORMAT [`choice`] : Image Format. Available Choices: [0] Portable Network Graphics [1] JPEG - JFIF Compliant [2] Tagged Image File Format [3] Windows or OS/2 Bitmap [4] Zsoft Paintbrush Default: 1
- - COLOURING [`choice`] : Colouring. Available Choices: [0] stretch to grid's standard deviation [1] stretch to grid's value range [2] stretch to specified value range [3] lookup table [4] rgb coded values Default: 0
- - COL_PALETTE [`choice`] : Color Palette. Available Choices: [0] DEFAULT [1] DEFAULT_BRIGHT [2] BLACK_WHITE [3] BLACK_RED [4] BLACK_GREEN [5] BLACK_BLUE [6] WHITE_RED [7] WHITE_GREEN [8] WHITE_BLUE [9] YELLOW_RED [10] YELLOW_GREEN [11] YELLOW_BLUE [12] RED_GREEN [13] RED_BLUE [14] GREEN_BLUE [15] RED_GREY_BLUE [16] RED_GREY_GREEN [17] GREEN_GREY_BLUE [18] RED_GREEN_BLUE [19] RED_BLUE_GREEN [20] GREEN_RED_BLUE [21] RAINBOW [22] NEON [23] TOPOGRAPHY [24] ASPECT_1 [25] ASPECT_2 [26] ASPECT_3 Default: 0
+ - COLOURING [`choice`] : Colors. Available Choices: [0] stretch to grid's standard deviation [1] stretch to grid's value range [2] stretch to specified value range [3] lookup table [4] rgb coded values Default: 0
+ - COL_PALETTE [`choice`] : Color Ramp. Available Choices: [0] DEFAULT [1] DEFAULT_BRIGHT [2] BLACK_WHITE [3] BLACK_RED [4] BLACK_GREEN [5] BLACK_BLUE [6] WHITE_RED [7] WHITE_GREEN [8] WHITE_BLUE [9] YELLOW_RED [10] YELLOW_GREEN [11] YELLOW_BLUE [12] RED_GREEN [13] RED_BLUE [14] GREEN_BLUE [15] RED_GREY_BLUE [16] RED_GREY_GREEN [17] GREEN_GREY_BLUE [18] RED_GREEN_BLUE [19] RED_BLUE_GREEN [20] GREEN_RED_BLUE [21] RAINBOW [22] NEON [23] TOPOGRAPHY [24] ASPECT_1 [25] ASPECT_2 [26] ASPECT_3 Default: 0
- COL_COUNT [`integer number`] : Number of Colors. Default: 100
- - COL_REVERT [`boolean`] : Revert Palette. Default: 0
+ - COL_REVERT [`boolean`] : Invert Ramp. Default: 0
- STDDEV [`floating point number`] : Standard Deviation. Minimum: 0.000000 Default: 2.000000
- STRETCH [`value range`] : Stretch to Value Range
- LUT [`static table`] : Lookup Table. 5 Fields: - 1. [color] Color - 2. [string] Name - 3. [string] Description - 4. [8 byte floating point number] Minimum - 5. [8 byte floating point number] Maximum
@@ -265,10 +265,10 @@ def run_tool_io_grid_image_2(GRID=None, SHADE=None, FILE=None, FORMAT=None, COLO
- SHADE [`optional input grid`] : Shade
- FILE [`file path`] : File
- FORMAT [`choice`] : Image Format. Available Choices: [0] Portable Network Graphics [1] JPEG - JFIF Compliant [2] Tagged Image File Format [3] Windows or OS/2 Bitmap [4] Zsoft Paintbrush Default: 1
- - COLOURING [`choice`] : Colouring. Available Choices: [0] stretch to grid's standard deviation [1] stretch to grid's value range [2] stretch to specified value range [3] lookup table [4] rgb coded values Default: 0
- - COL_PALETTE [`choice`] : Color Palette. Available Choices: [0] DEFAULT [1] DEFAULT_BRIGHT [2] BLACK_WHITE [3] BLACK_RED [4] BLACK_GREEN [5] BLACK_BLUE [6] WHITE_RED [7] WHITE_GREEN [8] WHITE_BLUE [9] YELLOW_RED [10] YELLOW_GREEN [11] YELLOW_BLUE [12] RED_GREEN [13] RED_BLUE [14] GREEN_BLUE [15] RED_GREY_BLUE [16] RED_GREY_GREEN [17] GREEN_GREY_BLUE [18] RED_GREEN_BLUE [19] RED_BLUE_GREEN [20] GREEN_RED_BLUE [21] RAINBOW [22] NEON [23] TOPOGRAPHY [24] ASPECT_1 [25] ASPECT_2 [26] ASPECT_3 Default: 0
+ - COLOURING [`choice`] : Colors. Available Choices: [0] stretch to grid's standard deviation [1] stretch to grid's value range [2] stretch to specified value range [3] lookup table [4] rgb coded values Default: 0
+ - COL_PALETTE [`choice`] : Color Ramp. Available Choices: [0] DEFAULT [1] DEFAULT_BRIGHT [2] BLACK_WHITE [3] BLACK_RED [4] BLACK_GREEN [5] BLACK_BLUE [6] WHITE_RED [7] WHITE_GREEN [8] WHITE_BLUE [9] YELLOW_RED [10] YELLOW_GREEN [11] YELLOW_BLUE [12] RED_GREEN [13] RED_BLUE [14] GREEN_BLUE [15] RED_GREY_BLUE [16] RED_GREY_GREEN [17] GREEN_GREY_BLUE [18] RED_GREEN_BLUE [19] RED_BLUE_GREEN [20] GREEN_RED_BLUE [21] RAINBOW [22] NEON [23] TOPOGRAPHY [24] ASPECT_1 [25] ASPECT_2 [26] ASPECT_3 Default: 0
- COL_COUNT [`integer number`] : Number of Colors. Default: 100
- - COL_REVERT [`boolean`] : Revert Palette. Default: 0
+ - COL_REVERT [`boolean`] : Invert Ramp. Default: 0
- STDDEV [`floating point number`] : Standard Deviation. Minimum: 0.000000 Default: 2.000000
- STRETCH [`value range`] : Stretch to Value Range
- LUT [`static table`] : Lookup Table. 5 Fields: - 1. [color] Color - 2. [string] Name - 3. [string] Description - 4. [8 byte floating point number] Minimum - 5. [8 byte floating point number] Maximum
=====================================
saga-gis/src/accessories/python/tools/io_webservices.py
=====================================
@@ -182,7 +182,7 @@ def run_tool_io_webservices_1(GRID=None, SHAPES=None, RESULT=None, TILES=None, D
return Tool.Execute(Verbose)
return False
-def Copernicus_DEM(GRID=None, SHAPES=None, RESULT=None, TILES=None, DELARCHIVE=None, EXTENT=None, GRID_SYSTEM=None, XMIN=None, XMAX=None, YMIN=None, YMAX=None, NX=None, NY=None, BUFFER=None, CELLSIZE=None, CRS_STRING=None, Verbose=2):
+def Copernicus_DEM(GRID=None, SHAPES=None, RESULT=None, TILES=None, DELARCHIVE=None, EXTENT=None, GRID_SYSTEM=None, XMIN=None, XMAX=None, YMIN=None, YMAX=None, NX=None, NY=None, BUFFER=None, CELLSIZE=None, CRS_STRING=None, MASK=None, Verbose=2):
'''
Copernicus DEM
----------
@@ -206,6 +206,7 @@ def Copernicus_DEM(GRID=None, SHAPES=None, RESULT=None, TILES=None, DELARCHIVE=N
- BUFFER [`floating point number`] : Buffer. Minimum: 0.000000 Default: 0.000000 add buffer (map units) to extent
- CELLSIZE [`floating point number`] : Cellsize. Minimum: 0.000100 Default: 90.000000
- CRS_STRING [`text`] : Coordinate System Definition. Supported formats comprise PROJ and WKT strings, object codes (e.g. "EPSG:4326").
+ - MASK [`boolean`] : Water Mask. Default: 1 Applies ocean water mask.
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -230,10 +231,11 @@ def Copernicus_DEM(GRID=None, SHAPES=None, RESULT=None, TILES=None, DELARCHIVE=N
Tool.Set_Option('BUFFER', BUFFER)
Tool.Set_Option('CELLSIZE', CELLSIZE)
Tool.Set_Option('CRS_STRING', CRS_STRING)
+ Tool.Set_Option('MASK', MASK)
return Tool.Execute(Verbose)
return False
-def run_tool_io_webservices_3(GRID=None, SHAPES=None, RESULT=None, TILES=None, DELARCHIVE=None, EXTENT=None, GRID_SYSTEM=None, XMIN=None, XMAX=None, YMIN=None, YMAX=None, NX=None, NY=None, BUFFER=None, CELLSIZE=None, CRS_STRING=None, Verbose=2):
+def run_tool_io_webservices_3(GRID=None, SHAPES=None, RESULT=None, TILES=None, DELARCHIVE=None, EXTENT=None, GRID_SYSTEM=None, XMIN=None, XMAX=None, YMIN=None, YMAX=None, NX=None, NY=None, BUFFER=None, CELLSIZE=None, CRS_STRING=None, MASK=None, Verbose=2):
'''
Copernicus DEM
----------
@@ -257,6 +259,7 @@ def run_tool_io_webservices_3(GRID=None, SHAPES=None, RESULT=None, TILES=None, D
- BUFFER [`floating point number`] : Buffer. Minimum: 0.000000 Default: 0.000000 add buffer (map units) to extent
- CELLSIZE [`floating point number`] : Cellsize. Minimum: 0.000100 Default: 90.000000
- CRS_STRING [`text`] : Coordinate System Definition. Supported formats comprise PROJ and WKT strings, object codes (e.g. "EPSG:4326").
+ - MASK [`boolean`] : Water Mask. Default: 1 Applies ocean water mask.
- Verbose [`integer number`] : Verbosity level, 0=silent, 1=tool name and success notification, 2=complete tool output.\n
Returns
@@ -281,6 +284,7 @@ def run_tool_io_webservices_3(GRID=None, SHAPES=None, RESULT=None, TILES=None, D
Tool.Set_Option('BUFFER', BUFFER)
Tool.Set_Option('CELLSIZE', CELLSIZE)
Tool.Set_Option('CRS_STRING', CRS_STRING)
+ Tool.Set_Option('MASK', MASK)
return Tool.Execute(Verbose)
return False
=====================================
saga-gis/src/accessories/python/tools/ta_lighting.py
=====================================
@@ -28,7 +28,7 @@ def Analytical_Hillshading(ELEVATION=None, SHADE=None, METHOD=None, POSITION=Non
- POSITION [`choice`] : Sun's Position. Available Choices: [0] azimuth and height [1] date and time Default: 0
- AZIMUTH [`floating point number`] : Azimuth. Minimum: 0.000000 Maximum: 360.000000 Default: 315.000000 Direction of the light source, measured in degree clockwise from the North direction.
- DECLINATION [`floating point number`] : Height. Minimum: 0.000000 Maximum: 90.000000 Default: 45.000000 Height of the light source, measured in degree above the horizon.
- - DATE [`date`] : Day. Default: 2024-12-17
+ - DATE [`date`] : Day. Default: 2025-01-09
- TIME [`floating point number`] : Hour. Minimum: 0.000000 Maximum: 24.000000 Default: 12.000000
- EXAGGERATION [`floating point number`] : Exaggeration. Default: 1.000000 The terrain exaggeration factor allows one to increase the shading contrasts in flat areas.
- UNIT [`choice`] : Unit. Available Choices: [0] radians [1] degree Default: 0
@@ -73,7 +73,7 @@ def run_tool_ta_lighting_0(ELEVATION=None, SHADE=None, METHOD=None, POSITION=Non
- POSITION [`choice`] : Sun's Position. Available Choices: [0] azimuth and height [1] date and time Default: 0
- AZIMUTH [`floating point number`] : Azimuth. Minimum: 0.000000 Maximum: 360.000000 Default: 315.000000 Direction of the light source, measured in degree clockwise from the North direction.
- DECLINATION [`floating point number`] : Height. Minimum: 0.000000 Maximum: 90.000000 Default: 45.000000 Height of the light source, measured in degree above the horizon.
- - DATE [`date`] : Day. Default: 2024-12-17
+ - DATE [`date`] : Day. Default: 2025-01-09
- TIME [`floating point number`] : Hour. Minimum: 0.000000 Maximum: 24.000000 Default: 12.000000
- EXAGGERATION [`floating point number`] : Exaggeration. Default: 1.000000 The terrain exaggeration factor allows one to increase the shading contrasts in flat areas.
- UNIT [`choice`] : Unit. Available Choices: [0] radians [1] degree Default: 0
@@ -134,8 +134,8 @@ def Potential_Incoming_Solar_Radiation(GRD_DEM=None, GRD_SVF=None, GRD_VAPOUR=No
- LOCATION [`choice`] : Location. Available Choices: [0] constant latitude [1] calculate from grid system Default: 0
- LATITUDE [`degree`] : Latitude. Minimum: -90.000000 Maximum: 90.000000 Default: 53.000000
- PERIOD [`choice`] : Time Period. Available Choices: [0] moment [1] day [2] range of days Default: 1 Momentum output will be in units of power [W/m²], time span will be in units of energy, either [kWh/m²], [kJ/m²], or [J/cm²].
- - DAY [`date`] : Day. Default: 2024-12-17
- - DAY_STOP [`date`] : Last Day. Default: 2024-12-17
+ - DAY [`date`] : Day. Default: 2025-01-09
+ - DAY_STOP [`date`] : Last Day. Default: 2025-01-09
- DAYS_STEP [`integer number`] : Resolution [d]. Minimum: 1 Default: 5 Time step size for a range of days calculation given in days.
- MOMENT [`floating point number`] : Moment [h]. Minimum: 0.000000 Maximum: 24.000000 Default: 12.000000
- HOUR_RANGE [`value range`] : Time Span [h]. Time span used for the calculation of daily radiation sums.
@@ -220,8 +220,8 @@ def run_tool_ta_lighting_2(GRD_DEM=None, GRD_SVF=None, GRD_VAPOUR=None, GRD_LINK
- LOCATION [`choice`] : Location. Available Choices: [0] constant latitude [1] calculate from grid system Default: 0
- LATITUDE [`degree`] : Latitude. Minimum: -90.000000 Maximum: 90.000000 Default: 53.000000
- PERIOD [`choice`] : Time Period. Available Choices: [0] moment [1] day [2] range of days Default: 1 Momentum output will be in units of power [W/m²], time span will be in units of energy, either [kWh/m²], [kJ/m²], or [J/cm²].
- - DAY [`date`] : Day. Default: 2024-12-17
- - DAY_STOP [`date`] : Last Day. Default: 2024-12-17
+ - DAY [`date`] : Day. Default: 2025-01-09
+ - DAY_STOP [`date`] : Last Day. Default: 2025-01-09
- DAYS_STEP [`integer number`] : Resolution [d]. Minimum: 1 Default: 5 Time step size for a range of days calculation given in days.
- MOMENT [`floating point number`] : Moment [h]. Minimum: 0.000000 Maximum: 24.000000 Default: 12.000000
- HOUR_RANGE [`value range`] : Time Span [h]. Time span used for the calculation of daily radiation sums.
=====================================
saga-gis/src/saga_core/saga_api/grid_io.cpp
=====================================
@@ -79,15 +79,15 @@ bool CSG_Grid::On_Reload(void)
//---------------------------------------------------------
bool CSG_Grid::On_Delete(void)
{
- CSG_String FileName = Get_File_Name(true);
+ CSG_String File = Get_File_Name(true);
- SG_File_Set_Extension(FileName, "sg-grd-z"); SG_File_Delete(FileName);
- SG_File_Set_Extension(FileName, "sg-grd" ); SG_File_Delete(FileName);
- SG_File_Set_Extension(FileName, "sgrd" ); SG_File_Delete(FileName);
- SG_File_Set_Extension(FileName, "sdat" ); SG_File_Delete(FileName); SG_File_Delete(FileName + ".aux.xml");
- SG_File_Set_Extension(FileName, "mgrd" ); SG_File_Delete(FileName);
- SG_File_Set_Extension(FileName, "dgm" ); SG_File_Delete(FileName);
- SG_File_Set_Extension(FileName, "dat" ); SG_File_Delete(FileName);
+ SG_File_Set_Extension(File, "sg-grd-z"); SG_File_Delete(File);
+ SG_File_Set_Extension(File, "sg-grd" ); SG_File_Delete(File);
+ SG_File_Set_Extension(File, "sgrd" ); SG_File_Delete(File);
+ SG_File_Set_Extension(File, "sdat" ); SG_File_Delete(File); SG_File_Delete(File + ".aux.xml");
+ SG_File_Set_Extension(File, "mgrd" ); SG_File_Delete(File);
+ SG_File_Set_Extension(File, "dgm" ); SG_File_Delete(File);
+ SG_File_Set_Extension(File, "dat" ); SG_File_Delete(File);
return( true );
}
@@ -144,39 +144,44 @@ CSG_String SG_Grid_Get_File_Extension_Default (void)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grid::Save(const CSG_String &FileName, int Format)
+bool CSG_Grid::Save(const CSG_String &File, int Format)
{
- SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("grid"), FileName.c_str()), true);
+ if( File.is_Empty() )
+ {
+ return( *Get_File_Name(false) ? Save(Get_File_Name(false), Format) : false );
+ }
+
+ SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("grid"), File.c_str()), true);
//-----------------------------------------------------
if( Format == GRID_FILE_FORMAT_Undefined )
{
- Format = gSG_Grid_File_Format_Default;
+ Format = gSG_Grid_File_Format_Default;
- if( SG_File_Cmp_Extension(FileName, "sg-grd-z") ) Format = GRID_FILE_FORMAT_Compressed;
- if( SG_File_Cmp_Extension(FileName, "sg-grd" ) ) Format = GRID_FILE_FORMAT_Binary ;
- if( SG_File_Cmp_Extension(FileName, "sgrd" ) ) Format = GRID_FILE_FORMAT_Binary_old;
- if( SG_File_Cmp_Extension(FileName, "tif" ) ) Format = GRID_FILE_FORMAT_GeoTIFF ;
+ if( SG_File_Cmp_Extension(File, "sg-grd-z") ) Format = GRID_FILE_FORMAT_Compressed;
+ if( SG_File_Cmp_Extension(File, "sg-grd" ) ) Format = GRID_FILE_FORMAT_Binary ;
+ if( SG_File_Cmp_Extension(File, "sgrd" ) ) Format = GRID_FILE_FORMAT_Binary_old;
+ if( SG_File_Cmp_Extension(File, "tif" ) ) Format = GRID_FILE_FORMAT_GeoTIFF ;
}
//-----------------------------------------------------
- bool bResult = false;
+ bool bResult = false;
switch( Format )
{
default:
- bResult = _Save_Native(FileName, (TSG_Grid_File_Format)Format);
+ bResult = _Save_Native(File, (TSG_Grid_File_Format)Format);
break;
case GRID_FILE_FORMAT_Compressed:
- bResult = _Save_Compressed(FileName);
+ bResult = _Save_Compressed(File);
break;
case GRID_FILE_FORMAT_GeoTIFF:
SG_UI_Msg_Lock(true);
SG_RUN_TOOL(bResult, "io_gdal", 2, // Export GeoTIFF
SG_TOOL_PARAMLIST_ADD("GRIDS" , this)
- && SG_TOOL_PARAMETER_SET("FILE" , FileName)
+ && SG_TOOL_PARAMETER_SET("FILE" , File)
&& SG_TOOL_PARAMETER_SET("OPTIONS" , SG_T("COMPRESS=LZW BIGTIFF=YES")) // enable bigtiff as the 'if needed' default setting is not available for compressed files
);
SG_UI_Msg_Lock(false);
@@ -190,7 +195,7 @@ bool CSG_Grid::Save(const CSG_String &FileName, int Format)
{
Set_Modified(false);
- Set_File_Name(FileName, true);
+ Set_File_Name(File, true);
SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
@@ -210,7 +215,7 @@ bool CSG_Grid::Save(const CSG_String &FileName, int Format)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grid::_Load_External(const CSG_String &FileName, bool bCached, bool bLoadData)
+bool CSG_Grid::_Load_External(const CSG_String &File, bool bCached, bool bLoadData)
{
bool bResult = false; CSG_Data_Manager Manager; CSG_Tool *pTool = NULL;
@@ -219,16 +224,16 @@ bool CSG_Grid::_Load_External(const CSG_String &FileName, bool bCached, bool bLo
//-----------------------------------------------------
// Image Import
- if( (SG_File_Cmp_Extension(FileName, "bmp")
- || SG_File_Cmp_Extension(FileName, "gif")
- || SG_File_Cmp_Extension(FileName, "jpg")
- || SG_File_Cmp_Extension(FileName, "png")
- || SG_File_Cmp_Extension(FileName, "pcx") )
+ if( (SG_File_Cmp_Extension(File, "bmp")
+ || SG_File_Cmp_Extension(File, "gif")
+ || SG_File_Cmp_Extension(File, "jpg")
+ || SG_File_Cmp_Extension(File, "png")
+ || SG_File_Cmp_Extension(File, "pcx") )
&& !bResult && (pTool = SG_Get_Tool_Library_Manager().Create_Tool("io_grid_image", 1)) != NULL )
{
pTool->Settings_Push(&Manager);
- bResult = pTool->Set_Parameter("FILE", FileName) && pTool->Execute();
+ bResult = pTool->Set_Parameter("FILE", File) && pTool->Execute();
SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
}
@@ -240,8 +245,8 @@ bool CSG_Grid::_Load_External(const CSG_String &FileName, bool bCached, bool bLo
{
pTool->Settings_Push(&Manager);
- bResult = pTool->Set_Parameter("FILES" , FileName)
- && pTool->Set_Parameter("MULTIPLE", 0 ) // output as single grid(s)
+ bResult = pTool->Set_Parameter("FILES" , File)
+ && pTool->Set_Parameter("MULTIPLE", 0 ) // output as single grid(s)
&& pTool->Execute();
SG_Get_Tool_Library_Manager().Delete_Tool(pTool);
@@ -259,7 +264,7 @@ bool CSG_Grid::_Load_External(const CSG_String &FileName, bool bCached, bool bLo
return( Create(*pGrid) );
}
- Set_File_Name(FileName, false);
+ Set_File_Name(File, false);
Set_Name (pGrid->Get_Name());
Set_Description (pGrid->Get_Description());
@@ -287,13 +292,13 @@ bool CSG_Grid::_Load_External(const CSG_String &FileName, bool bCached, bool bLo
}
//---------------------------------------------------------
-bool CSG_Grid::_Load_PGSQL(const CSG_String &FileName, bool bCached, bool bLoadData)
+bool CSG_Grid::_Load_PGSQL(const CSG_String &File, bool bCached, bool bLoadData)
{
bool bResult = false;
- if( FileName.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
+ if( File.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
{
- CSG_String s(FileName);
+ CSG_String s(File);
s = s.AfterFirst(':'); CSG_String Host (s.BeforeFirst(':'));
s = s.AfterFirst(':'); CSG_String Port (s.BeforeFirst(':'));
@@ -333,16 +338,16 @@ bool CSG_Grid::_Load_PGSQL(const CSG_String &FileName, bool bCached, bool bLoadD
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grid::_Load_Native(const CSG_String &FileName, bool bCached, bool bLoadData)
+bool CSG_Grid::_Load_Native(const CSG_String &File, bool bCached, bool bLoadData)
{
CSG_Grid_File_Info Info;
- if( !Info.Create(FileName) )
+ if( !Info.Create(File) )
{
return( false );
}
- Set_File_Name(FileName, true);
+ Set_File_Name(File, true);
Set_Name (Info.m_Name);
Set_Description (Info.m_Description);
@@ -350,31 +355,31 @@ bool CSG_Grid::_Load_Native(const CSG_String &FileName, bool bCached, bool bLoad
Set_NoData_Value_Range(Info.m_NoData[0], Info.m_NoData[1]);
- m_System = Info.m_System;
- m_Type = Info.m_Type;
- m_zScale = Info.m_zScale;
- m_zOffset = Info.m_zOffset;
+ m_System = Info.m_System;
+ m_Type = Info.m_Type;
+ m_zScale = Info.m_zScale;
+ m_zOffset = Info.m_zOffset;
- m_nBytes_Value = SG_Data_Type_Get_Size(m_Type);
- m_nBytes_Line = m_Type == SG_DATATYPE_Bit ? 1 + Get_NX() / 8 : Get_NX() * m_nBytes_Value;
+ m_nBytes_Value = SG_Data_Type_Get_Size(m_Type);
+ m_nBytes_Line = m_Type == SG_DATATYPE_Bit ? 1 + Get_NX() / 8 : Get_NX() * m_nBytes_Value;
- Get_Projection().Load(SG_File_Make_Path("", FileName, "prj"));
+ Get_Projection().Load(SG_File_Make_Path("", File, "prj"));
if( !bLoadData )
{
return( _Memory_Create(bCached) );
}
- Load_MetaData(FileName);
+ Load_MetaData(File);
//-----------------------------------------------------
- CSG_File Stream;
+ CSG_File Stream;
if( !SG_Data_Type_is_Numeric(m_Type) ) // ASCII...
{
- if( Stream.Open(Info.m_Data_File , SG_FILE_R, false)
- || Stream.Open(SG_File_Make_Path("", FileName, "dat"), SG_FILE_R, false)
- || Stream.Open(SG_File_Make_Path("", FileName, "sdat"), SG_FILE_R, false) )
+ if( Stream.Open(Info.m_Data_File , SG_FILE_R, false)
+ || Stream.Open(SG_File_Make_Path("", File, "dat"), SG_FILE_R, false)
+ || Stream.Open(SG_File_Make_Path("", File, "sdat"), SG_FILE_R, false) )
{
Stream.Seek(Info.m_Offset);
@@ -387,24 +392,24 @@ bool CSG_Grid::_Load_Native(const CSG_String &FileName, bool bCached, bool bLoad
{
if( bCached || _Cache_Check() )
{
- if( _Cache_Create(Info.m_Data_File , m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip)
- || _Cache_Create(SG_File_Make_Path("", FileName, "dat"), m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip)
- || _Cache_Create(SG_File_Make_Path("", FileName, "sdat"), m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip) )
+ if( _Cache_Create(Info.m_Data_File , m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip)
+ || _Cache_Create(SG_File_Make_Path("", File, "dat"), m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip)
+ || _Cache_Create(SG_File_Make_Path("", File, "sdat"), m_Type, Info.m_Offset, Info.m_bSwapBytes, Info.m_bFlip) )
{
return( true );
}
}
- m_Cache_File = Info.m_Data_File;
- m_Cache_Offset = Info.m_Offset;
- m_Cache_bSwap = Info.m_bSwapBytes;
- m_Cache_bFlip = Info.m_bFlip;
+ m_Cache_File = Info.m_Data_File ;
+ m_Cache_Offset = Info.m_Offset ;
+ m_Cache_bSwap = Info.m_bSwapBytes;
+ m_Cache_bFlip = Info.m_bFlip ;
if( _Memory_Create(bCached) )
{
- if( Stream.Open(Info.m_Data_File , SG_FILE_R, true)
- || Stream.Open(SG_File_Make_Path("", FileName, "dat"), SG_FILE_R, true)
- || Stream.Open(SG_File_Make_Path("", FileName, "sdat"), SG_FILE_R, true) )
+ if( Stream.Open(Info.m_Data_File , SG_FILE_R, true)
+ || Stream.Open(SG_File_Make_Path("", File, "dat"), SG_FILE_R, true)
+ || Stream.Open(SG_File_Make_Path("", File, "sdat"), SG_FILE_R, true) )
{
Stream.Seek(Info.m_Offset);
@@ -417,44 +422,44 @@ bool CSG_Grid::_Load_Native(const CSG_String &FileName, bool bCached, bool bLoad
}
//---------------------------------------------------------
-bool CSG_Grid::_Save_Native(const CSG_String &_FileName, TSG_Grid_File_Format Format)
+bool CSG_Grid::_Save_Native(const CSG_String &_File, TSG_Grid_File_Format Format)
{
#ifdef WORDS_BIGENDIAN
- bool bBigEndian = true;
+ bool bBigEndian = true;
#else
- bool bBigEndian = false;
+ bool bBigEndian = false;
#endif
- CSG_String FileName(_FileName);
+ CSG_String File(_File);
- bool bBinary;
+ bool bBinary;
if( Format == GRID_FILE_FORMAT_ASCII )
{
- bBinary = false;
+ bBinary = false;
}
else if( Format == GRID_FILE_FORMAT_Binary_old )
{
- bBinary = true; SG_File_Set_Extension(FileName, "sgrd");
+ bBinary = true; SG_File_Set_Extension(File, "sgrd");
}
else
{
- bBinary = true; SG_File_Set_Extension(FileName, "sg-grd");
+ bBinary = true; SG_File_Set_Extension(File, "sg-grd");
}
- CSG_Grid_File_Info Info(*this);
+ CSG_Grid_File_Info Info(*this);
- if( Info.Save(FileName, bBinary) )
+ if( Info.Save(File, bBinary) )
{
- CSG_File Stream(SG_File_Make_Path("", FileName, "sdat"), SG_FILE_W, true);
+ CSG_File Stream(SG_File_Make_Path("", File, "sdat"), SG_FILE_W, true);
if( bBinary ? _Save_Binary(Stream, m_Type, false, bBigEndian) : _Save_ASCII (Stream) )
{
- Save_MetaData(FileName);
+ Save_MetaData(File);
- Get_Projection().Save(SG_File_Make_Path("", FileName, "prj"));
+ Get_Projection().Save(SG_File_Make_Path("", File, "prj"));
- Info.Save_AUX_XML(SG_File_Make_Path("", FileName, "sdat"));
+ Info.Save_AUX_XML(SG_File_Make_Path("", File, "sdat"));
return( true );
}
@@ -471,11 +476,11 @@ bool CSG_Grid::_Save_Native(const CSG_String &_FileName, TSG_Grid_File_Format Fo
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grid::_Load_Compressed(const CSG_String &_FileName, bool bCached, bool bLoadData)
+bool CSG_Grid::_Load_Compressed(const CSG_String &_File, bool bCached, bool bLoadData)
{
- Set_File_Name(_FileName, true);
+ Set_File_Name(_File, true);
- CSG_Archive Stream(_FileName, SG_FILE_R);
+ CSG_Archive Stream(_File, SG_FILE_R);
if( !Stream.is_Reading() )
{
@@ -483,25 +488,25 @@ bool CSG_Grid::_Load_Compressed(const CSG_String &_FileName, bool bCached, bool
}
//-----------------------------------------------------
- CSG_String FileName(SG_File_Get_Name(_FileName, false) + ".");
+ CSG_String File(SG_File_Get_Name(_File, false) + ".");
- if( !Stream.Get_File(FileName + "sgrd" )
- && !Stream.Get_File(FileName + "sg-grd") )
+ if( !Stream.Get_File(File + "sgrd" )
+ && !Stream.Get_File(File + "sg-grd") )
{
- FileName.Clear();
+ File.Clear();
for(size_t i=0; i<Stream.Get_File_Count(); i++)
{
if( SG_File_Cmp_Extension(Stream.Get_File_Name(i), "sgrd" )
|| SG_File_Cmp_Extension(Stream.Get_File_Name(i), "sg-grd") )
{
- FileName = SG_File_Get_Name(Stream.Get_File_Name(i), false) + ".";
+ File = SG_File_Get_Name(Stream.Get_File_Name(i), false) + ".";
Stream.Get_File(Stream.Get_File_Name(i));
break;
}
}
- if( FileName.is_Empty() )
+ if( File.is_Empty() )
{
return( false );
}
@@ -521,15 +526,15 @@ bool CSG_Grid::_Load_Compressed(const CSG_String &_FileName, bool bCached, bool
Set_NoData_Value_Range(Info.m_NoData[0], Info.m_NoData[1]);
- m_System = Info.m_System;
- m_Type = Info.m_Type;
- m_zScale = Info.m_zScale;
- m_zOffset = Info.m_zOffset;
+ m_System = Info.m_System;
+ m_Type = Info.m_Type;
+ m_zScale = Info.m_zScale;
+ m_zOffset = Info.m_zOffset;
- m_nBytes_Value = SG_Data_Type_Get_Size(m_Type);
- m_nBytes_Line = m_Type == SG_DATATYPE_Bit ? 1 + Get_NX() / 8 : Get_NX() * m_nBytes_Value;
+ m_nBytes_Value = SG_Data_Type_Get_Size(m_Type);
+ m_nBytes_Line = m_Type == SG_DATATYPE_Bit ? 1 + Get_NX() / 8 : Get_NX() * m_nBytes_Value;
- if( Stream.Get_File(FileName + "prj") )
+ if( Stream.Get_File(File + "prj") )
{
Get_Projection().Load(Stream);
}
@@ -539,7 +544,7 @@ bool CSG_Grid::_Load_Compressed(const CSG_String &_FileName, bool bCached, bool
return( _Memory_Create(bCached) );
}
- if( Stream.Get_File(FileName + "mgrd") )
+ if( Stream.Get_File(File + "mgrd") )
{
Load_MetaData(Stream);
}
@@ -550,13 +555,13 @@ bool CSG_Grid::_Load_Compressed(const CSG_String &_FileName, bool bCached, bool
bCached = true;
}
- return( Stream.Get_File(FileName + "sdat") && _Memory_Create(bCached)
+ return( Stream.Get_File(File + "sdat") && _Memory_Create(bCached)
&& _Load_Binary(Stream, m_Type, Info.m_bFlip, Info.m_bSwapBytes)
);
}
//---------------------------------------------------------
-bool CSG_Grid::_Save_Compressed(const CSG_String &_FileName)
+bool CSG_Grid::_Save_Compressed(const CSG_String &_File)
{
#ifdef WORDS_BIGENDIAN
bool bBigEndian = true;
@@ -564,20 +569,20 @@ bool CSG_Grid::_Save_Compressed(const CSG_String &_FileName)
bool bBigEndian = false;
#endif
- CSG_Archive Stream(_FileName, SG_FILE_W);
+ CSG_Archive Stream(_File, SG_FILE_W);
if( Stream.is_Writing() )
{
- CSG_String FileName(SG_File_Get_Name(_FileName, false) + ".");
+ CSG_String File(SG_File_Get_Name(_File, false) + ".");
CSG_Grid_File_Info Info(*this);
- if( Stream.Add_File(FileName + "sgrd") && Info.Save(Stream, true)
- && Stream.Add_File(FileName + "sdat") && _Save_Binary(Stream, m_Type, false, bBigEndian) )
+ if( Stream.Add_File(File + "sgrd") && Info.Save(Stream, true)
+ && Stream.Add_File(File + "sdat") && _Save_Binary(Stream, m_Type, false, bBigEndian) )
{
- Stream.Add_File(FileName + "mgrd" ); Save_MetaData(Stream);
- Stream.Add_File(FileName + "prj" ); Get_Projection().Save(Stream);
- Stream.Add_File(FileName + "sdat.aux.xml"); Info.Save_AUX_XML(Stream);
+ Stream.Add_File(File + "mgrd" ); Save_MetaData(Stream);
+ Stream.Add_File(File + "prj" ); Get_Projection().Save(Stream);
+ Stream.Add_File(File + "sdat.aux.xml"); Info.Save_AUX_XML(Stream);
return( true );
}
@@ -858,21 +863,21 @@ bool CSG_Grid::_Save_ASCII(CSG_File &Stream, bool bFlip)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grid::_Load_Surfer(const CSG_String &FileName, bool bCached, bool bLoadData)
+bool CSG_Grid::_Load_Surfer(const CSG_String &File, bool bCached, bool bLoadData)
{
- const float NoData = 1.70141e38f;
+ const float NoData = 1.70141e38f;
- if( !SG_File_Cmp_Extension(FileName, "grd") )
+ if( !SG_File_Cmp_Extension(File, "grd") )
{
return( false );
}
- Set_File_Name(FileName, true);
+ Set_File_Name(File, true);
//-----------------------------------------------------
CSG_File Stream;
- if( !Stream.Open(FileName, SG_FILE_R, true) )
+ if( !Stream.Open(File, SG_FILE_R, true) )
{
return( false );
}
@@ -935,17 +940,17 @@ bool CSG_Grid::_Load_Surfer(const CSG_String &FileName, bool bCached, bool bLoad
//-----------------------------------------------------
else if( !strncmp(Identifier, "DSAA", 4) ) // ASCII...
{
- int nx = Stream.Scan_Int ();
- int ny = Stream.Scan_Int ();
- double xMin = Stream.Scan_Double();
- double xMax = Stream.Scan_Double();
- double yMin = Stream.Scan_Double(); Stream.Scan_Double();
- // double yMax = Stream.Scan_Double();
- double dx = Stream.Scan_Double(); Stream.Scan_Double();
- // double dy = Stream.Scan_Double();
-
- dx = (xMax - xMin) / (nx - 1.0);
- // dy = (yMax - yMin) / (ny - 1.0); // we could proof for equal cellsize in direction of y...
+ int nx = Stream.Scan_Int ();
+ int ny = Stream.Scan_Int ();
+ double xMin = Stream.Scan_Double();
+ double xMax = Stream.Scan_Double();
+ double yMin = Stream.Scan_Double(); Stream.Scan_Double();
+ // double yMax = Stream.Scan_Double();
+ double dx = Stream.Scan_Double(); Stream.Scan_Double();
+ // double dy = Stream.Scan_Double();
+
+ dx = (xMax - xMin) / (nx - 1.);
+ // dy = (yMax - yMin) / (ny - 1.); // we could proof for equal cellsize in direction of y...
//-------------------------------------------------
if( !Create(SG_DATATYPE_Float, nx, ny, dx, xMin, yMin, bCached) || Stream.is_EOF() )
@@ -960,7 +965,7 @@ bool CSG_Grid::_Load_Surfer(const CSG_String &FileName, bool bCached, bool bLoad
{
for(int x=0; x<Get_NX(); x++)
{
- double Value;
+ double Value;
if( Stream.Scan(Value) && Value != NoData )
{
@@ -980,8 +985,8 @@ bool CSG_Grid::_Load_Surfer(const CSG_String &FileName, bool bCached, bool bLoad
//-------------------------------------------------
SG_UI_Process_Set_Ready();
- Set_File_Name(FileName);
- Load_MetaData(FileName);
+ Set_File_Name(File);
+ Load_MetaData(File);
return( true );
}
@@ -1051,38 +1056,38 @@ CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_Grid &Grid)
bool CSG_Grid_File_Info::Create(const CSG_Grid &Grid)
{
- m_Name = Grid.Get_Name();
- m_Description = Grid.Get_Description();
- m_Unit = Grid.Get_Unit();
- m_System = Grid.Get_System();
- m_Type = Grid.Get_Type();
- m_zScale = Grid.Get_Scaling();
- m_zOffset = Grid.Get_Offset();
- m_NoData[0] = Grid.Get_NoData_Value();
- m_NoData[1] = Grid.Get_NoData_Value(true);
- m_Data_File .Clear();
- m_bFlip = false;
- m_bSwapBytes = false;
- m_Offset = 0;
- m_Projection = Grid.Get_Projection();
+ m_Name = Grid.Get_Name();
+ m_Description = Grid.Get_Description();
+ m_Unit = Grid.Get_Unit();
+ m_System = Grid.Get_System();
+ m_Type = Grid.Get_Type();
+ m_zScale = Grid.Get_Scaling();
+ m_zOffset = Grid.Get_Offset();
+ m_NoData[0] = Grid.Get_NoData_Value();
+ m_NoData[1] = Grid.Get_NoData_Value(true);
+ m_Data_File .Clear();
+ m_bFlip = false;
+ m_bSwapBytes = false;
+ m_Offset = 0;
+ m_Projection = Grid.Get_Projection();
return( true );
}
//---------------------------------------------------------
-CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_String &FileName)
+CSG_Grid_File_Info::CSG_Grid_File_Info(const CSG_String &File)
{
- Create(FileName);
+ Create(File);
}
-bool CSG_Grid_File_Info::Create(const CSG_String &FileName)
+bool CSG_Grid_File_Info::Create(const CSG_String &File)
{
- if( !SG_File_Cmp_Extension(FileName, "sg-grd-z") )
+ if( !SG_File_Cmp_Extension(File, "sg-grd-z") )
{
- if( SG_File_Cmp_Extension(FileName, "sgrd")
- || SG_File_Cmp_Extension(FileName, "sg-grd") )
+ if( SG_File_Cmp_Extension(File, "sgrd")
+ || SG_File_Cmp_Extension(File, "sg-grd") )
{
- CSG_File Stream(FileName, SG_FILE_R, false);
+ CSG_File Stream(File, SG_FILE_R, false);
return( Create(Stream) );
}
@@ -1091,14 +1096,14 @@ bool CSG_Grid_File_Info::Create(const CSG_String &FileName)
}
//-----------------------------------------------------
- CSG_Archive Stream(FileName, SG_FILE_R);
+ CSG_Archive Stream(File, SG_FILE_R);
if( Stream.is_Reading() )
{
- CSG_String File(SG_File_Get_Name(FileName, false) + ".");
+ CSG_String Archive_File(SG_File_Get_Name(File, false) + ".");
- if( !Stream.Get_File(File + "sgrd" )
- && !Stream.Get_File(File + "sg-grd") )
+ if( !Stream.Get_File(Archive_File + "sgrd" )
+ && !Stream.Get_File(Archive_File + "sg-grd") )
{
for(size_t i=0; i<Stream.Get_File_Count(); i++)
{
@@ -1228,9 +1233,9 @@ int CSG_Grid_File_Info::_Get_Key(CSG_File &Stream, CSG_String &Value)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grid_File_Info::Save(const CSG_String &FileName, bool bBinary)
+bool CSG_Grid_File_Info::Save(const CSG_String &File, bool bBinary)
{
- return( Save(CSG_File(FileName, SG_FILE_W, false), bBinary) );
+ return( Save(CSG_File(File, SG_FILE_W, false), bBinary) );
}
//---------------------------------------------------------
@@ -1267,17 +1272,17 @@ bool CSG_Grid_File_Info::Save(const CSG_File &Stream, bool bBinary)
}
//---------------------------------------------------------
-bool CSG_Grid_File_Info::Save(const CSG_String &FileName, const CSG_Grid &Grid, bool bBinary)
+bool CSG_Grid_File_Info::Save(const CSG_String &File, const CSG_Grid &Grid, bool bBinary)
{
- CSG_Grid_File_Info Info(Grid);
+ CSG_Grid_File_Info Info(Grid);
- return( Info.Save(FileName, bBinary) );
+ return( Info.Save(File, bBinary) );
}
//---------------------------------------------------------
bool CSG_Grid_File_Info::Save(const CSG_File &Stream, const CSG_Grid &Grid, bool bBinary)
{
- CSG_Grid_File_Info Info(Grid);
+ CSG_Grid_File_Info Info(Grid);
return( Info.Save(Stream, bBinary) );
}
@@ -1288,11 +1293,11 @@ bool CSG_Grid_File_Info::Save(const CSG_File &Stream, const CSG_Grid &Grid, bool
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grid_File_Info::Save_AUX_XML(const CSG_String &FileName)
+bool CSG_Grid_File_Info::Save_AUX_XML(const CSG_String &File)
{
- CSG_File Stream;
+ CSG_File Stream;
- return( m_Projection.is_Okay() && Stream.Open(FileName + ".aux.xml", SG_FILE_W, false) && Save_AUX_XML(Stream) );
+ return( m_Projection.is_Okay() && Stream.Open(File + ".aux.xml", SG_FILE_W, false) && Save_AUX_XML(Stream) );
}
//---------------------------------------------------------
=====================================
saga-gis/src/saga_core/saga_api/grids.cpp
=====================================
@@ -182,9 +182,9 @@ CSG_Grids::CSG_Grids(const CSG_Grids *pGrids, bool bCopyData)
* Create a grid collection from file.
*/
//---------------------------------------------------------
-CSG_Grids::CSG_Grids(const char *FileName, bool bLoadData) { _On_Construction(); Create(FileName, bLoadData); }
-CSG_Grids::CSG_Grids(const wchar_t *FileName, bool bLoadData) { _On_Construction(); Create(FileName, bLoadData); }
-CSG_Grids::CSG_Grids(const CSG_String &FileName, bool bLoadData) { _On_Construction(); Create(FileName, bLoadData); }
+CSG_Grids::CSG_Grids(const char *File, bool bLoadData) { _On_Construction(); Create(File, bLoadData); }
+CSG_Grids::CSG_Grids(const wchar_t *File, bool bLoadData) { _On_Construction(); Create(File, bLoadData); }
+CSG_Grids::CSG_Grids(const CSG_String &File, bool bLoadData) { _On_Construction(); Create(File, bLoadData); }
//---------------------------------------------------------
/**
@@ -309,9 +309,9 @@ bool CSG_Grids::Create(const CSG_Grids *pGrids, bool bCopyData)
}
//---------------------------------------------------------
-bool CSG_Grids::Create(const char *FileName, bool bLoadData) { return( Load(CSG_String(FileName), bLoadData) ); }
-bool CSG_Grids::Create(const wchar_t *FileName, bool bLoadData) { return( Load(CSG_String(FileName), bLoadData) ); }
-bool CSG_Grids::Create(const CSG_String &FileName, bool bLoadData) { return( Load( FileName , bLoadData) ); }
+bool CSG_Grids::Create(const char *File, bool bLoadData) { return( Load(CSG_String(File), bLoadData) ); }
+bool CSG_Grids::Create(const wchar_t *File, bool bLoadData) { return( Load(CSG_String(File), bLoadData) ); }
+bool CSG_Grids::Create(const CSG_String &File, bool bLoadData) { return( Load( File , bLoadData) ); }
//---------------------------------------------------------
bool CSG_Grids::Create(const CSG_Grid_System &System, int NZ, double zMin, TSG_Data_Type Type)
@@ -1687,20 +1687,20 @@ bool CSG_Grids::On_Reload(void)
//---------------------------------------------------------
bool CSG_Grids::On_Delete(void)
{
- CSG_String FileName = Get_File_Name(true);
+ CSG_String File = Get_File_Name(true);
- SG_File_Set_Extension(FileName, "sg-gds-z"); SG_File_Delete(FileName);
- SG_File_Set_Extension(FileName, "sg-gds" ); SG_File_Delete(FileName);
- SG_File_Set_Extension(FileName, "sg-info" ); SG_File_Delete(FileName);
- SG_File_Set_Extension(FileName, "sg-prj" ); SG_File_Delete(FileName);
+ SG_File_Set_Extension(File, "sg-gds-z"); SG_File_Delete(File);
+ SG_File_Set_Extension(File, "sg-gds" ); SG_File_Delete(File);
+ SG_File_Set_Extension(File, "sg-info" ); SG_File_Delete(File);
+ SG_File_Set_Extension(File, "sg-prj" ); SG_File_Delete(File);
- int i = 0;
+ int i = 0;
do
{
- SG_File_Set_Extension(FileName, CSG_String::Format("sg-%03d", ++i));
+ SG_File_Set_Extension(File, CSG_String::Format("sg-%03d", ++i));
}
- while( SG_File_Delete(FileName) );
+ while( SG_File_Delete(File) );
return( true );
}
@@ -1711,20 +1711,20 @@ bool CSG_Grids::On_Delete(void)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grids::Load(const CSG_String &FileName, bool bLoadData)
+bool CSG_Grids::Load(const CSG_String &File, bool bLoadData)
{
Destroy();
- SG_UI_Msg_Add(CSG_String::Format("%s: %s...", _TL("Loading grid collection"), FileName.c_str()), true);
+ SG_UI_Msg_Add(CSG_String::Format("%s: %s...", _TL("Loading grid collection"), File.c_str()), true);
- if( _Load_PGSQL (FileName)
- || _Load_Normal (FileName)
- || _Load_Compressed(FileName)
- || _Load_External (FileName) )
+ if( _Load_PGSQL (File)
+ || _Load_Normal (File)
+ || _Load_Compressed(File)
+ || _Load_External (File) )
{
Set_Modified(false);
- Set_Name(SG_File_Get_Name(FileName, false));
+ Set_Name(SG_File_Get_Name(File, false));
SG_UI_Process_Set_Ready();
SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
@@ -1739,35 +1739,40 @@ bool CSG_Grids::Load(const CSG_String &FileName, bool bLoadData)
}
//---------------------------------------------------------
-bool CSG_Grids::Save(const CSG_String &FileName, int Format)
+bool CSG_Grids::Save(const CSG_String &File, int Format)
{
- SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("grid collection"), FileName.c_str()), true);
+ if( File.is_Empty() )
+ {
+ return( *Get_File_Name(false) ? Save(Get_File_Name(false), Format) : false );
+ }
+
+ SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("grid collection"), File.c_str()), true);
if( Format == GRIDS_FILE_FORMAT_Undefined )
{
- Format = GRIDS_FILE_FORMAT_Compressed; // default
+ Format = GRIDS_FILE_FORMAT_Compressed; // default
- if( SG_File_Cmp_Extension(FileName, "sg-gds" ) ) Format = GRIDS_FILE_FORMAT_Normal ;
- if( SG_File_Cmp_Extension(FileName, "sg-gds-z") ) Format = GRIDS_FILE_FORMAT_Compressed;
- if( SG_File_Cmp_Extension(FileName, "tif" ) ) Format = GRIDS_FILE_FORMAT_GeoTIFF ;
+ if( SG_File_Cmp_Extension(File, "sg-gds" ) ) Format = GRIDS_FILE_FORMAT_Normal ;
+ if( SG_File_Cmp_Extension(File, "sg-gds-z") ) Format = GRIDS_FILE_FORMAT_Compressed;
+ if( SG_File_Cmp_Extension(File, "tif" ) ) Format = GRIDS_FILE_FORMAT_GeoTIFF ;
}
- bool bResult = false;
+ bool bResult = false;
switch( Format )
{
case GRIDS_FILE_FORMAT_Normal :
- bResult = _Save_Normal (FileName);
+ bResult = _Save_Normal (File);
break;
case GRIDS_FILE_FORMAT_Compressed: default:
- bResult = _Save_Compressed(FileName);
+ bResult = _Save_Compressed(File);
break;
case GRIDS_FILE_FORMAT_GeoTIFF :
SG_RUN_TOOL(bResult, "io_gdal", 2, // Export GeoTIFF
SG_TOOL_PARAMLIST_ADD("GRIDS", this)
- && SG_TOOL_PARAMETER_SET("FILE" , FileName)
+ && SG_TOOL_PARAMETER_SET("FILE" , File)
);
break;
}
@@ -1779,7 +1784,7 @@ bool CSG_Grids::Save(const CSG_String &FileName, int Format)
{
Set_Modified(false);
- Set_File_Name(FileName, true);
+ Set_File_Name(File, true);
SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
@@ -1797,7 +1802,7 @@ bool CSG_Grids::Save(const CSG_String &FileName, int Format)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grids::_Load_External(const CSG_String &FileName)
+bool CSG_Grids::_Load_External(const CSG_String &File)
{
bool bResult = false; CSG_Data_Manager Manager;
@@ -1806,8 +1811,8 @@ bool CSG_Grids::_Load_External(const CSG_String &FileName)
SG_UI_Msg_Lock(true);
if( pTool && pTool->On_Before_Execution() && pTool->Settings_Push(&Manager)
- && pTool->Set_Parameter("FILES" , FileName)
- && pTool->Set_Parameter("MULTIPLE", 1 ) // output as grid collection
+ && pTool->Set_Parameter("FILES" , File)
+ && pTool->Set_Parameter("MULTIPLE", 1 ) // output as grid collection
&& pTool->Execute()
&& Manager.Grids().Count() && Manager.Grids(0).is_Valid() )
{
@@ -1820,7 +1825,7 @@ bool CSG_Grids::_Load_External(const CSG_String &FileName)
Add_Grid(pGrids->Get_Attributes(i), pGrids->Get_Grid_Ptr(i), true);
}
- Set_File_Name(FileName, false);
+ Set_File_Name(File, false);
Set_Name (pGrids->Get_Name ());
Set_Description (pGrids->Get_Description ());
@@ -1840,13 +1845,13 @@ bool CSG_Grids::_Load_External(const CSG_String &FileName)
}
//---------------------------------------------------------
-bool CSG_Grids::_Load_PGSQL(const CSG_String &FileName)
+bool CSG_Grids::_Load_PGSQL(const CSG_String &File)
{
bool bResult = false;
- if( FileName.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
+ if( File.BeforeFirst(':').Cmp("PGSQL") == 0 ) // database source
{
- CSG_String s(FileName);
+ CSG_String s(File);
s = s.AfterFirst(':'); CSG_String Host (s.BeforeFirst(':'));
s = s.AfterFirst(':'); CSG_String Port (s.BeforeFirst(':'));
@@ -1890,7 +1895,7 @@ bool CSG_Grids::_Load_PGSQL(const CSG_String &FileName)
{
CSG_Grids *pGrids = Manager.Grids(0).asGrids();
- Set_File_Name(FileName);
+ Set_File_Name(File);
Create(pGrids);
@@ -1917,27 +1922,25 @@ bool CSG_Grids::_Load_PGSQL(const CSG_String &FileName)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grids::_Load_Normal(const CSG_String &_FileName)
+bool CSG_Grids::_Load_Normal(const CSG_String &_File)
{
- if( !SG_File_Cmp_Extension(_FileName, "sg-gds") ) // GRIDS_FILETYPE_Normal
+ if( !SG_File_Cmp_Extension(_File, "sg-gds") ) // GRIDS_FILETYPE_Normal
{
return( false );
}
- CSG_String FileName(_FileName);
-
- CSG_File Stream;
+ CSG_String File(_File); CSG_File Stream;
//-----------------------------------------------------
- if( !Stream.Open(FileName, SG_FILE_R, false) || !_Load_Header(Stream) )
+ if( !Stream.Open(File, SG_FILE_R, false) || !_Load_Header(Stream) )
{
return( false );
}
- SG_File_Set_Extension(FileName, "sg-att");
+ SG_File_Set_Extension(File, "sg-att");
if( m_Attributes.Get_Count() <= 0 ) // <<< DEPRECATED
- if( !Stream.Open(FileName, SG_FILE_R, false) || !_Load_Attributes(Stream) )
+ if( !Stream.Open(File, SG_FILE_R, false) || !_Load_Attributes(Stream) )
{
return( false );
}
@@ -1945,42 +1948,40 @@ bool CSG_Grids::_Load_Normal(const CSG_String &_FileName)
//-----------------------------------------------------
for(int i=0; i<Get_NZ() && SG_UI_Process_Set_Progress(i, Get_NZ()); i++)
{
- SG_File_Set_Extension(FileName, CSG_String::Format("sg-%03d", i + 1));
+ SG_File_Set_Extension(File, CSG_String::Format("sg-%03d", i + 1));
- if( !Stream.Open(FileName, SG_FILE_R, true) || !_Load_Data(Stream, m_pGrids[i]) )
+ if( !Stream.Open(File, SG_FILE_R, true) || !_Load_Data(Stream, m_pGrids[i]) )
{
return( false );
}
}
//-----------------------------------------------------
- Set_File_Name(_FileName, true);
+ Set_File_Name(_File, true);
- Load_MetaData(FileName);
+ Load_MetaData(File);
- Get_Projection().Load(SG_File_Make_Path("", FileName, "sg-prj"));
+ Get_Projection().Load(SG_File_Make_Path("", File, "sg-prj"));
return( true );
}
//---------------------------------------------------------
-bool CSG_Grids::_Save_Normal(const CSG_String &_FileName)
+bool CSG_Grids::_Save_Normal(const CSG_String &_File)
{
- CSG_String FileName(_FileName);
-
- CSG_File Stream;
+ CSG_String File(_File); CSG_File Stream;
//-----------------------------------------------------
- SG_File_Set_Extension(FileName, "sg-gds");
+ SG_File_Set_Extension(File, "sg-gds");
- if( !Stream.Open(FileName, SG_FILE_W, false) || !_Save_Header(Stream) )
+ if( !Stream.Open(File, SG_FILE_W, false) || !_Save_Header(Stream) )
{
return( false );
}
- SG_File_Set_Extension(FileName, "sg-att");
+ SG_File_Set_Extension(File, "sg-att");
- if( !Stream.Open(FileName, SG_FILE_W, false) || !_Save_Attributes(Stream) )
+ if( !Stream.Open(File, SG_FILE_W, false) || !_Save_Attributes(Stream) )
{
return( false );
}
@@ -1988,18 +1989,18 @@ bool CSG_Grids::_Save_Normal(const CSG_String &_FileName)
//-----------------------------------------------------
for(int i=0; i<Get_NZ() && SG_UI_Process_Set_Progress(i, Get_NZ()); i++)
{
- SG_File_Set_Extension(FileName, CSG_String::Format("sg-%03d", i + 1));
+ SG_File_Set_Extension(File, CSG_String::Format("sg-%03d", i + 1));
- if( !Stream.Open(FileName, SG_FILE_W, true) || !_Save_Data(Stream, m_pGrids[i]) )
+ if( !Stream.Open(File, SG_FILE_W, true) || !_Save_Data(Stream, m_pGrids[i]) )
{
return( false );
}
}
//-----------------------------------------------------
- Save_MetaData(FileName);
+ Save_MetaData(File);
- Get_Projection().Save(SG_File_Make_Path("", FileName, "sg-prj"));
+ Get_Projection().Save(SG_File_Make_Path("", File, "sg-prj"));
return( true );
}
@@ -2010,25 +2011,25 @@ bool CSG_Grids::_Save_Normal(const CSG_String &_FileName)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Grids::_Load_Compressed(const CSG_String &_FileName)
+bool CSG_Grids::_Load_Compressed(const CSG_String &_File)
{
- if( !SG_File_Cmp_Extension(_FileName, "sg-gds-z") ) // GRIDS_FILETYPE_Compressed
+ if( !SG_File_Cmp_Extension(_File, "sg-gds-z") ) // GRIDS_FILETYPE_Compressed
{
return( false );
}
- CSG_Archive Stream(_FileName, SG_FILE_R);
+ CSG_Archive Stream(_File, SG_FILE_R);
- CSG_String FileName(SG_File_Get_Name(_FileName, false) + ".");
+ CSG_String File(SG_File_Get_Name(_File, false) + ".");
//-----------------------------------------------------
- if( !Stream.Get_File(FileName + "sg-gds") || !_Load_Header(Stream) )
+ if( !Stream.Get_File(File + "sg-gds") || !_Load_Header(Stream) )
{
return( false );
}
if( m_Attributes.Get_Count() <= 0 ) // <<< DEPRECATED
- if( !Stream.Get_File(FileName + "sg-att") || !_Load_Attributes(Stream) )
+ if( !Stream.Get_File(File + "sg-att") || !_Load_Attributes(Stream) )
{
return( false );
}
@@ -2036,21 +2037,21 @@ bool CSG_Grids::_Load_Compressed(const CSG_String &_FileName)
//-----------------------------------------------------
for(int i=0; i<Get_NZ() && SG_UI_Process_Set_Progress(i, Get_NZ()); i++)
{
- if( !Stream.Get_File(FileName + CSG_String::Format("sg-%03d", i + 1)) || !_Load_Data(Stream, m_pGrids[i]) )
+ if( !Stream.Get_File(File + CSG_String::Format("sg-%03d", i + 1)) || !_Load_Data(Stream, m_pGrids[i]) )
{
return( false );
}
}
//-----------------------------------------------------
- Set_File_Name(_FileName, true);
+ Set_File_Name(_File, true);
- if( Stream.Get_File(FileName + "sg-info") )
+ if( Stream.Get_File(File + "sg-info") )
{
Load_MetaData(Stream);
}
- if( Stream.Get_File(FileName + "sg-prj") )
+ if( Stream.Get_File(File + "sg-prj") )
{
Get_Projection().Load(Stream);
}
@@ -2059,19 +2060,19 @@ bool CSG_Grids::_Load_Compressed(const CSG_String &_FileName)
}
//---------------------------------------------------------
-bool CSG_Grids::_Save_Compressed(const CSG_String &_FileName)
+bool CSG_Grids::_Save_Compressed(const CSG_String &_File)
{
- CSG_Archive Stream(_FileName, SG_FILE_W);
+ CSG_Archive Stream(_File, SG_FILE_W);
- CSG_String FileName(SG_File_Get_Name(_FileName, false) + ".");
+ CSG_String File(SG_File_Get_Name(_File, false) + ".");
//-----------------------------------------------------
- if( !Stream.Add_File(FileName + "sg-gds") || !_Save_Header(Stream) )
+ if( !Stream.Add_File(File + "sg-gds") || !_Save_Header(Stream) )
{
return( false );
}
- if( !Stream.Add_File(FileName + "sg-att") || !_Save_Attributes(Stream) )
+ if( !Stream.Add_File(File + "sg-att") || !_Save_Attributes(Stream) )
{
return( false );
}
@@ -2079,19 +2080,19 @@ bool CSG_Grids::_Save_Compressed(const CSG_String &_FileName)
//-----------------------------------------------------
for(int i=0; i<Get_NZ() && SG_UI_Process_Set_Progress(i, Get_NZ()); i++)
{
- if( !Stream.Add_File(FileName + CSG_String::Format("sg-%03d", i + 1)) || !_Save_Data(Stream, m_pGrids[i]) )
+ if( !Stream.Add_File(File + CSG_String::Format("sg-%03d", i + 1)) || !_Save_Data(Stream, m_pGrids[i]) )
{
return( false );
}
}
//-----------------------------------------------------
- if( Stream.Add_File(FileName + "sg-info") )
+ if( Stream.Add_File(File + "sg-info") )
{
Save_MetaData(Stream);
}
- if( Stream.Add_File(FileName + "sg-prj") )
+ if( Stream.Add_File(File + "sg-prj") )
{
Get_Projection().Save(Stream);
}
=====================================
saga-gis/src/saga_core/saga_api/parameter.cpp
=====================================
@@ -1717,7 +1717,7 @@ bool CSG_Parameters_Grid_Target::Set_User_Defined(CSG_Parameters *pParameters, C
double Size = sqrt(r.Get_Area() / pPoints->Get_Count()) / (Scale > 1 ? Scale : 1); // edge length of a square given as average area per point (cell size)
- if( Rounding > 0 )
+ if( Size >= 1. && Rounding > 0 )
{
Size = SG_Get_Rounded_To_SignificantFigures(Size, Rounding);
=====================================
saga-gis/src/saga_core/saga_api/pointcloud.cpp
=====================================
@@ -328,6 +328,11 @@ bool CSG_PointCloud::_Load(const CSG_String &File)
//---------------------------------------------------------
bool CSG_PointCloud::Save(const CSG_String &_File, int Format)
{
+ if( _File.is_Empty() )
+ {
+ return( *Get_File_Name(false) ? Save(Get_File_Name(false), Format) : false );
+ }
+
if( Format == POINTCLOUD_FILE_FORMAT_Undefined )
{
Format = SG_File_Cmp_Extension(_File, "sg-pts-z")
=====================================
saga-gis/src/saga_core/saga_api/saga_api.h
=====================================
@@ -86,8 +86,8 @@
//---------------------------------------------------------
#define SAGA_MAJOR_VERSION 9
#define SAGA_MINOR_VERSION 7
-#define SAGA_RELEASE_NUMBER 0
-#define SAGA_VERSION SG_T("9.7.0")
+#define SAGA_RELEASE_NUMBER 1
+#define SAGA_VERSION SG_T("9.7.1")
///////////////////////////////////////////////////////////
=====================================
saga-gis/src/saga_core/saga_api/shapes_io.cpp
=====================================
@@ -140,6 +140,11 @@ CSG_String SG_Shapes_Get_File_Extension_Default (void)
//---------------------------------------------------------
bool CSG_Shapes::Save(const CSG_String &File, int Format)
{
+ if( File.is_Empty() )
+ {
+ return( *Get_File_Name(false) ? Save(Get_File_Name(false), Format) : false );
+ }
+
if( Format == SHAPE_FILE_FORMAT_Undefined )
{
Format = gSG_Shape_File_Format_Default;
=====================================
saga-gis/src/saga_core/saga_api/table_io.cpp
=====================================
@@ -96,11 +96,11 @@ bool CSG_Table::Set_File_Encoding(int Encoding)
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Table::Load(const CSG_String &FileName, int Format, SG_Char Separator, int Encoding)
+bool CSG_Table::Load(const CSG_String &File, int Format, SG_Char Separator, int Encoding)
{
Set_File_Encoding(Encoding);
- if( !SG_File_Exists(FileName) )
+ if( !SG_File_Exists(File) )
{
return( false );
}
@@ -108,7 +108,7 @@ bool CSG_Table::Load(const CSG_String &FileName, int Format, SG_Char Separator,
//-----------------------------------------------------
if( Format == TABLE_FILETYPE_Undefined )
{
- Format = SG_File_Cmp_Extension(FileName, "dbf") ? TABLE_FILETYPE_DBase : TABLE_FILETYPE_Text;
+ Format = SG_File_Cmp_Extension(File, "dbf") ? TABLE_FILETYPE_DBase : TABLE_FILETYPE_Text;
}
//-----------------------------------------------------
@@ -116,15 +116,15 @@ bool CSG_Table::Load(const CSG_String &FileName, int Format, SG_Char Separator,
switch( Format )
{
- case TABLE_FILETYPE_Text: default: if( !_Load_Text (FileName, true , Separator) ) return( false ); break;
- case TABLE_FILETYPE_Text_NoHeadLine: if( !_Load_Text (FileName, false, Separator) ) return( false ); break;
- case TABLE_FILETYPE_DBase : if( !_Load_DBase(FileName ) ) return( false ); break;
+ case TABLE_FILETYPE_Text: default: if( !_Load_Text (File, true , Separator) ) return( false ); break;
+ case TABLE_FILETYPE_Text_NoHeadLine: if( !_Load_Text (File, false, Separator) ) return( false ); break;
+ case TABLE_FILETYPE_DBase : if( !_Load_DBase(File ) ) return( false ); break;
}
//-----------------------------------------------------
- Set_Name(SG_File_Get_Name(FileName, false));
+ Set_Name(SG_File_Get_Name(File, false));
- Load_MetaData(FileName);
+ Load_MetaData(File);
CSG_MetaData *pFields = Get_MetaData_DB().Get_Child("FIELDS");
@@ -141,22 +141,27 @@ bool CSG_Table::Load(const CSG_String &FileName, int Format, SG_Char Separator,
}
//---------------------------------------------------------
-bool CSG_Table::Save(const CSG_String &FileName, int Format)
+bool CSG_Table::Save(const CSG_String &File, int Format)
{
- return( Save(FileName, Format, '\0', m_Encoding) );
+ return( Save(File, Format, '\0', m_Encoding) );
}
//---------------------------------------------------------
-bool CSG_Table::Save(const CSG_String &FileName, int Format, SG_Char Separator, int Encoding)
+bool CSG_Table::Save(const CSG_String &File, int Format, SG_Char Separator, int Encoding)
{
- SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("table"), FileName.c_str()), true);
+ if( File.is_Empty() )
+ {
+ return( *Get_File_Name(false) ? Save(Get_File_Name(false), Format) : false );
+ }
+
+ SG_UI_Msg_Add(CSG_String::Format("%s %s: %s...", _TL("Saving"), _TL("table"), File.c_str()), true);
Set_File_Encoding(Encoding);
//-----------------------------------------------------
if( Format <= TABLE_FILETYPE_Undefined || Format > TABLE_FILETYPE_DBase )
{
- if( SG_File_Cmp_Extension(FileName, "dbf") )
+ if( SG_File_Cmp_Extension(File, "dbf") )
{
Format = TABLE_FILETYPE_DBase;
}
@@ -166,7 +171,7 @@ bool CSG_Table::Save(const CSG_String &FileName, int Format, SG_Char Separator,
if( Separator == '\0' )
{
- Separator = SG_File_Cmp_Extension(FileName, "csv") ? ',' : '\t'; // comma separated values or tab spaced text
+ Separator = SG_File_Cmp_Extension(File, "csv") ? ',' : '\t'; // comma separated values or tab spaced text
}
}
}
@@ -176,9 +181,9 @@ bool CSG_Table::Save(const CSG_String &FileName, int Format, SG_Char Separator,
switch( Format )
{
- case TABLE_FILETYPE_Text: default: bResult = _Save_Text (FileName, true , Separator); break;
- case TABLE_FILETYPE_Text_NoHeadLine: bResult = _Save_Text (FileName, false, Separator); break;
- case TABLE_FILETYPE_DBase : bResult = _Save_DBase(FileName ); break;
+ case TABLE_FILETYPE_Text: default: bResult = _Save_Text (File, true , Separator); break;
+ case TABLE_FILETYPE_Text_NoHeadLine: bResult = _Save_Text (File, false, Separator); break;
+ case TABLE_FILETYPE_DBase : bResult = _Save_DBase(File ); break;
}
//-----------------------------------------------------
@@ -205,9 +210,9 @@ bool CSG_Table::Save(const CSG_String &FileName, int Format, SG_Char Separator,
Set_File_Type(Format);
- Set_File_Name(FileName, true);
+ Set_File_Name(File, true);
- Save_MetaData(FileName);
+ Save_MetaData(File);
SG_UI_Msg_Add(_TL("okay"), false, SG_UI_MSG_STYLE_SUCCESS);
@@ -283,11 +288,11 @@ size_t CSG_Table::_Load_Text_EndQuote(const CSG_String &s, const SG_Char Separat
}
//---------------------------------------------------------
-bool CSG_Table::_Load_Text(const CSG_String &FileName, bool bHeadline, const SG_Char _Separator)
+bool CSG_Table::_Load_Text(const CSG_String &File, bool bHeadline, const SG_Char _Separator)
{
CSG_File Stream;
- if( Stream.Open(FileName, SG_FILE_R, false, m_Encoding) == false )
+ if( Stream.Open(File, SG_FILE_R, false, m_Encoding) == false )
{
return( false );
}
@@ -312,7 +317,7 @@ bool CSG_Table::_Load_Text(const CSG_String &FileName, bool bHeadline, const SG_
Line.Remove(0, 1);
}
- bool bCSV = SG_File_Cmp_Extension(FileName, "csv");
+ bool bCSV = SG_File_Cmp_Extension(File, "csv");
while( Line.is_Empty() || (bCSV && Line[0] == '#') ) // empty or comment
{
@@ -487,11 +492,11 @@ bool CSG_Table::_Load_Text(const CSG_String &FileName, bool bHeadline, const SG_
}
//---------------------------------------------------------
-bool CSG_Table::_Save_Text(const CSG_String &FileName, bool bHeadline, const SG_Char Separator)
+bool CSG_Table::_Save_Text(const CSG_String &File, bool bHeadline, const SG_Char Separator)
{
CSG_File Stream;
- if( Get_Field_Count() <= 0 || Stream.Open(FileName, SG_FILE_W, false, m_Encoding) == false )
+ if( Get_Field_Count() <= 0 || Stream.Open(File, SG_FILE_W, false, m_Encoding) == false )
{
return( false );
}
@@ -549,19 +554,19 @@ bool CSG_Table::_Save_Text(const CSG_String &FileName, bool bHeadline, const SG_
///////////////////////////////////////////////////////////
//---------------------------------------------------------
-bool CSG_Table::_Load_DBase(const CSG_String &FileName)
+bool CSG_Table::_Load_DBase(const CSG_String &File)
{
CSG_Table_DBase dbf(m_Encoding);
- return( dbf.Open_Read(FileName, this) );
+ return( dbf.Open_Read(File, this) );
}
//---------------------------------------------------------
-bool CSG_Table::_Save_DBase(const CSG_String &FileName)
+bool CSG_Table::_Save_DBase(const CSG_String &File)
{
CSG_Table_DBase dbf(m_Encoding);
- return( dbf.Open_Write(FileName, this) );
+ return( dbf.Open_Write(File, this) );
}
=====================================
saga-gis/src/saga_core/saga_api/tin.cpp
=====================================
@@ -365,28 +365,28 @@ bool CSG_TIN::Triangulate(bool bOn, bool bUpdate)
//---------------------------------------------------------
bool CSG_TIN::Save(const CSG_String &File, int Format)
{
- bool bResult = false;
+ if( File.is_Empty() )
+ {
+ return( *Get_File_Name(false) ? Save(Get_File_Name(false), Format) : false );
+ }
+
+ bool bResult = false;
if( Get_Triangle_Count() > 0 )
{
switch( Format )
{
- case 0: default:
- {
- CSG_Shapes Points;
-
- Points.Create(SHAPE_TYPE_Point, Get_Name(), this);
+ case 0: default: {
+ CSG_Shapes Points(SHAPE_TYPE_Point, Get_Name(), this);
- for(sLong i=0; i<Get_Node_Count(); i++)
- {
- CSG_TIN_Node *pNode = Get_Node(i);
+ for(sLong i=0; i<Get_Node_Count(); i++)
+ {
+ Points.Add_Shape(Get_Node(i))->Add_Point(Get_Node(i)->Get_Point());
+ }
- Points.Add_Shape(pNode)->Add_Point(pNode->Get_Point());
- }
+ bResult = Points.Save(File);
- bResult = Points.Save(File);
- }
- break;
+ break; }
}
}
=====================================
saga-gis/src/saga_core/saga_cmd/man/saga_cmd.1
=====================================
@@ -133,7 +133,7 @@
.\" ========================================================================
.\"
.IX Title "SAGA_CMD 1"
-.TH SAGA_CMD 1 "2021-07-07" "9.7.0" " "
+.TH SAGA_CMD 1 "2021-07-07" "9.7.1" " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
=====================================
saga-gis/src/saga_core/saga_gui/man/saga_gui.1
=====================================
@@ -124,7 +124,7 @@
.\" ========================================================================
.\"
.IX Title "SAGA_GUI 1"
-.TH SAGA_GUI 1 "2021-07-07" "9.7.0" " "
+.TH SAGA_GUI 1 "2021-07-07" "9.7.1" " "
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
=====================================
saga-gis/src/saga_core/saga_gui/wksp_data_menu_file.cpp
=====================================
@@ -316,10 +316,14 @@ bool CWKSP_Data_Menu_File::Open(int CmdID)
{
if( m_Type == Recent_Type::Folder )
{
- return( g_pData->Open_Directory(m_Files[i]) );
+ g_pData->Open_Directory(m_Files[i]);
+ }
+ else
+ {
+ g_pData->Open(wxString(m_Files[i]));
}
- return( g_pData->Open(wxString(m_Files[i])) );
+ return( true );
}
return( false );
=====================================
saga-gis/src/saga_core/saga_gui/wksp_grid.cpp
=====================================
@@ -242,14 +242,13 @@ wxMenu * CWKSP_Grid::Get_Menu(void)
CMD_Menu_Add_Item(pSubMenu, false, ID_CMD_DATA_SCATTERPLOT);
CMD_Menu_Add_Item(pSubMenu, false, ID_CMD_DATA_SCATTERPLOT_3D);
- pMenu->Append(ID_CMD_WKSP_FIRST, _TL("Selection"), pSubMenu = new wxMenu());
if( MDI_Get_Active_Map() && m_Edit_Attributes.Get_Count() > 0 )
{
+ pMenu->Append(ID_CMD_WKSP_FIRST, _TL("Selection"), pSubMenu = new wxMenu());
CMD_Menu_Add_Item(pSubMenu, false, ID_CMD_MAP_ZOOM_SELECTION);
CMD_Menu_Add_Item(pSubMenu, false, ID_CMD_MAP_PAN_SELECTION);
+ CMD_Menu_Add_Item(pSubMenu, true, ID_CMD_DATA_SELECTION_CLEAR);
}
- CMD_Menu_Add_Item(pSubMenu, true, ID_CMD_DATA_SELECTION_CLEAR);
- CMD_Menu_Add_Item(pSubMenu, false, ID_CMD_DATA_SELECTION_INVERT);
return( pMenu );
}
@@ -1185,13 +1184,13 @@ bool CWKSP_Grid::asImage(CSG_Grid *pImage)
#pragma omp parallel for
for(int y=0; y<pImage->Get_NY(); y++) for(int x=0; x<pImage->Get_NX(); x++)
{
- if( Image.HasAlpha() )
+ if( Image.HasAlpha() && !Image.GetAlpha(x, y) )
{
- pImage->Set_Value(x, y, SG_GET_RGBA(Image.GetRed(x, y), Image.GetGreen(x, y), Image.GetBlue(x, y), Image.GetAlpha(x, y)));
+ pImage->Set_NoData(x, y);
}
else
{
- pImage->Set_Value(x, y, SG_GET_RGB (Image.GetRed(x, y), Image.GetGreen(x, y), Image.GetBlue(x, y)));
+ pImage->Set_Value(x, y, SG_GET_RGB(Image.GetRed(x, y), Image.GetGreen(x, y), Image.GetBlue(x, y)));
}
}
=====================================
saga-gis/src/saga_core/saga_gui/wksp_layer.cpp
=====================================
@@ -916,7 +916,7 @@ void CWKSP_Layer::_Set_Projection(void)
{
CSG_Projection new_CRS(pTool->Get_Parameter("CRS_WKT")->asString(), pTool->Get_Parameter("CRS_PROJ")->asString());
- if( new_CRS.is_Okay() && (new_CRS != CRS || new_CRS.Get_Code() != CRS.Get_Code() || new_CRS.Get_Authority().CmpNoCase(CRS.Get_Authority())) )
+ if( new_CRS.is_Okay() && CRS.Get_WKT2().CmpNoCase(new_CRS.Get_WKT2()) )
{
CRS.Create(new_CRS); Get_Object()->Set_Modified();
=====================================
saga-gis/src/tools/grid/grid_gridding/Shapes2Grid.cpp
=====================================
@@ -295,15 +295,15 @@ bool CShapes2Grid::On_Execute(void)
m_pGrid->Assign_NoData();
//-------------------------------------------------
- CSG_Grid Count;
+ CSG_Grid Count;
- m_pCount = m_Grid_Target.Get_Grid("COUNT", pShapes->Get_Count() < 256 ? SG_DATATYPE_Byte : SG_DATATYPE_Word);
+ m_pCount = m_Grid_Target.Get_Grid("COUNT", pShapes->Get_Count() < 256 ? SG_DATATYPE_Byte : SG_DATATYPE_Word);
if( m_pCount == NULL )
{
Count.Create(m_pGrid->Get_System(), SG_DATATYPE_Word);
- m_pCount = &Count;
+ m_pCount = &Count;
}
m_pCount->Fmt_Name("%s [%s]", pShapes->Get_Name(), _TL("Count"));
@@ -321,23 +321,16 @@ bool CShapes2Grid::On_Execute(void)
{
if( Field < 0 || !pShape->is_NoData(Field) )
{
- if( pShape->Intersects(m_pGrid->Get_Extent()) )
+ if( pShape->Intersects(m_pGrid->Get_Extent(true)) )
{
- double Value = Field >= 0 ? pShape->asDouble(Field) : Field == OUTPUT_INDEX ? i + 1 : 1;
+ double Value = Field >= 0 ? pShape->asDouble(Field) : Field == OUTPUT_INDEX ? i + 1 : 1;
switch( pShapes->Get_Type() )
{
- case SHAPE_TYPE_Point: case SHAPE_TYPE_Points:
- Set_Points (pShape, Value);
- break;
-
- case SHAPE_TYPE_Line:
- Set_Line (pShape, bFat, Value);
- break;
-
- case SHAPE_TYPE_Polygon:
- Set_Polygon (pShape, bFat, Value);
- break;
+ case SHAPE_TYPE_Point :
+ case SHAPE_TYPE_Points : Set_Points (pShape , Value); break;
+ case SHAPE_TYPE_Line : Set_Line (pShape, bFat, Value); break;
+ case SHAPE_TYPE_Polygon: Set_Polygon(pShape, bFat, Value); break;
}
}
}
@@ -371,46 +364,46 @@ bool CShapes2Grid::On_Execute(void)
//---------------------------------------------------------
inline void CShapes2Grid::Set_Value(int x, int y, double Value, bool bCheckDuplicates)
{
- if( bCheckDuplicates )
+ if( m_pGrid->is_InGrid(x, y, false) )
{
- sLong n = y * m_pGrid->Get_NX() + x;
-
- if( !m_Cells_On_Shape.insert(n).second )
+ if( bCheckDuplicates )
{
- return; // this cell has already been rendered for this shape
+ sLong n = y * m_pGrid->Get_NX() + x;
+
+ if( !m_Cells_On_Shape.insert(n).second )
+ {
+ return; // this cell has already been rendered for this shape
+ }
}
- }
- if( m_pGrid->is_InGrid(x, y, false) )
- {
if( m_pCount->asInt(x, y) == 0 )
{
m_pGrid->Set_Value(x, y, Value);
}
else switch( m_Multiple )
{
- default: // first
+ default : // first
break;
- case 1: // last
+ case 1: // last
m_pGrid->Set_Value(x, y, Value);
break;
- case 2: // minimum
+ case 2: // minimum
if( m_pGrid->asDouble(x, y) > Value )
{
m_pGrid->Set_Value(x, y, Value);
}
break;
- case 3: // maximum
+ case 3: // maximum
if( m_pGrid->asDouble(x, y) < Value )
{
m_pGrid->Set_Value(x, y, Value);
}
break;
- case 4: // mean
+ case 4: // mean
m_pGrid->Add_Value(x, y, Value);
break;
}
@@ -431,12 +424,11 @@ void CShapes2Grid::Set_Points(CSG_Shape *pShape, double Value)
{
for(int iPoint=0; iPoint<pShape->Get_Point_Count(iPart); iPoint++)
{
- TSG_Point p = pShape->Get_Point(iPoint, iPart);
+ TSG_Point p = pShape->Get_Point(iPoint, iPart);
Set_Value(
- (int)(0.5 + X_WORLD_TO_GRID(p.x)),
- (int)(0.5 + Y_WORLD_TO_GRID(p.y)), Value,
- false
+ m_pGrid->Get_System().Get_xWorld_to_Grid(p.x),
+ m_pGrid->Get_System().Get_yWorld_to_Grid(p.y), Value, false
);
}
}
=====================================
saga-gis/src/tools/io/io_grid_image/grid_export.cpp
=====================================
@@ -279,7 +279,10 @@ int CGrid_Export::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Paramete
{
if( pParameter->Cmp_Identifier("GRID") )
{
- pParameters->Set_Enabled("FILE_KML" , pParameter->asPointer() && pParameter->asGrid()->Get_Projection().Get_Type() == ESG_CRS_Type::Geographic);
+ pParameters->Set_Enabled("FILE_KML" , pParameter->asPointer() &&
+ ( pParameter->asGrid()->Get_Projection().is_Geographic()
+ || pParameter->asGrid()->Get_Projection().is_Geodetic ())
+ );
}
if( pParameter->Cmp_Identifier("FILE") )
@@ -414,7 +417,7 @@ bool CGrid_Export::On_Execute(void)
if( SG_File_Cmp_Extension(File, "pcx") ) { wxImage::AddHandler(pHandler = new wxPCXHandler ); } else
if( SG_File_Cmp_Extension(File, "tif") ) { wxImage::AddHandler(pHandler = new wxTIFFHandler); } else
if( SG_File_Cmp_Extension(File, "gif") ) { wxImage::AddHandler(pHandler = new wxGIFHandler ); } else
- { wxImage::AddHandler(pHandler = new wxPNGHandler ); }
+ { wxImage::AddHandler(pHandler = new wxPNGHandler ); }
}
bool bOkay = Image.SaveFile(File.c_str());
@@ -461,7 +464,7 @@ bool CGrid_Export::On_Execute(void)
}
//-----------------------------------------------------
- if( Parameters("FILE_KML")->asBool() && Parameters("GRID")->asGrid()->Get_Projection().is_Geographic() )
+ if( Parameters("FILE_KML")->asBool() && (Parameters("GRID")->asGrid()->Get_Projection().is_Geographic() || Parameters("GRID")->asGrid()->Get_Projection().is_Geodetic()) )
{
CSG_MetaData KML; KML.Set_Name("kml"); KML.Add_Property("xmlns", "http://www.opengis.net/kml/2.2");
@@ -626,7 +629,7 @@ bool CGrid_Export::Set_RGB(CSG_Grid &Grid, CSG_Grid &RGB)
}
else
{
- RGB.Set_Value(x, y, Grid.asDouble(x, yy));
+ RGB.Set_Value(x, y, Grid.asInt(x, yy));
}
}
=====================================
saga-gis/src/tools/io/io_grid_image/grid_to_kml.cpp
=====================================
@@ -72,20 +72,11 @@ CGrid_to_KML::CGrid_to_KML(void)
"coordinate system, if its projection is known and not geographic. "
));
- Parameters.Add_Grid("",
- "GRID" , _TL("Grid"),
- _TL(""),
- PARAMETER_INPUT
- );
-
- Parameters.Add_Grid("",
- "SHADE" , _TL("Shade"),
- _TL(""),
- PARAMETER_INPUT_OPTIONAL
- );
+ Parameters.Add_Grid("", "GRID" , _TL("Grid" ), _TL(""), PARAMETER_INPUT);
+ Parameters.Add_Grid("", "SHADE", _TL("Shade"), _TL(""), PARAMETER_INPUT_OPTIONAL);
Parameters.Add_FilePath("",
- "FILE" , _TL("File"),
+ "FILE" , _TL("File"),
_TL(""),
CSG_String::Format("%s (*.kmz)|*.kmz|%s (*.kml)|*.kml",
_TL("Compressed Keyhole Markup Language Files"),
@@ -94,7 +85,7 @@ CGrid_to_KML::CGrid_to_KML(void)
);
Parameters.Add_Choice("",
- "FORMAT" , _TL("Image Format"),
+ "FORMAT" , _TL("Image Format"),
_TL(""),
CSG_String::Format("%s|%s|%s|%s|%s",
_TL("Portable Network Graphics"),
@@ -108,7 +99,7 @@ CGrid_to_KML::CGrid_to_KML(void)
if( has_GUI() )
{
Parameters.Add_Choice("",
- "COLOURING" , _TL("Colouring"),
+ "COLOURING" , _TL("Colors"),
_TL(""),
CSG_String::Format("%s|%s|%s|%s|%s|%s",
_TL("stretch to grid's standard deviation"),
@@ -121,14 +112,14 @@ CGrid_to_KML::CGrid_to_KML(void)
);
Parameters.Add_Colors("",
- "COL_PALETTE" , _TL("Colours Palette"),
+ "COL_PALETTE", _TL("Color Ramp"),
_TL("")
);
}
else
{
Parameters.Add_Choice("",
- "COLOURING" , _TL("Colouring"),
+ "COLOURING" , _TL("Colors"),
_TL(""),
CSG_String::Format("%s|%s|%s|%s|%s",
_TL("stretch to grid's standard deviation"),
@@ -140,48 +131,35 @@ CGrid_to_KML::CGrid_to_KML(void)
);
Parameters.Add_Choice("",
- "COL_PALETTE" , _TL("Color Palette"),
- _TL(""),
- CSG_String::Format("%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s|%s",
- _TL("DEFAULT" ), _TL("DEFAULT_BRIGHT" ), _TL("BLACK_WHITE" ), _TL("BLACK_RED" ),
- _TL("BLACK_GREEN" ), _TL("BLACK_BLUE" ), _TL("WHITE_RED" ), _TL("WHITE_GREEN" ),
- _TL("WHITE_BLUE" ), _TL("YELLOW_RED" ), _TL("YELLOW_GREEN" ), _TL("YELLOW_BLUE" ),
- _TL("RED_GREEN" ), _TL("RED_BLUE" ), _TL("GREEN_BLUE" ), _TL("RED_GREY_BLUE" ),
- _TL("RED_GREY_GREEN"), _TL("GREEN_GREY_BLUE"), _TL("RED_GREEN_BLUE"), _TL("RED_BLUE_GREEN"),
- _TL("GREEN_RED_BLUE"), _TL("RAINBOW" ), _TL("NEON" ), _TL("TOPOGRAPHY" ),
- _TL("ASPECT_1" ), _TL("ASPECT_2" ), _TL("ASPECT_3" )
- ), 0
- );
-
- Parameters.Add_Int("",
- "COL_COUNT" , _TL("Number of Colors"),
+ "COL_PALETTE" , _TL("Color Ramp"),
_TL(""),
- 100
+ "DEFAULT" "|DEFAULT_BRIGHT" "|BLACK_WHITE" "|BLACK_RED" "|"
+ "BLACK_GREEN" "|BLACK_BLUE" "|WHITE_RED" "|WHITE_GREEN" "|"
+ "WHITE_BLUE" "|YELLOW_RED" "|YELLOW_GREEN" "|YELLOW_BLUE" "|"
+ "RED_GREEN" "|RED_BLUE" "|GREEN_BLUE" "|RED_GREY_BLUE" "|"
+ "RED_GREY_GREEN" "|GREEN_GREY_BLUE" "|RED_GREEN_BLUE" "|RED_BLUE_GREEN""|"
+ "GREEN_RED_BLUE" "|RAINBOW" "|NEON" "|TOPOGRAPHY" "|"
+ "ASPECT_1" "|ASPECT_2" "|ASPECT_3" "|"
);
- Parameters.Add_Bool("",
- "COL_REVERT" , _TL("Revert Palette"),
- _TL(""),
- false
- );
+ Parameters.Add_Int ("", "COL_COUNT" , _TL("Number of Colors"), _TL(""), 100);
+ Parameters.Add_Bool("", "COL_REVERT", _TL("Invert Ramp" ), _TL(""), false);
}
Parameters.Add_Double("",
- "STDDEV" , _TL("Standard Deviation"),
+ "STDDEV" , _TL("Standard Deviation"),
_TL(""),
2., 0., true
);
Parameters.Add_Range("",
- "STRETCH" , _TL("Stretch to Value Range"),
+ "STRETCH" , _TL("Stretch to Value Range"),
_TL(""),
0., 100.
);
//-----------------------------------------------------
- CSG_Table *pLUT = Parameters.Add_FixedTable("", "LUT", _TL("Lookup Table"), _TL(""))->asTable();
-
- pLUT->Set_Name(_TL("Table"));
+ CSG_Table *pLUT = Parameters.Add_FixedTable("", "LUT", _TL("Lookup Table"), _TL(""))->asTable();
pLUT->Add_Field("Color" , SG_DATATYPE_Color );
pLUT->Add_Field("Name" , SG_DATATYPE_String);
@@ -231,7 +209,7 @@ int CGrid_to_KML::On_Parameters_Enable(CSG_Parameters *pParameters, CSG_Paramete
if( pParameter->Cmp_Identifier("GRID") || pParameter->Cmp_Identifier("COLOURING") )
{
- CSG_Grid *pGrid = pParameters->Get_Parameter("GRID")->asGrid();
+ CSG_Grid *pGrid = pParameters->Get_Parameter("GRID")->asGrid();
pParameters->Set_Enabled("RESAMPLING",
pGrid && pGrid->Get_Projection().Get_Type() == ESG_CRS_Type::Projection && pParameters->Get_Parameter("COLOURING")->asInt() < 4
@@ -257,7 +235,7 @@ bool CGrid_to_KML::On_Execute(void)
//-----------------------------------------------------
int Method = Parameters("COLOURING")->asInt();
- if( Method == 5 ) // same as in graphical user interface
+ if( Method == 5 ) // same as in graphical user interface
{
if( !SG_UI_DataObject_asImage(pGrid, &Image) )
{
@@ -270,7 +248,7 @@ bool CGrid_to_KML::On_Execute(void)
Image.Set_Description(pGrid->Get_Description());
Image.Flip();
pGrid = &Image;
- Method = 4; // rgb coded values
+ Method = 4; // rgb coded values
}
//-----------------------------------------------------
@@ -278,7 +256,7 @@ bool CGrid_to_KML::On_Execute(void)
{
Message_Add(_TL("layer uses undefined coordinate system, assuming geographic coordinates"));
}
- else if( pGrid->Get_Projection().Get_Type() != ESG_CRS_Type::Geographic )
+ else if( !(pGrid->Get_Projection().is_Geographic() || pGrid->Get_Projection().is_Geodetic()) )
{
Message_Fmt("\n%s (%s: %s)\n", _TL("re-projection to geographic coordinates"), _TL("original"), pGrid->Get_Projection().Get_Name().c_str());
@@ -291,9 +269,9 @@ bool CGrid_to_KML::On_Execute(void)
pTool->Set_Manager(NULL);
- if( pTool->Set_Parameter("CRS_WKT" , CSG_Projection::Get_GCS_WGS84().Get_WKT2())
- && pTool->Set_Parameter("CRS_PROJ" , CSG_Projection::Get_GCS_WGS84().Get_PROJ())
- && pTool->Set_Parameter("RESAMPLING", Method < 4 && Parameters("RESAMPLING")->asBool() ? 4 : 0)
+ if( pTool->Set_Parameter("CRS_STRING", CSG_Projection::Get_GCS_WGS84().Get_WKT())
+ && pTool->Set_Parameter("RESAMPLING", Parameters("RESAMPLING")->asBool() ? 3 : 0)
+ && pTool->Set_Parameter("BYTEWISE" , Method == 4)
&& pTool->Set_Parameter("SOURCE" , pGrid)
&& pTool->Execute() )
{
=====================================
saga-gis/src/tools/io/io_webservices/global_tiles.cpp
=====================================
@@ -455,7 +455,7 @@ bool CTiles_Provider::Provide_Tiles(const CSG_String &Directory, CSG_Rect Extent
//---------------------------------------------------------
int CTiles_Provider::Provide_Tile(const CSG_String &Directory, int Col, int Row, bool DeleteArchive)
{
- CSG_String File = Get_Tile_Name(Col, Row) + "." + m_Grid_Extension;
+ CSG_String File = Get_Tile_File(Col, Row);
CSG_String Local_File = SG_File_Make_Path(Directory, File);
@@ -468,6 +468,8 @@ int CTiles_Provider::Provide_Tile(const CSG_String &Directory, int Col, int Row,
CSG_String Archive_Name = Get_Tile_Archive(Col, Row);
CSG_String Archive_File = SG_File_Make_Path(Directory, Archive_Name);
+ Message_Fmt("\n%s: %s%s...", _TL("requesting file"), m_ServerPath.c_str(), Archive_Name.c_str());
+
if( !SG_File_Exists(Archive_File) )
{
Process_Set_Text("%s: %s...", File.c_str(), _TL("downloading"));
@@ -477,14 +479,14 @@ int CTiles_Provider::Provide_Tile(const CSG_String &Directory, int Col, int Row,
CSG_CURL Connection(m_ServerPath, Username, Password);
- Message_Fmt("\n%s: %s%s", _TL("requesting file"), m_ServerPath.c_str(), Archive_Name.c_str());
-
- SG_UI_Process_Set_Busy(true, CSG_String::Format("%s: %s%s...", _TL("Downloading"), m_ServerPath.c_str(), Archive_Name.c_str()));
+ SG_UI_Process_Set_Busy(true, CSG_String::Format("%s: %s%s...", _TL("downloading"), m_ServerPath.c_str(), Archive_Name.c_str()));
if( !Connection.Request(Archive_Name, Archive_File.c_str()) )
{
SG_UI_Process_Set_Busy(false);
+ Message_Fmt(_TL("failed"));
+
Error_Fmt("%s:\n\n%s%s", _TL("failed to request file from server"), m_ServerPath.c_str(), Archive_Name.c_str());
return( -1 );
@@ -498,9 +500,9 @@ int CTiles_Provider::Provide_Tile(const CSG_String &Directory, int Col, int Row,
CSG_Archive Archive(Archive_File);
- if( !Archive.is_Open() || !Archive.Extract(Get_Tile_Archive_File(Col, Row)) )
+ if( !Archive.Extract(Get_Tile_Archive_File(Col, Row)) )
{
- Error_Fmt("%s: %s", _TL("failed to extract file"), Get_Tile_Archive_File(Col, Row).c_str());
+ Message_Fmt("\n%s: %s", _TL("failed to extract file"), Get_Tile_Archive_File(Col, Row).c_str());
if( DeleteArchive )
{
@@ -510,12 +512,16 @@ int CTiles_Provider::Provide_Tile(const CSG_String &Directory, int Col, int Row,
return( -1 );
}
+ On_Provide_Tile(Col, Row, Archive);
+
if( DeleteArchive )
{
Archive.Close(); SG_File_Delete(Archive_File);
}
//-----------------------------------------------------
+ Message_Fmt(_TL("okay"));
+
return( 1 );
}
@@ -625,21 +631,21 @@ CSG_Rect_Int CSRTM_CGIAR::Get_Tiles(const CSG_Rect &_Extent) const
}
//---------------------------------------------------------
-CSG_String CSRTM_CGIAR::Get_Tile_Name(int Col, int Row) const
+CSG_String CSRTM_CGIAR::Get_Tile_File(int Col, int Row) const
{
- return( CSG_String::Format("srtm_%02d_%02d", 1 + Col, 1 + Row) );
+ return( CSG_String::Format("srtm_%02d_%02d.tif", 1 + Col, 1 + Row) );
}
//---------------------------------------------------------
CSG_String CSRTM_CGIAR::Get_Tile_Archive(int Col, int Row) const
{
- return( Get_Tile_Name(Col, Row) + ".zip" );
+ return( CSG_String::Format("srtm_%02d_%02d.zip", 1 + Col, 1 + Row) );
}
//---------------------------------------------------------
CSG_String CSRTM_CGIAR::Get_Tile_Archive_File(int Col, int Row) const
{
- return( Get_Tile_Name(Col, Row) + ".tif" );
+ return( CSG_String::Format("srtm_%02d_%02d.tif", 1 + Col, 1 + Row) );
}
@@ -717,10 +723,14 @@ CSG_String CSRTM_USGS::Get_Tile_Name(int Col, int Row) const
}
//---------------------------------------------------------
-CSG_String CSRTM_USGS::Get_Tile_Archive(int Col, int Row) const
+CSG_String CSRTM_USGS::Get_Tile_File(int Col, int Row) const
{
- // http://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11/S56W180.SRTMGL1.hgt.zip
+ return( Get_Tile_Name(Col, Row) + ".tif" );
+}
+//---------------------------------------------------------
+CSG_String CSRTM_USGS::Get_Tile_Archive(int Col, int Row) const
+{
return( Get_Tile_Name(Col, Row) + ".hgt.zip" );
}
@@ -758,8 +768,9 @@ CCopernicus_DEM::CCopernicus_DEM(void)
);
//-----------------------------------------------------
- // https://e4ftl01.cr.usgs.gov/MEASURES/SRTMGL1.003/2000.02.11/N51E009.SRTMGL1.hgt.zip
+ Parameters.Add_Bool("TILES", "MASK", _TL("Water Mask"), _TL("Applies ocean water mask."), true);
+ //-----------------------------------------------------
m_ServerPath = "https://prism-dem-open.copernicus.eu/pd-desk-open-access/prismDownload/COP-DEM_GLO-30-DGED__2022_1/";
m_Grid_Name = "Copernicus DEM";
@@ -797,6 +808,12 @@ CSG_String CCopernicus_DEM::Get_Tile_Name(int Col, int Row) const
));
}
+//---------------------------------------------------------
+CSG_String CCopernicus_DEM::Get_Tile_File(int Col, int Row) const
+{
+ return( Get_Tile_Name(Col, Row) + "_DEM.tif" );
+}
+
//---------------------------------------------------------
CSG_String CCopernicus_DEM::Get_Tile_Archive(int Col, int Row) const
{
@@ -806,13 +823,68 @@ CSG_String CCopernicus_DEM::Get_Tile_Archive(int Col, int Row) const
//---------------------------------------------------------
CSG_String CCopernicus_DEM::Get_Tile_Archive_File(int Col, int Row) const
{
- #ifdef _SAGA_MSW
- return( Get_Tile_Name(Col, Row) + "\\DEM\\" + Get_Tile_Name(Col, Row) + "_DEM.tif" );
- #else
- return( Get_Tile_Name(Col, Row) + "/DEM/" + Get_Tile_Name(Col, Row) + "_DEM.tif" );
- #endif
+#ifdef _SAGA_MSW
+ return( Get_Tile_Name(Col, Row) + "\\DEM\\" + Get_Tile_File(Col, Row) );
+#else
+ return( Get_Tile_Name(Col, Row) + "/DEM/" + Get_Tile_File(Col, Row) );
+#endif
}
+//---------------------------------------------------------
+bool CCopernicus_DEM::On_Provide_Tile(int Col, int Row, CSG_Archive &Archive)
+{
+ if( !Parameters["MASK"].asBool() )
+ {
+ return( true );
+ }
+
+ CSG_Grid DEM, Mask; CSG_String Name(Get_Tile_Name(Col, Row)), Directory(SG_File_Get_Path(Archive.Get_Archive()));
+
+ Process_Set_Text("%s: %s...", Name.c_str(), _TL("masking"));
+
+ SG_UI_ProgressAndMsg_Lock(true);
+
+ if( DEM.Create(SG_File_Make_Path(Directory, Name + "_DEM.tif")) )
+ {
+ #ifdef _SAGA_MSW
+ CSG_String File(Name + "\\AUXFILES\\" + Name + "_WBM.tif" );
+ #else
+ CSG_String File(Name + "/AUXFILES/" + Name + "_WBM.tif" );
+ #endif
+
+ if( Archive.Extract(File) )
+ {
+ File = SG_File_Make_Path(Directory, Name + "_WBM.tif");
+
+ if( Mask.Create(File) && Mask.Get_System() == DEM.Get_System() )
+ {
+ for(sLong i=0; i<DEM.Get_NCells(); i++)
+ {
+ if( Mask.asInt(i) == 1 )
+ {
+ DEM.Set_NoData(i);
+ }
+ }
+
+ DEM.Save("");
+
+ SG_File_Delete(File);
+
+ SG_UI_ProgressAndMsg_Lock(false);
+
+ return( true );
+ }
+
+ SG_File_Delete(File);
+ }
+ }
+
+ SG_UI_ProgressAndMsg_Lock(false);
+
+ return( false );
+}
+
+
///////////////////////////////////////////////////////////
// //
=====================================
saga-gis/src/tools/io/io_webservices/global_tiles.h
=====================================
@@ -91,10 +91,12 @@ protected:
virtual bool On_Execute (void);
virtual CSG_Rect_Int Get_Tiles (const CSG_Rect &Extent) const = 0;
- virtual CSG_String Get_Tile_Name (int Col, int Row) const = 0;
+ virtual CSG_String Get_Tile_File (int Col, int Row) const = 0;
virtual CSG_String Get_Tile_Archive (int Col, int Row) const = 0;
virtual CSG_String Get_Tile_Archive_File (int Col, int Row) const = 0;
+ virtual bool On_Provide_Tile (int Col, int Row, CSG_Archive &Archive) { return( true ); }
+
private:
@@ -123,7 +125,7 @@ public:
protected:
virtual CSG_Rect_Int Get_Tiles (const CSG_Rect &Extent) const;
- virtual CSG_String Get_Tile_Name (int Col, int Row) const;
+ virtual CSG_String Get_Tile_File (int Col, int Row) const;
virtual CSG_String Get_Tile_Archive (int Col, int Row) const;
virtual CSG_String Get_Tile_Archive_File (int Col, int Row) const;
@@ -144,10 +146,15 @@ public:
protected:
virtual CSG_Rect_Int Get_Tiles (const CSG_Rect &Extent) const;
- virtual CSG_String Get_Tile_Name (int Col, int Row) const;
+ virtual CSG_String Get_Tile_File (int Col, int Row) const;
virtual CSG_String Get_Tile_Archive (int Col, int Row) const;
virtual CSG_String Get_Tile_Archive_File (int Col, int Row) const;
+
+private:
+
+ CSG_String Get_Tile_Name (int Col, int Row) const;
+
};
@@ -165,10 +172,17 @@ public:
protected:
virtual CSG_Rect_Int Get_Tiles (const CSG_Rect &Extent) const;
- virtual CSG_String Get_Tile_Name (int Col, int Row) const;
+ virtual CSG_String Get_Tile_File (int Col, int Row) const;
virtual CSG_String Get_Tile_Archive (int Col, int Row) const;
virtual CSG_String Get_Tile_Archive_File (int Col, int Row) const;
+ virtual bool On_Provide_Tile (int Col, int Row, CSG_Archive &Archive);
+
+
+private:
+
+ CSG_String Get_Tile_Name (int Col, int Row) const;
+
};
=====================================
saga-gis/src/tools/shapes/shapes_grid/Grid_Statistics_AddTo_Polygon.cpp
=====================================
@@ -551,7 +551,7 @@ bool CGrid_Statistics_AddTo_Polygon::Get_Simple_Index(CSG_Shapes *pPolygons, CSG
if( bFill )
{
- Index.Set_Value(x, y, iShape);
+ Index.Set_Value(x, y, (double)iShape);
}
}
}
=====================================
saga-gis/version.cmake
=====================================
@@ -1,7 +1,7 @@
# The version number.
set (SAGA_VERSION_MAJOR 9)
set (SAGA_VERSION_MINOR 7)
-set (SAGA_VERSION_PATCH 0)
+set (SAGA_VERSION_PATCH 1)
# get git commit hash (or dirty if git is not installed)
View it on GitLab: https://salsa.debian.org/debian-gis-team/saga/-/commit/1c08cee4b7d4ffed2163cb3ad7b929c350352d27
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/saga/-/commit/1c08cee4b7d4ffed2163cb3ad7b929c350352d27
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20250109/ae331843/attachment-0001.htm>
More information about the Pkg-grass-devel
mailing list