Skip to content

Commit 405c35e

Browse files
committed
Merge branch 'release/0.7.1'
2 parents c2a71b0 + f49e039 commit 405c35e

File tree

17 files changed

+117
-94
lines changed

17 files changed

+117
-94
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Please see the [Getting Started](http://rasterframes.io/getting-started.html) se
1111

1212
## Documentation
1313

14-
* [Giter8 Template](https://github.com/s22s/raster-frames.g8) (i.e. `sbt new s22s/raster-frames.g8`)
1514
* [Users' Manual](http://rasterframes.io/)
1615
* [API Documentation](http://rasterframes.io/latest/api/index.html)
1716
* [List of available UDFs](http://rasterframes.io/latest/api/index.html#astraea.spark.rasterframes.RasterFunctions)
17+
* [RasterFrames Jupyter Notebook Docker Image](https://hub.docker.com/r/s22s/rasterframes-notebooks/)
1818

1919
## Copyright and License
2020

build.sbt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ lazy val datasource = project
2424
.disablePlugins(SparkPackagePlugin)
2525

2626
lazy val experimental = project
27-
.dependsOn(core % "test->test;compile->compile")
28-
.dependsOn(datasource % "test->test;compile->compile")
27+
.configs(IntegrationTest)
28+
.settings(Defaults.itSettings)
29+
.dependsOn(core % "test->test;it->test;compile->compile")
30+
.dependsOn(datasource % "test->test;it->test;compile->compile")
2931
.disablePlugins(SparkPackagePlugin)
3032

3133
lazy val docs = project

core/src/main/scala/astraea/spark/rasterframes/util/MultibandRender.scala

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ object MultibandRender {
6363

6464
/** Base type for Rendering profiles. */
6565
trait Profile {
66+
/** Expected number of bands. */
67+
def expectedBands: Int = 3
68+
6669
/** Value from -255 to 255 */
6770
def brightness: Int = 0
6871
/** Value from -255 to 255 */
@@ -102,6 +105,8 @@ object MultibandRender {
102105
compressRange _ andThen colorAdjust
103106

104107
def render(tile: MultibandTile) = {
108+
require(expectedBands <= tile.bandCount, s"Need at least $expectedBands bands (${tile.bandCount} provided).")
109+
105110
val r = applyAdjustment(red(tile))
106111
val g = applyAdjustment(green(tile))
107112
val b = applyAdjustment(blue(tile))
@@ -128,8 +133,11 @@ object MultibandRender {
128133
}
129134

130135
case class ColorRampProfile(ramp: ColorRamp) extends Profile {
136+
override def expectedBands: Int = 1
131137
// Are there other ways to use the other bands?
132-
override def render(tile: MultibandTile): Png =
133-
colorAdjust(tile.band(0)).renderPng(ramp)
138+
override def render(tile: MultibandTile): Png = {
139+
require(tile.bandCount >= 1, s"Need at least 1 band")
140+
applyAdjustment(tile.band(0)).renderPng(ramp)
141+
}
134142
}
135143
}

docs/src/main/tut/release-notes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## 0.7.x
44

5+
### 0.7.1
6+
7+
* Fixed ColorRamp pipeline in MultibandRender
8+
* Fixed Python wrapper for `explodeTiles`
9+
510
### 0.7.0
611

712
* Now an incubating project under Eclipse Foundation LocationTech! GitHub repo moved to [locationtech/rasterframes](https://github.com/locationtech/rasterframes).

experimental/build.sbt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,8 @@ libraryDependencies ++= Seq(
55
spark("core").value % Provided,
66
spark("mllib").value % Provided,
77
spark("sql").value % Provided
8-
)
8+
)
9+
10+
fork in IntegrationTest := true
11+
javaOptions in IntegrationTest := Seq("-Xmx2G")
12+
parallelExecution in IntegrationTest := false

experimental/src/main/scala/astraea/spark/rasterframes/experimental/datasource/awspds/MODISCatalogDataSource.scala

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,9 @@ object MODISCatalogDataSource extends LazyLogging with ResourceCacheSupport {
6868
val MCD43A4_BASE = "https://modis-pds.s3.amazonaws.com/MCD43A4.006/"
6969
override def maxCacheFileAgeHours: Int = Int.MaxValue
7070

71-
// As of 5/6/2018, these days are missing from AWS.
72-
private val blacklist = Seq(
73-
"2018-03-07",
74-
"2018-03-08",
75-
"2018-03-09",
76-
"2018-03-10",
77-
"2018-03-11",
78-
"2018-03-12",
79-
"2018-03-13",
80-
"2018-03-14",
81-
"2018-03-15",
82-
"2018-02-27",
83-
"2018-02-28",
84-
"2018-03-01",
85-
"2018-03-02",
86-
"2018-03-03",
87-
"2018-03-04",
88-
"2018-04-27",
89-
"2018-03-05",
90-
"2018-04-28",
91-
"2018-03-06",
92-
"2018-04-29",
93-
"2018-04-30",
94-
"2018-05-01",
95-
"2018-05-02",
96-
"2018-05-03",
97-
"2018-05-04",
98-
"2018-05-05",
99-
"2018-05-06"
71+
// List of missing days
72+
private val blacklist = Seq[String](
73+
//"2018-05-06"
10074
)
10175

10276
private def sceneFiles(start: LocalDate, end: LocalDate, useBlacklist: Boolean) = {

experimental/src/main/scala/astraea/spark/rasterframes/experimental/datasource/awspds/MODISCatalogRelation.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ case class MODISCatalogRelation(sqlContext: SQLContext, sceneList: HadoopPath)
5353
def buildScan(): RDD[Row] = {
5454
import sqlContext.implicits._
5555

56-
logger.info("Scene file is: " + sceneList)
56+
logger.debug("Scene file is: " + sceneList)
5757
val catalog = sqlContext.read
5858
.option("header", "true")
5959
.option("mode", "DROPMALFORMED") // <--- mainly for the fact that we have internal headers from the concat

experimental/src/main/scala/astraea/spark/rasterframes/experimental/slippy/SlippyExport.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import java.io.PrintStream
2424
import java.net.URI
2525

2626
import astraea.spark.rasterframes._
27-
import astraea.spark.rasterframes.util.MultibandRender.ColorRampProfile
2827
import astraea.spark.rasterframes.util._
2928
import geotrellis.proj4.{LatLng, WebMercator}
3029
import geotrellis.raster._
@@ -116,13 +115,13 @@ trait SlippyExport extends MethodExtensions[RasterFrame]{
116115

117116
val (zoom, reprojected) = inputRDD.reproject(WebMercator, layoutScheme, Bilinear)
118117
val writer = new HadoopSlippyTileWriter[MultibandTile](dest.toASCIIString + "/" + tileDirName, "png")({ (_, tile) =>
119-
require(tile.bandCount >= 3 || renderer.isInstanceOf[ColorRampProfile],
120-
"Single-band and dual-band RasterFrames require a ColorRampProfile for rendering")
118+
//require(tile.bandCount >= 3 || renderer.isInstanceOf[ColorRampProfile],
119+
// "Single-band and dual-band RasterFrames require a ColorRampProfile for rendering")
121120
val png = renderer.render(tile)
122121
png.bytes
123122
})
124123

125-
val center = reprojected.metadata.extent.center.reproject(WebMercator, LatLng)
124+
val center = reprojected.metadata.extent.center
126125

127126
SlippyExport.writeHtml(dest, sc.hadoopConfiguration, Map(
128127
"maxZoom" -> zoom.toString,

pyrasterframes/build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ ivyPaths in pysparkCmd := ivyPaths.value.withIvyHome(target.value / "ivy")
153153
pyTest := {
154154
val _ = assembly.value
155155
val s = streams.value
156+
s.log.info("Running python tests...")
156157
val wd = pythonSource.value
157158
Process("python setup.py test", wd) ! s.log
158159
}

pyrasterframes/python/geomesa_pyspark/spark.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@
1212
from pyspark.sql.types import UserDefinedType
1313
from pyspark.sql import Row
1414
from pyspark.sql.types import *
15-
from pyrasterframes.context import _checked_context
15+
from pyrasterframes.context import RFContext
1616

1717

1818
__all__ = ['GeometryUDT']
1919

20-
2120
class GeometryUDT(UserDefinedType):
2221
"""User-defined type (UDT).
2322
@@ -41,4 +40,4 @@ def serialize(self, obj):
4140
return Row(obj.toBytes)
4241

4342
def deserialize(self, datum):
44-
return _checked_context().generateGeometry(datum[0])
43+
return RFContext._jvm_mirror().generateGeometry(datum[0])

0 commit comments

Comments
 (0)