Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Commit

Permalink
Merge branch 'fix-file-version-from-string'
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontaigu committed Jan 9, 2021
2 parents 7cf17de + 2512e18 commit 3f0d6e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pylas/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ def __init__(
version: Optional[Version] = None,
point_format: Optional[PointFormat] = None,
) -> None:
if isinstance(point_format, int):
point_format = PointFormat(point_format)
if isinstance(version, str):
version = Version.from_str(version)

if version is None and point_format is None:
version = LasHeader.DEFAULT_VERSION
point_format = LasHeader.DEFAULT_POINT_FORMAT
Expand Down
3 changes: 0 additions & 3 deletions pylas/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ def create_las(
A new las data object
"""
if isinstance(point_format, int):
point_format = PointFormat(point_format)

header = LasHeader(point_format=point_format, version=file_version)
return LasData(header=header)

Expand Down

0 comments on commit 3f0d6e7

Please sign in to comment.