Skip to content

Commit 93c2b75

Browse files
Fix to make tests run on Jenkins. #279
1 parent 059eb58 commit 93c2b75

File tree

5 files changed

+617
-13
lines changed

5 files changed

+617
-13
lines changed

openeo-geotrellis/src/main/scala/org/openeo/geotrellis/layers/FileLayerProvider.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,13 +1243,11 @@ class FileLayerProvider private(openSearch: OpenSearchClient, openSearchCollecti
12431243
* - if feature is in utm, target extent may be invalid in feature crs
12441244
* this is why we take intersection
12451245
*/
1246-
val commonCRS = targetExtent.crs
1247-
val targetExtentInCommonCRS = targetExtent.reproject(commonCRS)
1248-
val featureExtentInCommonCRS = feature.rasterExtent.get.reproject(feature.crs.get, commonCRS)
1246+
val featureExtentInTargetCRS = feature.rasterExtent.get.reproject(feature.crs.get, targetExtent.crs)
12491247

1250-
val intersection = featureExtentInCommonCRS.intersection(targetExtentInCommonCRS).map(_.buffer(1.0))
1251-
.getOrElse(featureExtentInCommonCRS)
1252-
val tmp = expandToCellSize(intersection.reproject(commonCRS, targetExtent.crs), theResolution)
1248+
val intersection = featureExtentInTargetCRS.intersection(targetExtent.extent).map(_.buffer(1.0))
1249+
.getOrElse(featureExtentInTargetCRS)
1250+
val tmp = expandToCellSize(intersection, theResolution)
12531251

12541252
val alignedToTargetExtent = re.createAlignedRasterExtent(tmp)
12551253
Some(alignedToTargetExtent.toGridType[Long])

0 commit comments

Comments
 (0)