@@ -603,4 +603,36 @@ class RasterCommands implements CommandMarker {
603
603
}
604
604
}
605
605
606
+ @CliCommand (value = " raster shadedrelief" , help = " Create a shaded relief raster" )
607
+ String shadedRelief (
608
+ @CliOption (key = " name" , mandatory = true , help = " The Raster name" ) RasterName name ,
609
+ @CliOption (key = " output-format" , mandatory = true , help = " The output Format Workspace" ) FormatName formatName ,
610
+ @CliOption (key = " output-name" , mandatory = false , help = " The output Raster name" ) String outputRasterName ,
611
+ @CliOption (key = " scale" , mandatory = true , help = " The scale" ) double scale ,
612
+ @CliOption (key = " altitude" , mandatory = true , help = " The altitude" ) double altitude ,
613
+ @CliOption (key = " azimuth" , mandatory = true , help = " The azimuth" ) double azimuth ,
614
+ @CliOption (key = " resx" , mandatory = false , specifiedDefaultValue = " 0.5" , unspecifiedDefaultValue = " 0.5" , help = " The x resolution" ) double resX ,
615
+ @CliOption (key = " resy" , mandatory = false , specifiedDefaultValue = " 0.5" , unspecifiedDefaultValue = " 0.5" , help = " The y resolution" ) double resY ,
616
+ @CliOption (key = " zetafactory" , mandatory = false , specifiedDefaultValue = " 1.0" , unspecifiedDefaultValue = " 1.0" , help = " The zeta factory" ) double zetaFactory ,
617
+ @CliOption (key = " algorithm" , mandatory = false , specifiedDefaultValue = " DEFAULT" , unspecifiedDefaultValue = " DEFAULT" , help = " The x resolution" ) String algorithm
618
+ ) throws Exception {
619
+ Raster raster = catalog. rasters[name]
620
+ if (raster) {
621
+ Format format = catalog. formats[formatName]
622
+ if (format) {
623
+ Raster shadedReliefRaster = raster. createShadedRelief(scale, altitude, azimuth, resX : resX, resY : resY, zetaFactory : zetaFactory, algorithm : algorithm)
624
+ format. write(shadedReliefRaster)
625
+ if (! outputRasterName) {
626
+ outputRasterName = formatName. name
627
+ }
628
+ catalog. rasters[new RasterName (outputRasterName)] = format. read(outputRasterName)
629
+ " Create shaded relief ${ outputRasterName} from ${ name} !"
630
+ } else {
631
+ " Unable to find Raster Format ${ formatName} "
632
+ }
633
+ } else {
634
+ " Unable to find Raster ${ name} "
635
+ }
636
+ }
637
+
606
638
}
0 commit comments