/** * Adds metadata about the meaning of a sample value. * This is the {@code <mrc:rangeElementDescription>} element in XML. * * <p><b>Note:</b> ISO 19115 range elements are approximately equivalent to * {@code org.apache.sis.coverage.Category} in the {@code sis-coverage} module.</p> * * @param variable the netCDF variable. * @param name one of the elements in the {@link AttributeNames#FLAG_NAMES} attribute, or {@code null}. * @param meaning one of the elements in the {@link AttributeNames#FLAG_MEANINGS} attribute or {@code null}. * @param mask one of the elements in the {@link AttributeNames#FLAG_MASKS} attribute or {@code null}. * @param value one of the elements in the {@link AttributeNames#FLAG_VALUES} attribute or {@code null}. */ private void addSampleValueDescription(final Variable variable, final String name, final String meaning, final Number mask, final Number value) { addSampleValueDescription(name, meaning); // TODO: create a record from values (and possibly from the masks). // if (pixel & mask == value) then we have that range element. }
/** * Adds metadata about the meaning of a sample value. * This is the {@code <gmd:rangeElementDescription>} element in XML. * * <p><b>Note:</b> ISO 19115 range elements are approximatively equivalent to * {@code org.apache.sis.coverage.Category} in the {@code sis-coverage} module.</p> * * @param variable the netCDF variable. * @param name one of the elements in the {@link AttributeNames#FLAG_NAMES} attribute, or {@code null}. * @param meaning one of the elements in the {@link AttributeNames#FLAG_MEANINGS} attribute or {@code null}. * @param mask one of the elements in the {@link AttributeNames#FLAG_MASKS} attribute or {@code null}. * @param value one of the elements in the {@link AttributeNames#FLAG_VALUES} attribute or {@code null}. */ private void addSampleValueDescription(final Variable variable, final String name, final String meaning, final Number mask, final Number value) { addSampleValueDescription(name, meaning); // TODO: create a record from values (and possibly from the masks). // if (pixel & mask == value) then we have that range element. }
final int length = Math.max(masks.length, Math.max(values.length, Math.max(names.length, meanings.length))); for (int i=0; i<length; i++) { addSampleValueDescription(variable, (i < names .length) ? (String) names [i] : null, (i < meanings.length) ? (String) meanings[i] : null,
final int length = Math.max(masks.length, Math.max(values.length, Math.max(names.length, meanings.length))); for (int i=0; i<length; i++) { addSampleValueDescription(variable, (i < names .length) ? (String) names [i] : null, (i < meanings.length) ? (String) meanings[i] : null,