Skip to content

Commit

Permalink
Fix #33
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Feb 12, 2019
1 parent 984db8c commit 22277a1
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: rlas
Type: Package
Title: Read and Write 'las' and 'laz' Binary File Formats Used for Remote Sensing Data
Version: 1.3.1
Date: 2019-02-08
Version: 1.3.2
Date: 2019-02-12
Authors@R: c(
person("Jean-Romain", "Roussel", email = "jean-romain.roussel.1@ulaval.ca", role = c("aut", "cre", "cph")),
person("Florian", "De Boissieu", email = "", role = c("aut", "ctb"), comment = "Enable the support of .lax file and extra byte attributes"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### rlas v1.3.2 (Release date: )

* Fix: [#33](https://github.com/Jean-Romain/rlas/issues/33) it is now allowed to write ScanAngleRank above 90 degrees but not above 127 degrees.

### rlas v1.3.1 (Release date: 2019-02-08)

* Fix: valgrind - Conditionnal jump on uninitialized value (consequentless for users)
Expand Down
1 change: 1 addition & 0 deletions R/check_content.r
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ check_las_compliance = function(header, data)
is_compliant_ReturnNumber(data, "warning")
is_compliant_NumberOfReturns(data, "warning")
is_compliant_RGB(data, "warning")
is_compliant_ScanAngleRank(data, "warning")
is_compliant_ReturnNumber_vs_NumberOfReturns(data, "warning")
is_XY_larger_than_bbox(header, data, "warning")
is_valid_scalefactors(header, behavior = "warning")
Expand Down
26 changes: 22 additions & 4 deletions R/las_specifications.r
Original file line number Diff line number Diff line change
Expand Up @@ -633,11 +633,11 @@ is_valid_ScanAngleRank = function(data, behavior = "bool")
if (is.null(data[["ScanAngleRank"]]))
return(error_handling_engine(errors, behavior))

if (min(data[["ScanAngleRank"]]) < -90)
errors = append(errors, "Invalid data: ScanAngleRank greater than -90 degrees.")
if (min(data[["ScanAngleRank"]]) < -127)
errors = append(errors, "Invalid data: ScanAngleRank greater than -127 degrees.")

if (max(data[["ScanAngleRank"]]) > 90)
errors = append(errors, "Invalid data: ScanAngleRank greater than 90 degrees")
if (max(data[["ScanAngleRank"]]) > 127)
errors = append(errors, "Invalid data: ScanAngleRank greater than 127 degrees")

return(error_handling_engine(errors, behavior))
}
Expand Down Expand Up @@ -831,6 +831,24 @@ is_compliant_RGB = function(data, behavior = "bool")
return(error_handling_engine(errors, behavior))
}

#' @export
#' @rdname las_specification_tools
is_compliant_ScanAngleRank = function(data, behavior = "bool")
{
errors = character(0)

if (is.null(data[["ScanAngleRank"]]))
return(error_handling_engine(errors, behavior))

if (min(data[["ScanAngleRank"]]) < -90)
errors = append(errors, "Invalid data: ScanAngleRank greater than -90 degrees.")

if (max(data[["ScanAngleRank"]]) > 90)
errors = append(errors, "Invalid data: ScanAngleRank greater than 90 degrees")

return(error_handling_engine(errors, behavior))
}

# ===== DATA vs. HEADER ====

#' @export
Expand Down

0 comments on commit 22277a1

Please sign in to comment.