Skip to content

Commit

Permalink
Follow up on imageio-ext nodata cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Apr 30, 2024
1 parent 7383308 commit 711ef07
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import java.io.IOException;
import java.net.URL;
import java.text.MessageFormat;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
Expand Down Expand Up @@ -129,6 +130,7 @@ public URL resolve(String granuleLocation) {
return pathType.resolvePath(parentLocation, granuleLocation);
}
}

/** Logger. */
private static final Logger LOGGER =
org.geotools.util.logging.Logging.getLogger(GranuleDescriptor.class);
Expand Down Expand Up @@ -603,11 +605,14 @@ private void initFromImageMetadata(ImageReader reader, boolean readPam) throws I
if (metadata instanceof CoreCommonImageMetadata) {
CoreCommonImageMetadata ccm = (CoreCommonImageMetadata) metadata;

double[] noData = ccm.getNoData();
if (noData != null) {
this.noData = new NoDataContainer(noData);
double[] noDataArray = null;
if (ccm.getNoDataValues() != null) {
noDataArray =
Arrays.stream(ccm.getNoDataValues())
.mapToDouble(d -> d == null ? Double.NaN : d)
.toArray();
this.noData = new NoDataContainer(noDataArray);
}

this.scales = ccm.getScales();
this.offsets = ccm.getOffsets();
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@
<db2.jdbc.version>11.5.9.0</db2.jdbc.version>
<eclipse.emf.version>2.15.0</eclipse.emf.version>
<elasticsearch.version>7.14.0</elasticsearch.version>
<imageio.ext.version>1.4.9</imageio.ext.version>
<imageio.ext.version>1.4-SNAPSHOT</imageio.ext.version>
<informix.jdbc.version>4.50.7.1</informix.jdbc.version>
<jackson2.databind.version>2.15.2</jackson2.databind.version>
<jackson2.version>2.15.2</jackson2.version>
Expand Down

0 comments on commit 711ef07

Please sign in to comment.