Created
January 27, 2017 18:06
-
-
Save metasim/a7b05a5f1b6012be8691cc8358e6a34f to your computer and use it in GitHub Desktop.
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
| import geotrellis.raster.{ByteConstantTile, MultibandTile} | |
| import geotrellis.spark.io.avro.AvroRecordCodec | |
| import geotrellis.spark.io.avro.codecs.Implicits._ | |
| def codecOf[T: AvroRecordCodec](t: T) = implicitly[AvroRecordCodec[T]] | |
| val tile = MultibandTile( | |
| ByteConstantTile(1, 10, 10), | |
| ByteConstantTile(2, 10, 10), | |
| ByteConstantTile(3, 10, 10) | |
| ) | |
| val codec = codecOf(tile) | |
| val result = codec.encode(tile) | |
| /* | |
| java.lang.RuntimeException: No formats found to support class geotrellis.raster.ByteConstantTile | |
| at scala.sys.package$.error(AvroUnionCodecError.sc:23) | |
| at geotrellis.spark.io.avro.AvroUnionCodec.findFormat(AvroUnionCodecError.sc:49) | |
| at geotrellis.spark.io.avro.AvroUnionCodec.encode(AvroUnionCodecError.sc:31) | |
| at geotrellis.spark.io.avro.codecs.TileCodecs$$anon$9$$anonfun$encode$1.apply(AvroUnionCodecError.sc:345) | |
| at geotrellis.spark.io.avro.codecs.TileCodecs$$anon$9$$anonfun$encode$1.apply(AvroUnionCodecError.sc:345) | |
| at scala.collection.TraversableLike$$anonfun$map$1.apply(AvroUnionCodecError.sc:230) | |
| at scala.collection.TraversableLike$$anonfun$map$1.apply(AvroUnionCodecError.sc:230) | |
| at scala.collection.Iterator$class.foreach(AvroUnionCodecError.sc:889) | |
| at scala.collection.AbstractIterator.foreach(AvroUnionCodecError.sc:1332) | |
| at scala.collection.IterableLike$class.foreach(AvroUnionCodecError.sc:68) | |
| at scala.collection.AbstractIterable.foreach(AvroUnionCodecError.sc:50) | |
| at scala.collection.TraversableLike$class.map(AvroUnionCodecError.sc:230) | |
| at scala.collection.AbstractTraversable.map(AvroUnionCodecError.sc:100) | |
| at geotrellis.spark.io.avro.codecs.TileCodecs$$anon$9.encode(AvroUnionCodecError.sc:345) | |
| at geotrellis.spark.io.avro.codecs.TileCodecs$$anon$9.encode(AvroUnionCodecError.sc:336) | |
| at geotrellis.spark.io.avro.AvroRecordCodec.encode(AvroUnionCodecError.sc:28) | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment