Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Jun 28, 2024
1 parent e778d71 commit edebcab
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1243,13 +1243,11 @@ class FileLayerProvider private(openSearch: OpenSearchClient, openSearchCollecti
* - if feature is in utm, target extent may be invalid in feature crs
* this is why we take intersection
*/
val commonCRS = targetExtent.crs
val targetExtentInCommonCRS = targetExtent.reproject(commonCRS)
val featureExtentInCommonCRS = feature.rasterExtent.get.reproject(feature.crs.get, commonCRS)
val featureExtentInTargetCRS = feature.rasterExtent.get.reproject(feature.crs.get, targetExtent.crs)

val intersection = featureExtentInCommonCRS.intersection(targetExtentInCommonCRS).map(_.buffer(1.0))
.getOrElse(featureExtentInCommonCRS)
val tmp = expandToCellSize(intersection.reproject(commonCRS, targetExtent.crs), theResolution)
val intersection = featureExtentInTargetCRS.intersection(targetExtent.extent).map(_.buffer(1.0))
.getOrElse(featureExtentInTargetCRS)
val tmp = expandToCellSize(intersection, theResolution)

val alignedToTargetExtent = re.createAlignedRasterExtent(tmp)
Some(alignedToTargetExtent.toGridType[Long])
Expand Down

0 comments on commit edebcab

Please sign in to comment.