GeoTrellis is a geographic data processing engine for high performance applications.
pomadchin on master
Expose Charset in a ShapeFileRe… (compare)
reproject
a MultibandTileLayerRDD
?def run(implicit sc: SparkContext): Unit = {
val inputRdd: RDD[RasterSource] = {
sc.parallelize(inputPath, inputPath.length)
.map(uri => RasterSource(uri))
.cache()
}
val layoutScheme = ZoomedLayoutScheme(WebMercator, tileSize = 256)
val summary = RasterSummary.fromRDD(inputRdd)
val LayoutLevel(zoom, layout) = summary.levelFor(layoutScheme)
val tiled:MultibandTileLayerRDD[SpatialKey] = RasterSourceRDD
.tiledLayerRDD(inputRdd, layout)
// We need to reproject the tiles to WebMercator
// TileRDDReproject(tiled, WebMercator, layoutScheme, Some(Bilinear))
val attributeStore = FileAttributeStore(outputPath)
val writer = FileLayerWriter(attributeStore)
Pyramid.fromLayerRDD(tiled, Some(zoom), Some(0)).write("landsat",
writer,
ZCurveKeyIndexMethod)
}
Hey! Didn’t have a chance to look into your question but will do so shortly
@pomadchin Thx! Would you like to conclude all the ways to ingest/output geotiffs and do ETL things? According to my exploring on the internet, there may have three ways like 1) RasterLayerRDD func 2) MAML 3) pipeline DSL. Where could I find a new DEMO with GT3.x on some web attributes?
hey @stjimreal;
we wanted to avoid terms ETL and to provide a good syntax so it is easy to build own pipelines.
RasterSources syntax and DSL is some sort of a nice replacement to the ETL.
However, Pipeline project is the closes to the old ETL one.
MAML is about lazy raster and rdds transformations
GT server uses GT 3.6 https://github.com/geotrellis/geotrellis-server/tree/main/stac-example
@chdsb okay, and you would like to use smth like sc.hadoopTemporalGeoTiffRDD
but to pass time somehow different rather than setting TIFF tags.
You could use HadoopGeoTiffRDD.singleband directly:
Where I = ProjectedExtent
and K = TemporalProjectedExtent
; the function you’re interested in is uriToKey: (URI, I) => K
you can get the temporal information from the path (that used to be one of the ways temporal metadata could be encoded) of the tiff and add it to the SpatialComponent
what errors do you have? but typically that means that or you’re pointing to a wrong file or smth else is happening
What gt version are you also on?
I'm running into the issue discussed in this bug: https://github.com/locationtech/geotrellis/issues/3184#issuecomment-595326991
The same read issue happens to me randomly (though not frequently), but I'm not sure I totally understand the resolution. I'm using geotrellis 3.5.2, GDAL 3.1.2, and looks like the GDAL warp jar is 1.1.1. So it seems like it should've had the fix.
I'm also doing this in an environment where it's getting data from a S3 bucket using requester pays, but it definitely has AWS credentials and seems to read fine 99% of the time. Could this be related to the parallel reads like discussed in the bug?
but what really was in this issue is that GDAL / S3 timetouts reads sometimes due to load / etc
Increase the number of attempts;
the error code for increased amount of attempts is 100
FAILURE(3) CPLE_AppDefined(1) "Application defined error." _TIFFPartialReadStripArray:Cannot read offset/size for strile around ~9905 ^[[0m
FAILURE(3) CPLE_OpenFailed(4) "Open failed." `/vsis3/gfw-data-lake/umd_tree_cover_density_2000/v1.6/raster/epsg-4326/10/40000/percent/gdal-geotiff/10N_020E.tif' not recognized as a supported file format.
ERROR TreeLossRDD$: Feature 3: {}
geotrellis.raster.gdal.MalformedDataTypeException: Unable to determine NoData value. GDAL Exception Code: 4
at geotrellis.raster.gdal.GDALDataset$.$anonfun$noDataValue$1(GDALDataset.scala:313)
at geotrellis.raster.gdal.GDALDataset$.$anonfun$noDataValue$1$adapted(GDALDataset.scala:310)
at geotrellis.raster.gdal.GDALDataset$.errorHandler$extension(GDALDataset.scala:406)
at geotrellis.raster.gdal.GDALDataset$.noDataValue$extension1(GDALDataset.scala:310)
at geotrellis.raster.gdal.GDALDataset$.cellType$extension1(GDALDataset.scala:366)
at geotrellis.raster.gdal.GDALDataset$.readTile$extension(GDALDataset.scala:383)
at geotrellis.raster.gdal.GDALDataset$.$anonfun$readMultibandTile$1(GDALDataset.scala:400)
at geotrellis.raster.gdal.GDALDataset$.$anonfun$readMultibandTile$1$adapted(GDALDataset.scala:400)
at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:238)
at scala.collection.Iterator.foreach(Iterator.scala:941)
at scala.collection.Iterator.foreach$(Iterator.scala:941)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at scala.collection.TraversableLike.map(TraversableLike.scala:238)
at scala.collection.TraversableLike.map$(TraversableLike.scala:231)
at scala.collection.AbstractTraversable.map(Traversable.scala:108)
at geotrellis.raster.gdal.GDALDataset$.readMultibandTile$extension(GDALDataset.scala:400)
at geotrellis.raster.gdal.GDALRasterSource.$anonfun$readBounds$2(GDALRasterSource.scala:107)
at scala.collection.Iterator$$anon$10.next(Iterator.scala:459)
at geotrellis.raster.gdal.GDALRasterSource.read(GDALRasterSource.scala:158)
at geotrellis.layer.LayoutTileSource.$anonfun$read$1(LayoutTileSource.scala:80)
at scala.Option.flatMap(Option.scala:271)
at geotrellis.layer.LayoutTileSource.read(LayoutTileSource.scala:79)
at geotrellis.layer.LayoutTileSource.read(LayoutTileSource.scala:61)
at org.globalforestwatch.layers.RequiredILayer.fetchWindow(Layer.scala:212)
at org.globalforestwatch.layers.RequiredILayer.fetchWindow$(Layer.scala:208)
at org.globalforestwatch.layers.TreeCoverDensityPercent2000.fetchWindow(TreeCoverDensity.scala:42)
at org.globalforestwatch.summarystats.treecoverloss.TreeLossGridSources.$anonfun$readWindow$5(TreeLossGridSources.scala:43)
at cats.syntax.EitherObjectOps$.catchNonFatal$extension(either.scala:338)
at org.globalforestwatch.summarystats.treecoverloss.TreeLossGridSources.$anonfun$readWindow$4(TreeLossGridSources.scala:43)
at scala.util.Either$RightProjection.flatMap(Either.scala:701)
at org.globalforestwatch.summarystats.treecoverloss.TreeLossGridSources.$anonfun$readWindow$2(TreeLossGridSources.scala:41)
at scala.util.Either$RightProjection.flatMap(Either.scala:701)
at org.globalforestwatch.summarystats.treecoverloss.TreeLossGridSources.readWindow(TreeLossGridSources.scala:40)
FAILURE(3) CPLE_AppDefined(1) "Application defined error." _TIFFPartialReadStripArray:Cannot read offset/size for strile around ~9905 ^[[0m
FAILURE(3) CPLE_OpenFailed(4) "Open failed." `/vsis3/gfw-data-lake/umd_tree_cover_density_2000/v1.6/raster/epsg-4326/10/40000/percent/gdal-geotiff/10N_020E.tif' not recognized as a supported file format.