Skip to content

Commit

Permalink
Rearrange checks
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Mar 21, 2023
1 parent 4aa83c9 commit b404366
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions opendm/opc.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ def classify(point_cloud):

if model is not None:
run('pcclassify "%s" "%s" "%s" -u -s 2,64' % (point_cloud, tmp_output, model))

if os.path.isfile(tmp_output):
os.remove(point_cloud)
os.rename(tmp_output, point_cloud)
else:
log.ODM_WARNING("Cannot classify using OpenPointClass (no output generated)")
else:
log.ODM_WARNING("Cannot download/access model from %s" % (model_url))

except Exception as e:
log.ODM_WARNING("Cannot classify using OpenPointClass: %s" % str(e))

if os.path.isfile(tmp_output):
os.remove(point_cloud)
os.rename(tmp_output, point_cloud)
else:
log.ODM_WARNING("Cannot classify using OpenPointClass (no output generated)")

0 comments on commit b404366

Please sign in to comment.