7
7
from opendm import types
8
8
from opendm import gsd
9
9
from opendm import orthophoto
10
+ from opendm .osfm import is_submodel
10
11
from opendm .concurrency import get_max_memory_mb
11
12
from opendm .cutline import compute_cutline
12
13
from opendm .utils import double_quote
@@ -114,6 +115,7 @@ def process(self, args, outputs):
114
115
115
116
# Cutline computation, before cropping
116
117
# We want to use the full orthophoto, not the cropped one.
118
+ submodel_run = is_submodel (tree .opensfm )
117
119
if args .orthophoto_cutline :
118
120
cutline_file = os .path .join (tree .odm_orthophoto , "cutline.gpkg" )
119
121
@@ -122,15 +124,18 @@ def process(self, args, outputs):
122
124
cutline_file ,
123
125
args .max_concurrency ,
124
126
scale = 0.25 )
125
-
126
- orthophoto .compute_mask_raster (tree .odm_orthophoto_tif , cutline_file ,
127
- os .path .join (tree .odm_orthophoto , "odm_orthophoto_cut.tif" ),
128
- blend_distance = 20 , only_max_coords_feature = True )
127
+
128
+ if submodel_run :
129
+ orthophoto .compute_mask_raster (tree .odm_orthophoto_tif , cutline_file ,
130
+ os .path .join (tree .odm_orthophoto , "odm_orthophoto_cut.tif" ),
131
+ blend_distance = 20 , only_max_coords_feature = True )
132
+ else :
133
+ log .ODM_INFO ("Not a submodel run, skipping mask raster generation" )
129
134
130
135
orthophoto .post_orthophoto_steps (args , bounds_file_path , tree .odm_orthophoto_tif , tree .orthophoto_tiles , resolution )
131
136
132
137
# Generate feathered orthophoto also
133
- if args .orthophoto_cutline :
138
+ if args .orthophoto_cutline and submodel_run :
134
139
orthophoto .feather_raster (tree .odm_orthophoto_tif ,
135
140
os .path .join (tree .odm_orthophoto , "odm_orthophoto_feathered.tif" ),
136
141
blend_distance = 20
0 commit comments