-
Notifications
You must be signed in to change notification settings - Fork 7
/
_test_crim.py
59 lines (49 loc) · 3.53 KB
/
_test_crim.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import rvt.default
import rvt.blend_func
import rvt.blend
import rvt.vis
import numpy as np
# Test color relief image map (CRIM)
dem_path = r"D:\RVT_py\test\CRIM_TEST\Skolj_dem_05m.tif"
dem_dict = rvt.default.get_raster_arr(dem_path)
dem_arr = dem_dict["array"]
dem_res = dem_dict["resolution"][0]
output_srrim_path = "{}_{}.tif".format(dem_path.rstrip(".tif"), "crim_reds")
rendered_image = rvt.blend.color_relief_image_map(dem=dem_arr, resolution=dem_res, colormap="Reds_r",
min_colormap_cut=0.5, max_colormap_cut=1)
rvt.default.save_raster(src_raster_path=dem_path, out_raster_arr=rendered_image, out_raster_path=output_srrim_path,
e_type=6)
output_srrim_path = "{}_{}.tif".format(dem_path.rstrip(".tif"), "crim_blues")
rendered_image = rvt.blend.color_relief_image_map(dem=dem_arr, resolution=dem_res, colormap="Blues_r",
min_colormap_cut=0.5, max_colormap_cut=1)
rvt.default.save_raster(src_raster_path=dem_path, out_raster_arr=rendered_image, out_raster_path=output_srrim_path,
e_type=6)
output_srrim_path = "{}_{}.tif".format(dem_path.rstrip(".tif"), "crim_purples")
rendered_image = rvt.blend.color_relief_image_map(dem=dem_arr, resolution=dem_res, colormap="Purples_r",
min_colormap_cut=0.5, max_colormap_cut=1)
rvt.default.save_raster(src_raster_path=dem_path, out_raster_arr=rendered_image, out_raster_path=output_srrim_path,
e_type=6)
output_srrim_path = "{}_{}.tif".format(dem_path.rstrip(".tif"), "crim_oranges")
rendered_image = rvt.blend.color_relief_image_map(dem=dem_arr, resolution=dem_res, colormap="Oranges_r",
min_colormap_cut=0.5, max_colormap_cut=1)
rvt.default.save_raster(src_raster_path=dem_path, out_raster_arr=rendered_image, out_raster_path=output_srrim_path,
e_type=6)
output_srrim_path = "{}_{}.tif".format(dem_path.rstrip(".tif"), "crim_YlOrBr")
rendered_image = rvt.blend.color_relief_image_map(dem=dem_arr, resolution=dem_res, colormap="YlOrBr_r")
rvt.default.save_raster(src_raster_path=dem_path, out_raster_arr=rendered_image, out_raster_path=output_srrim_path,
e_type=6)
output_srrim_path = "{}_{}.tif".format(dem_path.rstrip(".tif"), "crim_coolwarm")
rendered_image = rvt.blend.color_relief_image_map(dem=dem_arr, resolution=dem_res, colormap="coolwarm_r",
min_colormap_cut=0.2, max_colormap_cut=0.8)
rvt.default.save_raster(src_raster_path=dem_path, out_raster_arr=rendered_image, out_raster_path=output_srrim_path,
e_type=6)
output_srrim_path = "{}_{}.tif".format(dem_path.rstrip(".tif"), "crim_hot")
rendered_image = rvt.blend.color_relief_image_map(dem=dem_arr, resolution=dem_res, colormap="hot_r",
min_colormap_cut=0.4, max_colormap_cut=0.6)
rvt.default.save_raster(src_raster_path=dem_path, out_raster_arr=rendered_image, out_raster_path=output_srrim_path,
e_type=6)
output_srrim_path = "{}_{}.tif".format(dem_path.rstrip(".tif"), "crim_RdYlBu")
rendered_image = rvt.blend.color_relief_image_map(dem=dem_arr, resolution=dem_res, colormap="RdYlBu",
min_colormap_cut=0.1, max_colormap_cut=0.9)
rvt.default.save_raster(src_raster_path=dem_path, out_raster_arr=rendered_image, out_raster_path=output_srrim_path,
e_type=6)