/** * Invoked by JAXB at both marshalling and unmarshalling time. * This attribute has been added by ISO 19115:2014 standard. * If (and only if) marshalling an older standard version, we omit this attribute. */ @XmlElement(name = "attributeGroup") private Collection<DefaultAttributeGroup> getAttributeGroup() { return FilterByVersion.CURRENT_METADATA.accept() ? getAttributeGroups() : null; } }
/** * Creates the coverage description object if it does not already exists, then returns it. * * @return the coverage description (never {@code null}). * @see #newCoverage(boolean) */ private DefaultCoverageDescription coverageDescription() { if (coverageDescription == null) { coverageDescription = electromagnetic ? new DefaultImageDescription() : new DefaultCoverageDescription(); } return coverageDescription; }
/** * Sets the image distributor's code that identifies the level of radiometric and geometric * processing that has been applied. * * @param newValue the new processing level code. */ @Override public void setProcessingLevelCode(final Identifier newValue) { super.setProcessingLevelCode(newValue); }
/** * Sets the information on the dimensions of the cell measurement value. * This method stores the values in the {@linkplain #getAttributeGroups() attribute groups}. * * @param newValues the new dimensions. * * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#setAttributes(Collection)}. */ @Deprecated public void setDimensions(final Collection<? extends RangeDimension> newValues) { checkWritePermission(); ((LegacyPropertyAdapter<RangeDimension,?>) getDimensions()).setValues(newValues); }
/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(CoverageDescription) */ public DefaultCoverageDescription(final CoverageDescription object) { super(object); if (object != null) { attributeDescription = object.getAttributeDescription(); rangeElementDescriptions = copyCollection(object.getRangeElementDescriptions(), RangeElementDescription.class); if (object instanceof DefaultCoverageDescription) { processingLevelCode = ((DefaultCoverageDescription) object).getProcessingLevelCode(); attributeGroups = copyCollection(((DefaultCoverageDescription) object).getAttributeGroups(), DefaultAttributeGroup.class); } } }
/** * Creates a metadata sample with 3 content information of different kind. */ private static DefaultMetadata createSample1() { final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription(); final DefaultCoverageDescription coverage = new DefaultCoverageDescription(); final DefaultImageDescription image = new DefaultImageDescription(); final DefaultMetadata metadata = new DefaultMetadata(); features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("Shapefile"))); features.setIncludedWithDataset(Boolean.TRUE); metadata.getContentInfo().add(features); coverage.setProcessingLevelCode(new DefaultIdentifier("Level 1")); metadata.getContentInfo().add(coverage); image.setImagingCondition(ImagingCondition.CLOUD); image.setCloudCoverPercentage(0.8); metadata.getContentInfo().add(image); metadata.getLanguages().add(Locale.JAPANESE); metadata.getCharacterSets().add(StandardCharsets.UTF_16); return metadata; }
final DefaultCoverageDescription instance = new DefaultCoverageDescription(); assertNull("Shall be initially empty.", accessor.set(indexOfDeprecated, instance, CoverageContentType.IMAGE, PropertyAccessor.RETURN_PREVIOUS)); final Collection<DefaultAttributeGroup> groups = instance.getAttributeGroups(); assertSame(groups, accessor.get(indexOfReplacement, instance)); assertEquals(CoverageContentType.IMAGE, getSingleton(getSingleton(groups).getContentTypes()));
/** * Returns the image distributor's code that identifies the level of radiometric and geometric * processing that has been applied. * * @return the level of radiometric and geometric processing that has been applied, or {@code null} if unspecified. */ @Override @XmlElement(name = "processingLevelCode") public Identifier getProcessingLevelCode() { return super.getProcessingLevelCode(); }
/** * Sets the type of information represented by the cell value. * This method stores the value in the first writable {@linkplain #getAttributeGroups() attribute groups}. * * @param newValue the new content type. * * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#setContentTypes(Collection)}. */ @Deprecated public void setContentType(final CoverageContentType newValue) { checkWritePermission(); final Collection<CoverageContentType> newValues = LegacyPropertyAdapter.asCollection(newValue); Collection<DefaultAttributeGroup> groups = attributeGroups; if (groups != null) { for (final DefaultAttributeGroup group : groups) { group.setContentTypes(newValues); return; // Actually stop at the first instance. } } final DefaultAttributeGroup group = new DefaultAttributeGroup(); group.setContentTypes(newValues); if (groups != null) { groups.add(group); } else { groups = Collections.<DefaultAttributeGroup>singleton(group); } setAttributeGroups(groups); }
/** * Sets the description of the attribute described by the measurement value. * * @param newValue the new attribute description. */ public void setAttributeDescription(final RecordType newValue) { checkWritePermission(); attributeDescription = newValue; }
return DefaultCoverageDescription.castOrCopy((CoverageDescription) object);
/** * Constructs a new instance initialized with the values from the specified metadata object. * This is a <cite>shallow</cite> copy constructor, since the other metadata contained in the * given object are not recursively copied. * * @param object the metadata to copy values from, or {@code null} if none. * * @see #castOrCopy(CoverageDescription) */ public DefaultCoverageDescription(final CoverageDescription object) { super(object); if (object != null) { attributeDescription = object.getAttributeDescription(); rangeElementDescriptions = copyCollection(object.getRangeElementDescriptions(), RangeElementDescription.class); if (object instanceof DefaultCoverageDescription) { processingLevelCode = ((DefaultCoverageDescription) object).getProcessingLevelCode(); attributeGroups = copyCollection(((DefaultCoverageDescription) object).getAttributeGroups(), DefaultAttributeGroup.class); } } }
assertEquals("cloudCoverPercentage", Double.valueOf(0.8), image .getCloudCoverPercentage()); assertEquals("processingLevelCode", "Level 2", image .getProcessingLevelCode().getCode()); assertEquals("processingLevelCode", "Level 1", coverage.getProcessingLevelCode().getCode()); assertEquals("includedWithDataset", Boolean.TRUE, features.isIncludedWithDataset());
/** * Sets the information on the dimensions of the cell measurement value. * This method stores the values in the {@linkplain #getAttributeGroups() attribute groups}. * * @param newValues the new dimensions. * * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#setAttributes(Collection)}. */ @Deprecated public void setDimensions(final Collection<? extends RangeDimension> newValues) { checkWritePermission(valueIfDefined(attributeGroups)); ((LegacyPropertyAdapter<RangeDimension,?>) getDimensions()).setValues(newValues); }
/** * Sets the type of information represented by the cell value. * This method stores the value in the first writable {@linkplain #getAttributeGroups() attribute groups}. * * @param newValue the new content type. * * @deprecated As of ISO 19115:2014, moved to {@link DefaultAttributeGroup#setContentTypes(Collection)}. */ @Deprecated public void setContentType(final CoverageContentType newValue) { checkWritePermission(valueIfDefined(attributeGroups)); final Collection<CoverageContentType> newValues = LegacyPropertyAdapter.asCollection(newValue); Collection<DefaultAttributeGroup> groups = attributeGroups; if (groups != null) { for (final DefaultAttributeGroup group : groups) { group.setContentTypes(newValues); return; // Actually stop at the first instance. } } final DefaultAttributeGroup group = new DefaultAttributeGroup(); group.setContentTypes(newValues); if (groups != null) { groups.add(group); } else { groups = Collections.<DefaultAttributeGroup>singleton(group); } setAttributeGroups(groups); }
/** * Sets the identifier for the level of processing that has been applied to the resource. * * @param newValue the new identifier for the level of processing. * * @since 0.5 */ public void setProcessingLevelCode(final Identifier newValue) { checkWritePermission(); processingLevelCode = newValue; }
/** * Wraps the given metadata into a SIS implementation that can be marshalled, * using the {@code "gmi"} namespace if necessary. * * @param original the original metadata provided by the user. * @return the metadata to marshall. */ public static DefaultCoverageDescription castOrCopy(final CoverageDescription original) { if (original != null && !(original instanceof MI_CoverageDescription)) { if (!isNullOrEmpty(original.getRangeElementDescriptions())) { return new MI_CoverageDescription(original); } } return DefaultCoverageDescription.castOrCopy(original); } }
public CoverageContentType getContentType() { CoverageContentType type = null; final Collection<DefaultAttributeGroup> groups = getAttributeGroups(); if (groups != null) { // May be null on marshalling. for (final DefaultAttributeGroup g : groups) {
/** * Creates the coverage description object if it does not already exists, then returns it. * * @return the coverage description (never {@code null}). * @see #newCoverage(boolean) */ private DefaultCoverageDescription coverageDescription() { if (coverageDescription == null) { coverageDescription = electromagnetic ? new DefaultImageDescription() : new DefaultCoverageDescription(); } return coverageDescription; }
/** * Sets an identifier for the level of processing that has been applied to the coverage. * Storage location is: * * <ul> * <li>{@code metadata/contentInfo/processingLevelCode}</li> * </ul> * * @param authority identifies which controlled list of code is used, or {@code null} if none. * @param processingLevel identifier for the level of processing that has been applied to the resource, * or {@code null} for no-operation. */ public final void setProcessingLevelCode(final CharSequence authority, String processingLevel) { if (processingLevel != null) { processingLevel = processingLevel.trim(); if (!processingLevel.isEmpty()) { coverageDescription().setProcessingLevelCode(sharedIdentifier(authority, processingLevel)); } } }