GeoTrellis is a geographic data processing engine for high performance applications.
pomadchin on master
Add rasters S3 write methods (#… (compare)
echeipesh on master
Cleanup GDALDataset, add initia… Cleanup the code Scala 2.11 compat (compare)
resolvers ++= Seq(
"eclipse-releases" at "https://repo.eclipse.org/content/groups/releases",
"eclipse-snapshots" at "https://repo.eclipse.org/content/groups/snapshots"
)
Exception in thread "main" java.lang.ExceptionInInitializerError
at demo.Main$.main(Main.scala:73)
at demo.Main.main(Main.scala)
Caused by: geotrellis.raster.io.geotiff.reader.MalformedGeoTiffException: incorrect byte order
at geotrellis.raster.io.geotiff.reader.GeoTiffInfo$.read(GeoTiffInfo.scala:132)
at geotrellis.raster.io.geotiff.reader.GeoTiffReader$.readMultiband(GeoTiffReader.scala:213)
at geotrellis.raster.geotiff.GeoTiffRasterSource$$anonfun$tiff$1.apply(GeoTiffRasterSource.scala:37)
at geotrellis.raster.geotiff.GeoTiffRasterSource$$anonfun$tiff$1.apply(GeoTiffRasterSource.scala:37)
at scala.Option.getOrElse(Option.scala:121)
at geotrellis.raster.geotiff.GeoTiffRasterSource.tiff$lzycompute(GeoTiffRasterSource.scala:37)
at geotrellis.raster.geotiff.GeoTiffRasterSource.tiff(GeoTiffRasterSource.scala:34)
at geotrellis.raster.geotiff.GeoTiffRasterSource.gridExtent$lzycompute(GeoTiffRasterSource.scala:55)
at geotrellis.raster.geotiff.GeoTiffRasterSource.gridExtent(GeoTiffRasterSource.scala:55)
at geotrellis.raster.RasterMetadata$class.extent(RasterMetadata.scala:52)
at geotrellis.raster.RasterSource.extent(RasterSource.scala:44)
at demo.package$.<init>(package.scala:16)
at demo.package$.<clinit>(package.scala)
libraryDependencies ++= Seq(
"org.locationtech.geotrellis" %% "geotrellis-raster" % "3.2.1-SNAPSHOT",
"org.locationtech.geotrellis" %% "geotrellis-spark" % "3.2.1-SNAPSHOT",
"org.apache.spark" %% "spark-core" % "2.2.0" % Provided,
"org.scalatest" %% "scalatest" % "2.2.0" % Test
)
Hi! I have 2-3 geotiffs that overlap for a single tile. The three geotiffs are adjacent to one another in their extents (i.e not overlapping).
I am using the MosaicRasterSource
to attempt to create the tile from the 2-3 geotiffs. My code looks like this:
// Results in java.lang.ArrayIndexOutOfBoundsException: null
mosaic.reproject(targetCRS, strategy=Auto(0)).read(key.extent(layout))
I have also tried this code:
mosaic.reproject(targetCRS, strategy=Auto(0)).tileToLayout(layout).read(key)
Which results in this error:
java.lang.IllegalArgumentException: requirement failed: chunk at GridBounds(0,0,255,17946) exceeds tile boundary at (256, 256)
val rasterSources: Option[NonEmptyList[RasterSource]] = NonEmptyList.fromList(rs.toList)
val mosaic = rasterSources match {
case Some(x) =>
val gridExtents = rs.head.gridExtent combine rs.toList(1).gridExtent
MosaicRasterSource(x, requestScheme.crs, gridExtents)
case None => throw new InternalError("Unable to create mosaic")
}
rs
is passed into this function as Iterable[RasterSource]
oh right so you are also getting Nons by reading keys that should be there?
Yeah, the three geotiffs are adjacent and when I create them individually in RasterSource
it returns a partial tile with a black band when i use renderJpg
or clear with renderPng
. Hopefully that helps you debug the issue at all in the future :)
📣📣 If you're a user of RasterFrames (the love-child of GeoTrellis & Spark SQL) and would like to see it kept up to date with the latest versions of Spark and JVM technologies, there's a small favor you could do us to help. Go to issue SPARK-7768 and vote for it.
The TL;DR of it is that RasterFrames and GeoMesa (and other frameworks built on Spark using UDTs) use a non-sustainable hack to register the types with Spark. This hack would no longer be required if the Spark committers changed literally one line of code. This ticket has been open since 2015 against Spark 1.5 and keeps getting pushed to the next release.
Regrettably, to vote for the issue you have to create an account on the Spark Jira system, but my hope is that collectively overcoming that small bit of friction will reap larger rewards.