Created
April 9, 2014 14:56
-
-
Save ejc123/10279886 to your computer and use it in GitHub Desktop.
After
This file contains hidden or 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
val results = months.flatMap { | |
month => { | |
val raster = RasterSource(store, s"${month}${year}NDVI_TOA_UTM14") | |
val mask = RasterSource(store, s"${month}${year}ACCA_State_UTM14") | |
val masked = raster.localMask(mask, 1, NODATA) | |
valid.map { | |
g => | |
val polygon = Polygon(g.geom, 0) | |
val coords = Demo.server.get(GetCentroid(polygon)).geom.getCoordinate | |
masked.zonalMean(polygon).run match { | |
case Complete (result, _) => isNoData(result) match { | |
case true => (coords, month, None) | |
case false => (coords, month, Some(math.round(result))) | |
} | |
case _ => (coords, month, None) | |
} | |
} | |
} | |
} |
This file contains hidden or 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
val results = months.flatMap { | |
month => { | |
val raster = RasterSource(store, s"${month}${year}NDVI_TOA_UTM14") | |
val mask = RasterSource(store, s"${month}${year}ACCA_State_UTM14") | |
val masked = raster.localMask(mask, 1, NODATA).run match { | |
case Complete(result, _) => RasterSource(result) | |
} | |
valid.map { | |
g => | |
val polygon = Polygon(g.geom, 0) | |
val coords = Demo.server.get(GetCentroid(polygon)).geom.getCoordinate | |
masked.zonalMean(polygon).run match { | |
case Complete (result, _) => isNoData(result) match { | |
case true => (coords, month, None) | |
case false => (coords, month, Some(math.round(result))) | |
} | |
case _ => (coords, month, None) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gistfile1.txt should be 'After'