You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jiayuasu (via GitHub)" <gi...@apache.org> on 2024/03/15 05:05:38 UTC

Re: [PR] [SEDONA-515] Add handling of noDataValues in RS_Resample [sedona]

jiayuasu commented on code in PR #1279:
URL: https://github.com/apache/sedona/pull/1279#discussion_r1525764009


##########
common/src/test/java/org/apache/sedona/common/raster/RasterEditorsTest.java:
##########
@@ -134,6 +134,61 @@ public void testResample() throws FactoryException, TransformException {
         }
     }
 
+    @Test
+    public void testResampleNoDataValueHandled() throws FactoryException, TransformException {
+        double[] values1 = {1,99,3,4,99,6,7,99,9,10,99,12};
+        double[] values2 = {10,11,-9999,13,14,15,-9999,17,18,19,-9999,21};
+        GridCoverage2D raster = RasterConstructors.makeEmptyRaster(1, "d", 4, 3, 0, 0, 2, -2, 0, 0, 0);
+        raster = MapAlgebra.addBandFromArray(raster, values1, 1, 99.0);
+        raster = MapAlgebra.addBandFromArray(raster, values2, 2, -9999.0);
+
+        GridCoverage2D newRaster = RasterEditors.resample(raster, 6, 5, 1, -1, false, "bilinear");

Review Comment:
   Can you add a test to downsample the raster? E.g., the original raster is 4, 3, resample it to 2, 2?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@sedona.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org