I’m getting around to completing my TODO list for the add-on r.terrain.texture, which includes generating the additional terrain metrics (terrain surface concavity and convexity), and calculating the nested 8,12 or 16 class terrain classification as per Iwahashi and Pike (2007). Everything is working but the script uses r.mfilter, which I supply a matrix filter to, stored as a text file.
Is there a makefile command that can be used to bundle a text file with the add on, which can then be found using set_path?
I'm getting around to completing my TODO list for the add-on r.terrain.texture, which includes generating the additional terrain metrics (terrain surface concavity and convexity), and calculating the nested 8,12 or 16 class terrain classification as per Iwahashi and Pike (2007). Everything is working but the script uses r.mfilter, which I supply a matrix filter to, stored as a text file.
Is there a makefile command that can be used to bundle a text file with the add on, which can then be found using set_path?
Can't you include the filter as a string directly in the code ?
Thanks Moritz, that’s one option although I dropping large blobs of text strings into the script might not be very ‘clean’ (I also have three files representing color rules, and three category files that are applied to the 8, 12 or 16 terrain classification results). If there is no alternative I’ll go with that (or create some additional python files containing the strings that are imported), but I was wondering if there is a way to package the typical GRASS rule files in the add-on.
I’m getting around to completing my TODO list for the add-on r.terrain.texture, which includes generating the additional terrain metrics (terrain surface concavity and convexity), and calculating the nested 8,12 or 16 class terrain classification as per Iwahashi and Pike (2007). Everything is working but the script uses r.mfilter, which I supply a matrix filter to, stored as a text file.
Is there a makefile command that can be used to bundle a text file with the add on, which can then be found using set_path?
Can’t you include the filter as a string directly in the code ?
I’m getting around to completing my TODO list for the add-on r.terrain.texture, which includes generating the additional terrain metrics (terrain surface concavity and convexity), and calculating the nested 8,12 or 16 class terrain classification as per Iwahashi and Pike (2007). Everything is working but the script uses r.mfilter, which I supply a matrix filter to, stored as a text file.
Is there a makefile command that can be used to bundle a text file with the add on, which can then be found using set_path?
You may want to check how the color files are installed. Should work pretty much the same.
I’m getting around to completing my TODO list for the add-on r.terrain.texture, which includes generating the additional terrain metrics (terrain surface concavity and convexity), and calculating the nested 8,12 or 16 class terrain classification as per Iwahashi and Pike (2007). Everything is working but the script uses r.mfilter, which I supply a matrix filter to, stored as a text file.
Is there a makefile command that can be used to bundle a text file with the add on, which can then be found using set_path?
You may want to check how the color files are installed. Should work pretty much the same.
I have gone with your's and Moritz's suggestion and have completed r.terrain.texture with the Iwahashi and Pike nested-means terrain classification method in the add-ons.
Best regards,
Steve
Sent from my iPhone
On Aug 12, 2017, at 2:22 PM, Helmut Kudrnovsky <hellik@web.de> wrote:
(I also have three files representing color rules, and three category >files
that are applied to the 8, 12 or 16 terrain classification >results)
------
r.terrain.texture elevation=elevation@PERMANENT slope=myslope@user1
classes=12 texture=terr_tex convexity=terr_convex concavity=terr_concav
features=terr_class
Calculating terrain surface texture...
1. Smoothing input DEM with a 3x3 median filter...
2. Extracting pits and peaks with difference > thres...
3. Using resampling filter to create terrain texture...
4. Converting to percentage...
Calculating terrain convexity and concavity...
1. Calculating terrain curvature using laplacian filter...
2. Extracting convexities and concavities...
3. Using resampling filter to create surface convexity/concavity...
4. Converting to percentages...
Performing terrain surface classification...
Traceback (most recent call last):
File
"C:\OSGEO4~1\apps\grass\grass-7.3.svn/scripts/m.proj.py",
line 308, in <module>
main()
File
"C:\OSGEO4~1\apps\grass\grass-7.3.svn/scripts/m.proj.py",
line 243, in main
inf = file(infile)
IOError: [Errno 13] Permission denied: 'c:\\users\\xxx\\ap
pdata\\local\\temp\\grass7-hkmyr-6804\\tmpl1pwdf'
ERROR: cs2cs failed
Deleting intermediate files...
WARNING: No data base element files found
Traceback (most recent call last):
File "C:\Users\xxx\AppData\Roaming\GRASS7\addons/scripts
/r.terrain.texture.py", line 575, in <module>
sys.exit(main())
File "C:\Users\xxx\AppData\Roaming\GRASS7\addons/scripts
/r.terrain.texture.py", line 471, in main
flags='g', quiet=True,
stdout_=PIPE).outputs.stdout.split(os.linesep)[:-1]
File "C:\OSGEO4~1\apps\grass\grass-7.3.svn\etc\python\gras
s\pygrass\modules\interface\module.py", line 648, in
__call__
return self.run()
File "C:\OSGEO4~1\apps\grass\grass-7.3.svn\etc\python\gras
s\pygrass\modules\interface\module.py", line 769, in run
self.wait()
File "C:\OSGEO4~1\apps\grass\grass-7.3.svn\etc\python\gras
s\pygrass\modules\interface\module.py", line 790, in wait
module=self.name, errors=stderr)
grass.exceptions.CalledModuleError: Module run r.tileset
r.tileset sourceproj=+proj=lcc +lat_1=36.16666666666666
+lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79
+x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.257222101
+towgs84=0.000,0.000,0.000 +to_meter=1 sourcescale=1
maxcols=1500 maxrows=1352 overlap=0 separator=pipe -g --q
ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
------
This seems to be an issue on windows that is related to r.tileset not r.terrain.texture. Infact on windows I can’t get r.tileset to function at all on a windows system, but it works on linux:
Traceback (most recent call last):
File
“C:\OSGEO4~1\apps\grass\grass-7.3.svn/scripts/m.proj.py”,
line 308, in
main()
File
“C:\OSGEO4~1\apps\grass\grass-7.3.svn/scripts/m.proj.py”,
line 243, in main
inf = file(infile)
IOError: [Errno 13] Permission denied: ‘c:\users\cb2dd\ap
pdata\local\temp\grass7-cb2dd-10432\tmpovmbzm’
ERROR: cs2cs failed
···
On Tue, Aug 15, 2017 at 1:31 AM, Helmut Kudrnovsky <hellik@web.de> wrote:
I have gone with your’s and Moritz’s suggestion and have completed
r.terrain.texture with the Iwahashi >and Pike nested-means terrain
classification method in the add-ons.
Extracting pits and peaks with difference > thres…
Using resampling filter to create terrain texture…
Converting to percentage…
Calculating terrain convexity and concavity…
Calculating terrain curvature using laplacian filter…
Extracting convexities and concavities…
Using resampling filter to create surface convexity/concavity…
Converting to percentages…
Performing terrain surface classification…
Traceback (most recent call last):
File
“C:\OSGEO4~1\apps\grass\grass-7.3.svn/scripts/m.proj.py”,
line 308, in
main()
File
“C:\OSGEO4~1\apps\grass\grass-7.3.svn/scripts/m.proj.py”,
line 243, in main
inf = file(infile)
IOError: [Errno 13] Permission denied: ‘c:\users\xxx\ap
pdata\local\temp\grass7-hkmyr-6804\tmpl1pwdf’
ERROR: cs2cs failed
Deleting intermediate files…
WARNING: No data base element files found
Traceback (most recent call last):
File “C:\Users\xxx\AppData\Roaming\GRASS7\addons/scripts
/r.terrain.texture.py”, line 575, in
sys.exit(main())
File “C:\Users\xxx\AppData\Roaming\GRASS7\addons/scripts
/r.terrain.texture.py”, line 471, in main
flags=‘g’, quiet=True,
stdout_=PIPE).outputs.stdout.split(os.linesep)[:-1]
File “C:\OSGEO4~1\apps\grass\grass-7.3.svn\etc\python\gras
s\pygrass\modules\interface\module.py”, line 648, in call
return self.run()
File “C:\OSGEO4~1\apps\grass\grass-7.3.svn\etc\python\gras
s\pygrass\modules\interface\module.py”, line 769, in run
self.wait()
File “C:\OSGEO4~1\apps\grass\grass-7.3.svn\etc\python\gras
s\pygrass\modules\interface\module.py”, line 790, in wait
module=self.name, errors=stderr)
grass.exceptions.CalledModuleError: Module run r.tileset
r.tileset sourceproj=+proj=lcc +lat_1=36.16666666666666
+lat_2=34.33333333333334 +lat_0=33.75 +lon_0=-79
+x_0=609601.22 +y_0=0 +no_defs +a=6378137 +rf=298.257222101
+towgs84=0.000,0.000,0.000 +to_meter=1 sourcescale=1
maxcols=1500 maxrows=1352 overlap=0 separator=pipe -g --q
ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
This seems to be an issue on windows that is related to r.tileset not
r.terrain.texture. Infact on windows I can't get r.tileset to function at
all on a windows system, but it works on linux:
This seems to be an issue on windows that is related to r.tileset not r.terrain.texture. Infact on windows I can't get r.tileset to function at all on a windows system, but it works on linux:
This seems to be an issue on windows that is related to r.tileset not
r.terrain.texture. Infact on windows I can't get r.tileset to function
at all on a windows system, but it works on linux:
On Aug 16, 2017, at 2:36 AM, Helmut Kudrnovsky <hellik@web.de> wrote:
Moritz Lennert wrote
On 16/08/17 00:48, Steven Pawley wrote:
This seems to be an issue on windows that is related to r.tileset not
r.terrain.texture. Infact on windows I can't get r.tileset to function
at all on a windows system, but it works on linux: