@@ -3,12 +3,12 @@ package org.openeo.geotrellis.layers
3
3
import com .azavea .gdal .GDALWarp
4
4
import geotrellis .layer .{KeyBounds , LayoutDefinition , Metadata , SpaceTimeKey , SpatialKey , TemporalKey , TemporalProjectedExtent , TileBounds , TileLayerMetadata }
5
5
import geotrellis .proj4 .LatLng
6
- import geotrellis .raster .{CellSize , MultibandTile , Raster , RasterExtent , Tile , TileLayout }
6
+ import geotrellis .raster .{CellSize , IntCellType , MultibandTile , Raster , RasterExtent , Tile , TileLayout }
7
7
import geotrellis .raster .gdal .{DefaultDomain , GDALException , GDALRasterSource , MalformedProjectionException }
8
8
import geotrellis .spark .{ContextRDD , MultibandTileLayerRDD , withTilerMethods }
9
9
import geotrellis .spark ._
10
10
import geotrellis .spark .partition .SpacePartitioner
11
- import geotrellis .vector .{ Extent , ProjectedExtent }
11
+ import geotrellis .vector ._
12
12
import org .apache .spark .{Partitioner , SparkContext }
13
13
import org .apache .spark .rdd .RDD
14
14
import org .openeo .geotrellis .ProjectedPolygons
@@ -107,7 +107,7 @@ object NetCDFCollection {
107
107
val spatialBounds = KeyBounds (layout.mapTransform(extent))
108
108
val temporalBounds = KeyBounds (SpaceTimeKey (spatialBounds.minKey,TemporalKey (LocalDate .of(1990 ,1 ,1 ).atStartOfDay(ZoneId .of(" UTC" )))),SpaceTimeKey (spatialBounds.maxKey,TemporalKey (LocalDate .now().atStartOfDay(ZoneId .of(" UTC" )))))
109
109
110
- val keys : Array [SpatialKey ] = items.map(i => i.geometry.getOrElse(i.bbox.toPolygon())).clipToGrid(layout).map(_._1).distinct().collect()
110
+ val keys : Array [SpatialKey ] = items.map(i => i.geometry.getOrElse(i.bbox.toPolygon())).map(_.reproject( LatLng ,crs( 0 ))). clipToGrid(layout).map(_._1).distinct().collect()
111
111
val partitioner : Partitioner = new SpacePartitioner (temporalBounds)(implicitly, implicitly, new ByTileSpacetimePartitioner (Some (keys)))
112
112
113
113
val metadata = TileLayerMetadata [SpaceTimeKey ](cellType, layout, extent, crs(0 ), temporalBounds)
0 commit comments