-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added handling of commodity, yield columns.
New extended GfwProFeatureExt and GfwProFeatureExtId classes. Added option to pass the feature id (which includes the commodity and yield) through to the summary analysis. This requires disabling the optimization where we share full window results if features overlap across whole windows.
- Loading branch information
Showing
10 changed files
with
107 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/scala/org/globalforestwatch/features/GfwProFeatureExt.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.globalforestwatch.features | ||
|
||
// GfwPro Feature that includes commodity and yield columns for GHG analysis. | ||
|
||
object GfwProFeatureExt extends Feature { | ||
val listIdPos = 0 | ||
val locationIdPos = 1 | ||
val geomPos = 2 | ||
val commodityPos = 3 | ||
val yieldPos = 4 | ||
|
||
val featureIdExpr = "list_id as listId, cast(location_id as int) as locationId, commodity as commodity, yield as yield" | ||
|
||
def getFeatureId(i: Array[String], parsed: Boolean = false): FeatureId = { | ||
|
||
val listId: String = i(0) | ||
val locationId: Int = i(1).toInt | ||
val commodity: String = i(2) | ||
val yieldVal: Float = i(3).toFloat | ||
|
||
GfwProFeatureExtId(listId, locationId, commodity, yieldVal) | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/scala/org/globalforestwatch/features/GfwProFeatureExtId.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.globalforestwatch.features | ||
|
||
// GfwPro FeatureId that includes commodity and yield for GHG analysis. | ||
|
||
case class GfwProFeatureExtId(listId: String, locationId: Int, commodity: String, yieldVal: Float) extends FeatureId { | ||
override def toString: String = s"$listId, $locationId, $commodity, $yieldVal" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters