@Test public void testSuggestNodata() { assertEquals((byte) 0, CoverageUtilities.suggestNoDataValue(DataBuffer.TYPE_BYTE)); assertTrue( Double.isNaN( CoverageUtilities.suggestNoDataValue(DataBuffer.TYPE_DOUBLE) .doubleValue())); assertTrue( Float.isNaN( CoverageUtilities.suggestNoDataValue(DataBuffer.TYPE_FLOAT).floatValue())); assertEquals(Integer.MIN_VALUE, CoverageUtilities.suggestNoDataValue(DataBuffer.TYPE_INT)); assertEquals((short) 0, CoverageUtilities.suggestNoDataValue(DataBuffer.TYPE_USHORT)); assertEquals(Short.MIN_VALUE, CoverageUtilities.suggestNoDataValue(DataBuffer.TYPE_SHORT)); }
public static Number suggestNoDataValue(int dataType) { switch (dataType) { case DataBuffer.TYPE_BYTE: return Byte.valueOf((byte) 0); case DataBuffer.TYPE_USHORT: return Short.valueOf((short) 0); case DataBuffer.TYPE_INT: return Integer.valueOf(Integer.MIN_VALUE); case DataBuffer.TYPE_SHORT: return Short.valueOf(Short.MIN_VALUE); case DataBuffer.TYPE_DOUBLE: return Double.valueOf(Double.NaN); case DataBuffer.TYPE_FLOAT: return Float.valueOf(Float.NaN); default: throw new IllegalAccessError( Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "dataType", dataType)); } }
CoverageUtilities { public static Number suggestNoDataValue(int dataType) { switch (dataType) { case DataBuffer.TYPE_BYTE: return Byte.valueOf((byte) 0); case DataBuffer.TYPE_USHORT: return Short.valueOf((short) 0); case DataBuffer.TYPE_INT: return Integer.valueOf(Integer.MIN_VALUE); case DataBuffer.TYPE_SHORT: return Short.valueOf(Short.MIN_VALUE); case DataBuffer.TYPE_DOUBLE: return Double.valueOf(Double.NaN); case DataBuffer.TYPE_FLOAT: return Float.valueOf(Float.NaN); default: throw new IllegalAccessError( Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "dataType", dataType)); } } }
CoverageUtilities { public static Number suggestNoDataValue(int dataType) { switch (dataType) { case DataBuffer.TYPE_BYTE: return Byte.valueOf((byte) 0); case DataBuffer.TYPE_USHORT: return Short.valueOf((short) 0); case DataBuffer.TYPE_INT: return Integer.valueOf(Integer.MIN_VALUE); case DataBuffer.TYPE_SHORT: return Short.valueOf(Short.MIN_VALUE); case DataBuffer.TYPE_DOUBLE: return Double.valueOf(Double.NaN); case DataBuffer.TYPE_FLOAT: return Float.valueOf(Float.NaN); default: throw new IllegalAccessError( Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "dataType", dataType)); } } private  CoverageUtilities(); }
CoverageUtilities { public static Number suggestNoDataValue(int dataType) { switch (dataType) { case DataBuffer.TYPE_BYTE: return Byte.valueOf((byte) 0); case DataBuffer.TYPE_USHORT: return Short.valueOf((short) 0); case DataBuffer.TYPE_INT: return Integer.valueOf(Integer.MIN_VALUE); case DataBuffer.TYPE_SHORT: return Short.valueOf(Short.MIN_VALUE); case DataBuffer.TYPE_DOUBLE: return Double.valueOf(Double.NaN); case DataBuffer.TYPE_FLOAT: return Float.valueOf(Float.NaN); default: throw new IllegalAccessError( Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "dataType", dataType)); } } private  CoverageUtilities(); static CoordinateReferenceSystem getCRS2D(final Coverage coverage); static CoordinateReferenceSystem getHorizontalCRS(final Coverage coverage); static Envelope2D getEnvelope2D(final Coverage coverage); static NoDataContainer getNoDataProperty(GridCoverage2D coverage); static ROI getROIProperty(GridCoverage2D coverage); static void setNoDataProperty(Map<String, Object> properties, Object noData); static void setROIProperty(Map<String, Object> properties, ROI roi); static double[] getBackgroundValues(GridCoverage2D coverage); static boolean uses(final GridCoverage coverage, final RenderedImage image); static int getVisibleBand(final Object image); static boolean isScaleTranslate(final MathTransform transform, final double EPS); static double[] getResolution(final AffineTransform gridToCRS); static boolean isSimpleGridToWorldTransform(
            final AffineTransform gridToCRS, double EPS); static boolean checkEmptySourceRegion(
            final ImageReadParam readParameters, final Rectangle dimensions); static double getMosaicThreshold(int dataType); static Number suggestNoDataValue(int dataType); static Properties loadPropertiesFromURL(URL propsURL); }
CoverageUtilities { public static Number suggestNoDataValue(int dataType) { switch (dataType) { case DataBuffer.TYPE_BYTE: return Byte.valueOf((byte) 0); case DataBuffer.TYPE_USHORT: return Short.valueOf((short) 0); case DataBuffer.TYPE_INT: return Integer.valueOf(Integer.MIN_VALUE); case DataBuffer.TYPE_SHORT: return Short.valueOf(Short.MIN_VALUE); case DataBuffer.TYPE_DOUBLE: return Double.valueOf(Double.NaN); case DataBuffer.TYPE_FLOAT: return Float.valueOf(Float.NaN); default: throw new IllegalAccessError( Errors.format(ErrorKeys.ILLEGAL_ARGUMENT_$2, "dataType", dataType)); } } private  CoverageUtilities(); static CoordinateReferenceSystem getCRS2D(final Coverage coverage); static CoordinateReferenceSystem getHorizontalCRS(final Coverage coverage); static Envelope2D getEnvelope2D(final Coverage coverage); static NoDataContainer getNoDataProperty(GridCoverage2D coverage); static ROI getROIProperty(GridCoverage2D coverage); static void setNoDataProperty(Map<String, Object> properties, Object noData); static void setROIProperty(Map<String, Object> properties, ROI roi); static double[] getBackgroundValues(GridCoverage2D coverage); static boolean uses(final GridCoverage coverage, final RenderedImage image); static int getVisibleBand(final Object image); static boolean isScaleTranslate(final MathTransform transform, final double EPS); static double[] getResolution(final AffineTransform gridToCRS); static boolean isSimpleGridToWorldTransform(
            final AffineTransform gridToCRS, double EPS); static boolean checkEmptySourceRegion(
            final ImageReadParam readParameters, final Rectangle dimensions); static double getMosaicThreshold(int dataType); static Number suggestNoDataValue(int dataType); static Properties loadPropertiesFromURL(URL propsURL); static final InternationalString NODATA; static final AffineTransform AXES_SWAP; static final AffineTransform IDENTITY_TRANSFORM; static final AffineTransform CENTER_TO_CORNER; static final AffineTransform CORNER_TO_CENTER; static final double AFFINE_IDENTITY_EPS; }