001/* 002 * GeoAPI - Java interfaces for OGC/ISO standards 003 * Copyright © 2004-2024 Open Geospatial Consortium, Inc. 004 * http://www.geoapi.org 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.opengis.metadata.content; 019 020import org.opengis.util.CodeList; 021import org.opengis.annotation.UML; 022import org.opengis.geoapi.internal.Vocabulary; 023 024import static org.opengis.annotation.Obligation.*; 025import static org.opengis.annotation.Specification.*; 026 027 028/** 029 * Code which indicates conditions which may affect the image. 030 * 031 * @author Martin Desruisseaux (IRD) 032 * @version 3.1 033 * @since 2.0 034 */ 035@Vocabulary(capacity=11) 036@UML(identifier="MD_ImagingConditionCode", specification=ISO_19115) 037public final class ImagingCondition extends CodeList<ImagingCondition> { 038 /** 039 * Serial number for compatibility with different versions. 040 */ 041 private static final long serialVersionUID = -1948380148063658761L; 042 043 /** 044 * Portion of the image is blurred. 045 */ 046 @UML(identifier="blurredImage", obligation=CONDITIONAL, specification=ISO_19115) 047 public static final ImagingCondition BLURRED_IMAGE = new ImagingCondition("BLURRED_IMAGE"); 048 049 /** 050 * Portion of the image is partially obscured by cloud cover 051 */ 052 @UML(identifier="cloud", obligation=CONDITIONAL, specification=ISO_19115) 053 public static final ImagingCondition CLOUD = new ImagingCondition("CLOUD"); 054 055 /** 056 * Acute angle between the plane of the ecliptic (the plane of the planet's orbit) and 057 * the plane of the celestial equator. 058 */ 059 @UML(identifier="degradingObliquity", obligation=CONDITIONAL, specification=ISO_19115) 060 public static final ImagingCondition DEGRADING_OBLIQUITY = new ImagingCondition("DEGRADING_OBLIQUITY"); 061 062 /** 063 * Portion of the image is partially obscured by fog. 064 */ 065 @UML(identifier="fog", obligation=CONDITIONAL, specification=ISO_19115) 066 public static final ImagingCondition FOG = new ImagingCondition("FOG"); 067 068 /** 069 * Portion of the image is partially obscured by heavy smoke or dust. 070 */ 071 @UML(identifier="heavySmokeOrDust", obligation=CONDITIONAL, specification=ISO_19115) 072 public static final ImagingCondition HEAVY_SMOKE_OR_DUST = new ImagingCondition("HEAVY_SMOKE_OR_DUST"); 073 074 /** 075 * Image was taken at night. 076 */ 077 @UML(identifier="night", obligation=CONDITIONAL, specification=ISO_19115) 078 public static final ImagingCondition NIGHT = new ImagingCondition("NIGHT"); 079 080 /** 081 * Image was taken during rainfall. 082 */ 083 @UML(identifier="rain", obligation=CONDITIONAL, specification=ISO_19115) 084 public static final ImagingCondition RAIN = new ImagingCondition("RAIN"); 085 086 /** 087 * Image was taken during semi-dark conditions or twilight conditions. 088 */ 089 @UML(identifier="semiDarkness", obligation=CONDITIONAL, specification=ISO_19115) 090 public static final ImagingCondition SEMI_DARKNESS = new ImagingCondition("SEMI_DARKNESS"); 091 092 /** 093 * Portion of the image is obscured by shadow. 094 */ 095 @UML(identifier="shadow", obligation=CONDITIONAL, specification=ISO_19115) 096 public static final ImagingCondition SHADOW = new ImagingCondition("SHADOW"); 097 098 /** 099 * Portion of the image is obscured by snow. 100 */ 101 @UML(identifier="snow", obligation=CONDITIONAL, specification=ISO_19115) 102 public static final ImagingCondition SNOW = new ImagingCondition("SNOW"); 103 104 /** 105 * The absence of collection data of a given point or area caused by the relative 106 * location of topographic features which obstruct the collection path between the 107 * collector(s) and the subject(s) of interest. 108 */ 109 @UML(identifier="terrainMasking", obligation=CONDITIONAL, specification=ISO_19115) 110 public static final ImagingCondition TERRAIN_MASKING = new ImagingCondition("TERRAIN_MASKING"); 111 112 /** 113 * Constructs an element of the given name. 114 * 115 * @param name the name of the new element. This name shall not be in use by another element of this type. 116 */ 117 private ImagingCondition(final String name) { 118 super(name); 119 } 120 121 /** 122 * Returns the list of {@code ImagingCondition}s. 123 * 124 * @return the list of codes declared in the current JVM. 125 */ 126 public static ImagingCondition[] values() { 127 return values(ImagingCondition.class); 128 } 129 130 /** 131 * Returns the list of codes of the same kind as this code list element. 132 * Invoking this method is equivalent to invoking {@link #values()}, except that 133 * this method can be invoked on an instance of the parent {@code CodeList} class. 134 * 135 * @return all code {@linkplain #values() values} for this code list. 136 */ 137 @Override 138 public ImagingCondition[] family() { 139 return values(); 140 } 141 142 /** 143 * Returns the imaging condition that matches the given string, or returns a new one if none match it. 144 * This methods returns the first instance (in declaration order) for which the {@linkplain #name() name} 145 * is {@linkplain String#equalsIgnoreCase(String) equals, ignoring case}, to the given name. 146 * If no existing instance is found, then a new one is created for the given name. 147 * 148 * @param code the name of the code to fetch or to create. 149 * @return a code matching the given name. 150 */ 151 public static ImagingCondition valueOf(String code) { 152 return valueOf(ImagingCondition.class, code, ImagingCondition::new).get(); 153 } 154}