Skip to content

Commit

Permalink
fix: better error handling when missing input srs
Browse files Browse the repository at this point in the history
  • Loading branch information
peppsac committed Oct 18, 2018
1 parent 41ddfed commit 85b1370
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions py3dtiles/command_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import py3dtiles.info as info
import py3dtiles.merger as merger
import py3dtiles.export as export
import traceback

# https://stackoverflow.com/a/43357954
def str2bool(v):
Expand Down Expand Up @@ -44,8 +45,8 @@ def main():
else:
parser.print_help()
except Exception as e:
print(e)
print()
traceback.print_exc()
print('')
parser.print_help()

if __name__ == '__main__':
Expand Down
8 changes: 3 additions & 5 deletions py3dtiles/points/task/las_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ def init(args):
if (args.srs_out is not None and
input_srs is None):
f = liblas.file.File(filename)
if f.header.srs.proj4 is not None:
if (f.header.srs.proj4 is not None and
f.header.srs.proj4 != ''):
input_srs = pyproj.Proj(f.header.srs.proj4)
else:
print('''
Error.
{} file doesn\'t contain srs information. Please use the --srs_in option to declare it.
'''.format(filename))
raise Exception('\'{}\' file doesn\'t contain srs information. Please use the --srs_in option to declare it.'.format(filename))

return {
'portions': pointcloud_file_portions,
Expand Down

0 comments on commit 85b1370

Please sign in to comment.