Skip to content

Commit 69f72df

Browse files
committed
PR feedback. Regression fix. Release notes update.
1 parent 45ed7e9 commit 69f72df

File tree

5 files changed

+23
-108
lines changed

5 files changed

+23
-108
lines changed

core/src/main/scala/org/locationtech/rasterframes/expressions/aggregates/TileRasterizerAggregate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ object TileRasterizerAggregate {
138138
}
139139
}
140140

141-
// Scan table and constuct what the TileLayerMetadata would be in the specified destination CRS.
141+
// Scan table and construct what the TileLayerMetadata would be in the specified destination CRS.
142142
val tlm: TileLayerMetadata[SpatialKey] = df
143143
.select(
144144
ProjectedLayerMetadataAggregate(

core/src/test/resources/MCD43A4.A2019111.h30v06.006.2019120033434_01.mrf.aux.xml

Lines changed: 0 additions & 92 deletions
This file was deleted.

datasource/src/main/scala/org/locationtech/rasterframes/datasource/geotiff/GeoTiffDataSource.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class GeoTiffDataSource
4949

5050
def shortName() = GeoTiffDataSource.SHORT_NAME
5151

52+
/** Read single geotiff as a relation. */
5253
def createRelation(sqlContext: SQLContext, parameters: Map[String, String]) = {
5354
require(parameters.path.isDefined, "Valid URI 'path' parameter required.")
5455
sqlContext.withRasterFrames
@@ -57,6 +58,7 @@ class GeoTiffDataSource
5758
GeoTiffRelation(sqlContext, p)
5859
}
5960

61+
/** Write dataframe containing bands into a single geotiff. Note: performs a driver collect, and is not "big data" friendly. */
6062
override def createRelation(sqlContext: SQLContext, mode: SaveMode, parameters: Map[String, String], df: DataFrame): BaseRelation = {
6163
require(parameters.path.isDefined, "Valid URI 'path' parameter required.")
6264
val path = parameters.path.get
@@ -67,8 +69,6 @@ class GeoTiffDataSource
6769

6870
require(tileCols.nonEmpty, "Could not find any tile columns.")
6971

70-
71-
7272
val destCRS = parameters.crs.orElse(df.asLayerSafely.map(_.crs)).getOrElse(
7373
throw new IllegalArgumentException("A destination CRS must be provided")
7474
)

datasource/src/test/scala/org/locationtech/rasterframes/datasource/geotiff/GeoTiffDataSourceSpec.scala

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,29 +192,36 @@ class GeoTiffDataSourceSpec
192192
}
193193

194194
it("should write GeoTIFF without layer") {
195-
196195
val pr = col("proj_raster_b0")
197-
val rf = spark.read.raster.withBandIndexes(0, 1, 2).load(rgbCogSamplePath.toASCIIString)
198196

199-
val out = Paths.get("target", "example2-geotiff.tif")
200-
logger.info(s"Writing to $out")
197+
val sample = rgbCogSample
198+
val expectedExtent = sample.extent
199+
val (expCols, expRows) = sample.tile.dimensions
201200

202-
withClue("explicit extent/crs") {
201+
val rf = spark.read.raster.withBandIndexes(0, 1, 2).load(rgbCogSamplePath.toASCIIString)
202+
203+
withClue("extent/crs columns provided") {
204+
val out = Paths.get("target", "example2a-geotiff.tif")
203205
noException shouldBe thrownBy {
204206
rf
205207
.withColumn("extent", rf_extent(pr))
206208
.withColumn("crs", rf_crs(pr))
207-
.write.geotiff.withCRS(LatLng).save(out.toString)
209+
.write.geotiff.withCRS(sample.crs).save(out.toString)
210+
checkTiff(out, expCols, expRows, expectedExtent, Some(sample.cellType))
208211
}
209212
}
210213

211-
withClue("without explicit extent/crs") {
214+
withClue("without extent/crs columns") {
215+
val out = Paths.get("target", "example2b-geotiff.tif")
212216
noException shouldBe thrownBy {
213217
rf
214-
.write.geotiff.withCRS(LatLng).save(out.toString)
218+
.write.geotiff.withCRS(sample.crs).save(out.toString)
219+
checkTiff(out, expCols, expRows, expectedExtent, Some(sample.cellType))
215220
}
216221
}
222+
217223
withClue("with downsampling") {
224+
val out = Paths.get("target", "example2c-geotiff.tif")
218225
noException shouldBe thrownBy {
219226
rf
220227
.write.geotiff
@@ -223,9 +230,6 @@ class GeoTiffDataSourceSpec
223230
.save(out.toString)
224231
}
225232
}
226-
227-
checkTiff(out, 128, 128,
228-
Extent(-76.52586750038186, 36.85907177863949, -76.17461216980891, 37.1303690755922))
229233
}
230234

231235
it("should produce the correct subregion from layer") {

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44

55
### 0.8.4
66

7-
* _Breaking_ (potentially): removed `GeoTiffCollectionRelation` due to usage limitation and overlap with `RasterSourceDataSource` functionality.
87
* Upgraded to Spark 2.4.4
9-
* Add `rf_local_is_in` raster function
8+
* Added forced truncation of WKT types in Markdown/HTML rendering. ([#408](https://github.com/locationtech/rasterframes/pull/408))
9+
* Add `rf_local_is_in` raster function. ([#400](https://github.com/locationtech/rasterframes/pull/400))
10+
* Added partitioning to catalogs before processing in RasterSourceDataSource ([#397](https://github.com/locationtech/rasterframes/pull/397))
11+
* Fixed bug where `rf_tile_dimensions` would cause unnecessary reading of tiles. ([#394](https://github.com/locationtech/rasterframes/pull/394))
12+
* _Breaking_ (potentially): removed `GeoTiffCollectionRelation` due to usage limitation and overlap with `RasterSourceDataSource` functionality.
1013

1114
### 0.8.3
1215

0 commit comments

Comments
 (0)