- Timestamp:
- Jan 13, 2019, 6:17:04 PM (8 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 9e4d815
- Parents:
- 26d66d8
- File:
-
- 1 edited
-
src/python/bin/gnuboat-log-analyser (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/python/bin/gnuboat-log-analyser
r26d66d8 r403e4ed 243 243 for depth in colors: 244 244 color_config.write("{} {}\n".format(depth, colors[depth])) 245 gdal.DEMProcessing(gdal_file_color_relief, gdal_file, "color-relief", options = gdal.DEMProcessingOptions(format = "GTiff", colorFilename = gdal_file_color_relief_config) )245 gdal.DEMProcessing(gdal_file_color_relief, gdal_file, "color-relief", options = gdal.DEMProcessingOptions(format = "GTiff", colorFilename = gdal_file_color_relief_config), addAlpha = True) 246 246 print(" Created color relief in {}".format(gdal_file_color_relief)) 247 247 248 248 # slopeshade 249 gdal_file_slope_shade_tmp = "/vsimem/tmp_water_depth_slope_shade.tif" 250 gdal_file_slope_shade = os.path.join(output_directory, "water_depth_slope_shade.tif") 251 gdal_file_slope_shade_config = os.path.join(output_directory, "tmp_water_depth_slope_shade_config.txt") 252 with open(gdal_file_slope_shade_config, 'w') as shade_config: 249 gdal_file_slopeshade_tmp = "/vsimem/tmp_water_depth_slopeshade.tif" 250 gdal_file_slopeshade_config = os.path.join(output_directory, "tmp_water_depth_slopeshade_config.txt") 251 with open(gdal_file_slopeshade_config, 'w') as shade_config: 253 252 shade_config.write("0 255 255 255\n") 254 253 shade_config.write("90 0 0 0\n") 255 gdal.DEMProcessing(gdal_file_slope _shade_tmp, gdal_file, "slope", options = gdal.DEMProcessingOptions(format = "GTiff"))256 gdal.DEMProcessing(gdal_file_slope _shade, gdal_file_slope_shade_tmp, "color-relief", options = gdal.DEMProcessingOptions(format = "GTiff", colorFilename = gdal_file_slope_shade_config))257 print(" Created slope shade in {}".format(gdal_file_slope _shade))254 gdal.DEMProcessing(gdal_file_slopeshade_tmp, gdal_file, "slope", options = gdal.DEMProcessingOptions(format = "GTiff"), slopeFormat = 'degree', zeroForFlat = True, addAlpha = True) 255 gdal.DEMProcessing(gdal_file_slopeshade, gdal_file_slopeshade_tmp, "color-relief", options = gdal.DEMProcessingOptions(format = "GTiff", colorFilename = gdal_file_slopeshade_config), addAlpha = True) 256 print(" Created slope shade in {}".format(gdal_file_slopeshade)) 258 257 259 258 260 259 # generate contour lines 261 # @todo not useful in this configuration!260 # @todo Cut Tifs / warp 262 261 contour_input = gdal.Open(gdal_file, gdalconst.GA_ReadOnly) 263 262 contour_input_band = contour_input.GetRasterBand(1) … … 276 275 contour_output = None 277 276 del contour_output 277 278 #overlaid = gdal.Warp(gdal_file_slopeshade, [color_relief, hillshade], format='GTiff') 279 ##gdal.Translate(gdal_file_slopeshade, overlaid, creationOptions=['compress=LZW', 'alpha=yes']) 280 #gdal.Translate(gdal_file_slopeshade, overlaid, creationOptions=['alpha=yes']) 281 gdal.Warp('/tmp/gnuboat/test.tif', gdal_file_color_relief, options = gdal.WarpOptions(format = 'GTiff', dstAlpha = True, cutlineDSName = '/tmp/gnuboat/contours/contour-0.shp')) 282 #gdal.Warp('/tmp/gnuboat/test.tif', gdal_file_color_relief, options = gdal.WarpOptions(format = 'GTiff', dstAlpha = True)) 278 283 279 284 # generate tiles … … 285 290 {"file": gdal_file_color_relief, "title": 'Color relief', "output": 'color_relief'}, 286 291 #slopeshade 287 {"file": gdal_file_slope _shade, "title": 'Slopeshade', "output": 'slopeshade'}292 {"file": gdal_file_slopeshade, "title": 'Slopeshade', "output": 'slopeshade'} 288 293 ] 289 294 print("Expanding {} tifs to tiles".format(len(tile_commands)))
Note:
See TracChangeset
for help on using the changeset viewer.
