Skip to content

Commit

Permalink
Merge pull request #49 from open-AIMS/potential-fix-44
Browse files Browse the repository at this point in the history
Early exit on empty query (potential fix for #44)
  • Loading branch information
arlowhite authored Oct 29, 2024
2 parents be2d87b + 4c2750f commit 1bbe34b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/criteria_assessment/query_thresholds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,12 @@ function threshold_mask(
(lons[1] .<= lookup.lons .<= lons[2]) .&
(lat1 .<= lookup.lats .<= lat2)
)

lookup = lookup[within_search, :]
if nrow(lookup) == 0
# Exit as there is no data
return Raster(zeros(0, 0); dims=([0], [0]))
end

# Need to pass in full representation of the raster as the lookup table relies on
# the original Cartesian indices.
Expand Down

0 comments on commit 1bbe34b

Please sign in to comment.