Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into gtc-3055
Browse files Browse the repository at this point in the history
  • Loading branch information
danscales committed Jan 24, 2025
2 parents 6856c00 + 2315a4b commit 1656df0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
distribution: temurin
java-version: 11.0.19

- name: Setup sbt launcher
uses: sbt/setup-sbt@v1

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import math.ceil
import org.apache.spark.sql.{Column, DataFrame, SparkSession}
import org.globalforestwatch.summarystats.SummaryExport
import org.globalforestwatch.util.Util.getAnyMapValue
import java.time.LocalDate
import java.time.format.DateTimeFormatter

object FireAlertsExport extends SummaryExport {

Expand Down Expand Up @@ -39,9 +41,11 @@ object FireAlertsExport extends SummaryExport {
gadmDF.cache()

// only export all points for viirs gadm
val twoYearsAgo = LocalDate.now().minusYears(2)
if (fireAlertType == "viirs") {
gadmDF
.coalesce(Integer.min(300, ceil (numPartitions / 20.0).toInt))
.filter($"alert__date" >= twoYearsAgo.format(DateTimeFormatter.ISO_LOCAL_DATE))
.write
.options (csvOptions)
.csv (path = outputUrl + "/all")
Expand Down

0 comments on commit 1656df0

Please sign in to comment.