This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-4.0 in repository https://gitbox.apache.org/repos/asf/sis.git
commit 11339c7efa40235808ffaed6476b42650f274d4c Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Fri Oct 27 14:17:38 2023 +0200 Superficial formatting of CoverageJSON incubator module. --- .../sis/storage/coveragejson/CoverageJsonStore.java | 1 + .../coveragejson/CoverageJsonStoreProvider.java | 5 +++++ .../apache/sis/storage/coveragejson/binding/Axe.java | 19 ++++++++++++++++++- .../apache/sis/storage/coveragejson/binding/Axes.java | 5 +++++ .../sis/storage/coveragejson/binding/Category.java | 12 ++++++++++-- .../coveragejson/binding/CategoryEncoding.java | 9 ++++++++- .../sis/storage/coveragejson/binding/Coverage.java | 18 +++++++++++++++++- .../coveragejson/binding/CoverageCollection.java | 15 ++++++++++++++- .../coveragejson/binding/CoverageJsonObject.java | 5 ++++- .../sis/storage/coveragejson/binding/Dictionary.java | 16 ++++++++++------ .../sis/storage/coveragejson/binding/Domain.java | 11 ++++++++++- .../storage/coveragejson/binding/GeographicCRS.java | 9 ++++++++- .../apache/sis/storage/coveragejson/binding/I18N.java | 8 +++++++- .../storage/coveragejson/binding/IdentifierRS.java | 15 +++++++++++++-- .../sis/storage/coveragejson/binding/Identifiers.java | 4 +++- .../sis/storage/coveragejson/binding/NdArray.java | 12 ++++++++++++ .../coveragejson/binding/ObservedProperty.java | 12 +++++++++--- .../sis/storage/coveragejson/binding/Parameter.java | 18 ++++++++++++++++-- .../storage/coveragejson/binding/ParameterGroup.java | 14 +++++++++++++- .../sis/storage/coveragejson/binding/Parameters.java | 9 ++++++++- .../storage/coveragejson/binding/ProjectedCRS.java | 9 ++++++++- .../sis/storage/coveragejson/binding/Ranges.java | 9 ++++++++- .../binding/ReferenceSystemConnection.java | 9 ++++++++- .../sis/storage/coveragejson/binding/Symbol.java | 7 ++++++- .../storage/coveragejson/binding/TargetConcept.java | 5 +++++ .../sis/storage/coveragejson/binding/TemporalRS.java | 9 ++++++++- .../sis/storage/coveragejson/binding/TileSet.java | 8 +++++++- .../storage/coveragejson/binding/TiledNdArray.java | 13 ++++++++++++- .../apache/sis/storage/coveragejson/binding/Unit.java | 8 +++++++- .../sis/storage/coveragejson/binding/VerticalCRS.java | 9 ++++++++- .../storage/coveragejson/CoverageJsonStoreTest.java | 14 +++++--------- .../sis/storage/coveragejson/binding/BindingTest.java | 5 ++++- 32 files changed, 277 insertions(+), 45 deletions(-) diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStore.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStore.java index 61ce1c9c48..07eb67bbd0 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStore.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStore.java @@ -48,6 +48,7 @@ import org.apache.sis.storage.WritableAggregate; import org.opengis.metadata.Metadata; import org.opengis.parameter.ParameterValueGroup; + /** * A data store backed by Coverage-JSON files. * diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStoreProvider.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStoreProvider.java index cce719fc29..ab272fed38 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStoreProvider.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/CoverageJsonStoreProvider.java @@ -31,6 +31,7 @@ import org.apache.sis.storage.StorageConnector; import org.apache.sis.util.Version; import org.opengis.parameter.ParameterDescriptorGroup; + /** * The provider of {@link CoverageJsonStore} instances. Given a {@link StorageConnector} input, * this class tries to instantiate a {@code CoverageJsonStore}. @@ -48,6 +49,7 @@ import org.opengis.parameter.ParameterDescriptorGroup; public class CoverageJsonStoreProvider extends DataStoreProvider { public static final String NAME = "CoverageJSON"; + /** * The MIME type for Coverage-JSON files. */ @@ -65,6 +67,9 @@ public class CoverageJsonStoreProvider extends DataStoreProvider { */ private static final ParameterDescriptorGroup OPEN_DESCRIPTOR = URIDataStore.Provider.descriptor(NAME); + public CoverageJsonStoreProvider() { + } + @Override public String getShortName() { return NAME; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axe.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axe.java index d7c7241cb2..324f414de8 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axe.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axe.java @@ -21,7 +21,9 @@ import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.List; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An axis object MUST have either a "values" member or, as a compact notation * for a regularly spaced numeric axis, have all the members "start", "stop", * and "num". @@ -37,14 +39,19 @@ public final class Axe extends Dictionary<Object> { public static final String DATATYPE_POLYGON = "polygon"; /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The values of "start" and "stop" MUST be numbers */ public Double start; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The values of "start" and "stop" MUST be numbers */ public Double stop; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * the value of "num" an integer greater than zero. * * If the value of "num" is 1, then "start" and "stop" MUST have identical @@ -56,7 +63,9 @@ public final class Axe extends Dictionary<Object> { * than "stop" in which case the axis values are descending. */ public Integer num; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The value of "dataType" determines the structure of an axis value and its * coordinates that are made available for referencing. The values of * "dataType" defined in this Community Standard are "primitive", "tuple", @@ -78,7 +87,9 @@ public final class Axe extends Dictionary<Object> { * or decreasing. */ public String dataType; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The value of "coordinates" is a non-empty array of coordinate identifiers * corresponding to the order of the coordinates defined by "dataType". * @@ -89,11 +100,15 @@ public final class Axe extends Dictionary<Object> { * objects of a domain object. */ public List<String> coordinates; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The value of "values" is a non-empty array of axis values. */ public List<Object> values; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An axis object MAY have axis value bounds defined in the member "bounds" * where the value is an array of values of length len*2 with len being the * length of the "values" array. For each axis value at array index i in the @@ -105,6 +120,9 @@ public final class Axe extends Dictionary<Object> { */ public List<Object> bounds; + public Axe() { + } + @Override public boolean equals(Object other) { if (other == this) return true; @@ -132,5 +150,4 @@ public final class Axe extends Dictionary<Object> { values, bounds); } - } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axes.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axes.java index 110132c727..b1602c4a04 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axes.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Axes.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The "axes" member MUST NOT be empty. * * @author Johann Sorel (Geomatys) @@ -34,6 +36,9 @@ public final class Axes extends Dictionary<Object> { public Axe z; public Axe t; + public Axes() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Category.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Category.java index b562eb5adb..34889acf80 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Category.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Category.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A category object MUST an "id" and a "label" member, and MAY have a * "description" member. * @@ -29,22 +31,29 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"id","label","description"}) public final class Category extends Dictionary<Object> { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The value of "id" MUST be a string and SHOULD be a common identifier. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The value of "label" MUST be an i18n object of the name of the * category and SHOULD be short. */ public I18N label; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * If given, the value of "description" MUST be an i18n object with a * textual description of the* category. */ public I18N description; + public Category() { + } + @Override public boolean equals(Object other) { if (other == this) return true; @@ -64,5 +73,4 @@ public final class Category extends Dictionary<Object> { label, description); } - } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CategoryEncoding.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CategoryEncoding.java index e65a1ddfff..6eff1833ed 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CategoryEncoding.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CategoryEncoding.java @@ -31,6 +31,7 @@ import org.apache.sis.storage.coveragejson.binding.CategoryEncoding.Serializer; /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * CategoryEncoding is an object where each key is equal to an "id" value of * the "categories" array within the "observedProperty" member of the * parameter object. There MUST be no duplicate keys. The value is either @@ -42,8 +43,13 @@ import org.apache.sis.storage.coveragejson.binding.CategoryEncoding.Serializer; @JsonbTypeDeserializer(Deserializer.class) @JsonbTypeSerializer(Serializer.class) public final class CategoryEncoding extends Dictionary<Object> { + public CategoryEncoding() { + } public static class Deserializer implements JsonbDeserializer<CategoryEncoding> { + public Deserializer() { + } + @Override public CategoryEncoding deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { final CategoryEncoding candidate = new CategoryEncoding(); @@ -61,6 +67,8 @@ public final class CategoryEncoding extends Dictionary<Object> { } public static class Serializer implements JsonbSerializer<CategoryEncoding> { + public Serializer() { + } @Override public void serialize(CategoryEncoding ranges, JsonGenerator jg, SerializationContext sc) { @@ -70,6 +78,5 @@ public final class CategoryEncoding extends Dictionary<Object> { } jg.writeEnd(); } - } } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Coverage.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Coverage.java index 0147bce940..c1d96551ce 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Coverage.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Coverage.java @@ -26,7 +26,9 @@ import java.lang.reflect.Type; import java.util.List; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A CoverageJSON object with the type "Coverage" is a coverage object. * * @author Johann Sorel (Geomatys) @@ -34,13 +36,15 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","id","domain","parameters","parameterGroups","ranges"}) public final class Coverage extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * If a coverage has a commonly used identifier, that identifier SHOULD be * included as a member of the coverage object with the name "id". */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage object MUST have a member with the name "domain" where the * value is either a domain object or a URL. * @@ -55,7 +59,9 @@ public final class Coverage extends CoverageJsonObject { //@JsonbTypeDeserializer(Coverage.DomainDeserializer.class) //TODO should be a Domain or an URL, DomainDeserializer not working as expected public Domain domain; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage object MAY have a member with the name "parameters" where the * value is an object where each member has as name a short identifier and * as value a parameter object. The identifier corresponds to the commonly @@ -67,12 +73,16 @@ public final class Coverage extends CoverageJsonObject { * not have a "parameters" member. */ public Parameters parameters; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage object MAY have a member with the name "parameterGroups" where * the value is an array of ParameterGroup objects. */ public List<ParameterGroup> parameterGroups; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage object MUST have a member with the name "ranges" where the * value is a range set object. Any member of a range set object has as * name any of the names in a "parameters" object in scope and as value @@ -90,6 +100,9 @@ public final class Coverage extends CoverageJsonObject { */ public Ranges ranges; + public Coverage() { + } + @Override public boolean equals(Object other) { if (other == this) return true; @@ -115,6 +128,9 @@ public final class Coverage extends CoverageJsonObject { } public static class DomainDeserializer implements JsonbDeserializer<Object> { + public DomainDeserializer() { + } + @Override public Object deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { final JsonParser.Event event = parser.next(); diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageCollection.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageCollection.java index 401861d88d..b2308c6e25 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageCollection.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageCollection.java @@ -21,7 +21,9 @@ import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.List; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A CoverageJSON object with the type "CoverageCollection" is a coverage collection object. * * @author Johann Sorel (Geomatys) @@ -29,8 +31,8 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","domainType","parameters","parameterGroups","referencing","coverages"}) public final class CoverageCollection extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage collection object MAY have the member "domainType" with a * string value to indicate that the coverage collection only contains * coverages of the given domain type. See the section Common Domain Types @@ -41,29 +43,40 @@ public final class CoverageCollection extends CoverageJsonObject { * member is inherited to all included coverages. */ public String domainType; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage collection object MAY have a member with the name "parameters" * where the value is an object where each member has as name a short * identifier and as value a parameter object. */ public Parameter parameters; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage collection object MAY have a member with the name * "parameterGroups" where the value is an array of ParameterGroup objects. */ public List<ParameterGroup> parameterGroups; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage collection object MAY have a member with the name "referencing" * where the value is an array of reference system connection objects. */ public List<ReferenceSystemConnection> referencing; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A coverage collection object MUST have a member with the name "coverages". * The value corresponding to "coverages" is an array. Each element in the * array is a coverage object as defined above. */ public List<Coverage> coverages; + public CoverageCollection() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageJsonObject.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageJsonObject.java index 50334ad709..a2624aa3df 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageJsonObject.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/CoverageJsonObject.java @@ -19,7 +19,9 @@ package org.apache.sis.storage.coveragejson.binding; import jakarta.json.bind.annotation.JsonbSubtype; import jakarta.json.bind.annotation.JsonbTypeInfo; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A CoverageJSON document can be extended with custom members and types in a * robust and interoperable way. For that, it makes use of absolute URIs and * compact URIs (prefix:suffix) in order to avoid conflicts with other extensions @@ -51,5 +53,6 @@ import jakarta.json.bind.annotation.JsonbTypeInfo; @JsonbSubtype(alias = "TemporalRS", type = TemporalRS.class) }) public class CoverageJsonObject extends Dictionary<Object> { - + public CoverageJsonObject() { + } } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Dictionary.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Dictionary.java index 741f8a517d..e8cb5071df 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Dictionary.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Dictionary.java @@ -21,7 +21,7 @@ import jakarta.json.bind.JsonbBuilder; import jakarta.json.bind.annotation.JsonbTransient; import java.util.LinkedHashMap; import java.util.Map; -import java.util.Objects; + /** * @author Johann Sorel (Geomatys) @@ -33,7 +33,11 @@ public class Dictionary<T> { * TODO find how to cath any other property as in Jackson @JsonAnyGetter and Johnzon @JohnzonAny */ @JsonbTransient - public final LinkedHashMap<String, T> any = new LinkedHashMap<>(); + public final LinkedHashMap<String, T> any; + + public Dictionary() { + any = new LinkedHashMap<>(); + } public final Map<String, T> getAny() { return this.any; @@ -56,14 +60,14 @@ public class Dictionary<T> { @Override public boolean equals(Object other) { if (other == this) return true; - if (!(other instanceof Dictionary)) return false; + if (!(other instanceof Dictionary<?>)) return false; - final Dictionary cdt = ((Dictionary) other); - return Objects.equals(any, cdt.any); + final var cdt = ((Dictionary<?>) other); + return any.equals(cdt.any); } @Override public int hashCode() { - return Objects.hash(any); + return any.hashCode(); } } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Domain.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Domain.java index 04e92a2621..1d655b183c 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Domain.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Domain.java @@ -21,7 +21,9 @@ import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.List; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A domain object is a CoverageJSON object which defines a set of positions and * their extent in one or more referencing systems. * @@ -45,6 +47,7 @@ public final class Domain extends CoverageJsonObject { public static final String DOMAINTYPE_SECTION = "Section"; /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * For interoperability reasons it is RECOMMENDED that a domain object has * the member "domainType" with a string value to indicate that the domain * follows a certain structure (e.g. a time series, a vertical profile, a @@ -52,12 +55,16 @@ public final class Domain extends CoverageJsonObject { * Custom domain types may be used as recommended in the section Extensions. */ public String domainType; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A domain object MUST have the member "axes" which has as value an object * where each key is an axis identifier and each value an axis object as defined below. */ public Axes axes; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A domain object MAY have the member "referencing" where the value is an * array of reference system connection objects as defined below. * @@ -67,6 +74,9 @@ public final class Domain extends CoverageJsonObject { */ public List<ReferenceSystemConnection> referencing; + public Domain() { + } + @Override public boolean equals(Object other) { if (other == this) return true; @@ -86,5 +96,4 @@ public final class Domain extends CoverageJsonObject { axes, referencing); } - } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/GeographicCRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/GeographicCRS.java index 8677486375..bbd757ef7d 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/GeographicCRS.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/GeographicCRS.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * Geographic CRSs anchor coordinate values to an ellipsoidal approximation of * the Earth. They have coordinate axes of geodetic longitude and geodetic * latitude, and perhaps height above the ellipsoid (i.e. they can be two- or three-dimensional). @@ -40,18 +42,23 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","id","description"}) public final class GeographicCRS extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The object MAY have an "id" member, whose value MUST be a string and * SHOULD be a common identifier for the reference system. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The object MAY have a "description" member, where the value MUST be an * i18n object, but no standardized content is interpreted from this description. */ public I18N description; + public GeographicCRS() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/I18N.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/I18N.java index fdebfd2175..fd96f88578 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/I18N.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/I18N.java @@ -30,7 +30,9 @@ import java.util.Map; import org.apache.sis.storage.coveragejson.binding.I18N.Serializer; import org.opengis.util.InternationalString; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The special language tag "und" can be used to identify a value whose language * is unknown or undetermined. * @@ -88,6 +90,9 @@ public final class I18N extends Dictionary<String> implements InternationalStrin } public static class Deserializer implements JsonbDeserializer<I18N> { + public Deserializer() { + } + @Override public I18N deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { final I18N candidate = new I18N(); @@ -105,6 +110,8 @@ public final class I18N extends Dictionary<String> implements InternationalStrin } public static class Serializer implements JsonbSerializer<I18N> { + public Serializer() { + } @Override public void serialize(I18N ranges, JsonGenerator jg, SerializationContext sc) { @@ -114,6 +121,5 @@ public final class I18N extends Dictionary<String> implements InternationalStrin } jg.writeEnd(); } - } } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/IdentifierRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/IdentifierRS.java index 73e17c371e..26c0117323 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/IdentifierRS.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/IdentifierRS.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * Identifier-based reference systems (identifier RS) . * * Coordinate values associated with an identifier RS MUST be strings. @@ -30,32 +32,42 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","id","label","description","targetConcept","identifiers"}) public final class IdentifierRS extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An identifier RS object MAY have a member "id" where the value MUST be a * string and SHOULD be a common identifier for the reference system. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An identifier RS object MAY have a member "label" where the value MUST be * an i18n object that is the name of the reference system. */ public I18N label; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An identifier RS object MAY have a member "description" where the value * MUST be an i18n object that is the (perhaps lengthy) description of the * reference system. */ public I18N description; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An identifier RS object MUST have a member "targetConcept" */ public TargetConcept targetConcept; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An identifier RS object MAY have a member "identifiers". */ public Identifiers identifiers; + public IdentifierRS() { + } @Override public boolean equals(Object other) { @@ -80,5 +92,4 @@ public final class IdentifierRS extends CoverageJsonObject { targetConcept, identifiers); } - } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Identifiers.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Identifiers.java index 302fe0fa91..daec78fc6b 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Identifiers.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Identifiers.java @@ -18,6 +18,7 @@ package org.apache.sis.storage.coveragejson.binding; /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An identifier RS object MAY have a member "identifiers" where the value is * an object where each key is an identifier referenced by the identifier RS * and each value an object describing the referenced concept, equal to "targetConcept". @@ -25,5 +26,6 @@ package org.apache.sis.storage.coveragejson.binding; * @author Johann Sorel (Geomatys) */ public final class Identifiers extends Dictionary<TargetConcept> { - + public Identifiers() { + } } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/NdArray.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/NdArray.java index a6c1e9de3b..7af9c3f2ba 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/NdArray.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/NdArray.java @@ -22,7 +22,9 @@ import java.util.Arrays; import java.util.List; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A CoverageJSON object with the type "NdArray" is an NdArray object. * It represents a multidimensional (>= 0D) array with named axes, encoded as a * flat, one-dimensional JSON array in row-major order. @@ -45,12 +47,15 @@ public final class NdArray extends CoverageJsonObject { public static final String DATATYPE_STRING = "string"; /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An NdArray object MUST have a member with the name "dataType" where the * value is either "float", "integer", or "string" and MUST correspond to * the data type of the non-null values in the "values" array. */ public String dataType; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An NdArray object MAY have a member with the name "axisNames" where the * value is an array of strings of the same length as "shape", such that * each string assigns a name to the corresponding dimension. For 0D arrays, @@ -58,7 +63,9 @@ public final class NdArray extends CoverageJsonObject { * be included. */ public String[] axisNames; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An NdArray object MAY have a member with the name "shape" where the value * is an array of integers. For 0D arrays, "shape" MAY be omitted * (defaulting to []). For >= 1D arrays it MUST be included. @@ -67,7 +74,9 @@ public final class NdArray extends CoverageJsonObject { * equal the number of elements in the "values" array. */ public int[] shape; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * An NdArray object MUST have a member with the name "values" where the * value is a non-empty array of numbers and nulls, or strings and nulls, * where nulls represent missing data. @@ -80,6 +89,9 @@ public final class NdArray extends CoverageJsonObject { */ public List<Object> values; //because of null and string values + public NdArray() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ObservedProperty.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ObservedProperty.java index 48541f7e60..f9981bb8cb 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ObservedProperty.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ObservedProperty.java @@ -21,7 +21,9 @@ import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.List; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * Observed property is an object which MUST have the member "label" and which * MAY have the members "id", "description", and "categories". * @@ -30,24 +32,29 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"id","label","description","categories"}) public final class ObservedProperty extends Dictionary<Object> { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * If given, the value of "id" MUST be a string and SHOULD be a common * identifier. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The value of "label" MUST be an i18n object that is the name of the * observed property and which SHOULD be short. */ public I18N label; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * If given, the value of "description" MUST be an i18n object with a * textual description of the observed property. */ public I18N description; + /** - * + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * If given, the value of "categories" MUST be a non-empty array of category * objects. */ @@ -84,5 +91,4 @@ public final class ObservedProperty extends Dictionary<Object> { description, categories); } - } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameter.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameter.java index bc80c87a85..50b3bd21d1 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameter.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameter.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter object MAY have any number of members (name/value pairs). * * @author Johann Sorel (Geomatys) @@ -28,40 +30,53 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","id","label","description","unit","observedProperty","categoryEncoding"}) public final class Parameter extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter object MAY have a member with the name "id" where the value * MUST be a string and SHOULD be a common identifier. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter object MAY have a member with the name "label" where the value * MUST be an i18n object that is the name of the parameter and which SHOULD be short. * Note that this SHOULD be left out if it would be identical to the "label" * of the "observedProperty" member. */ public I18N label; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter object MAY have a member with the name "description" where * the value MUST be an i18n object which is a, perhaps lengthy, textual * description of the parameter. */ public I18N description; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter object MAY have a member with the name "unit". * A parameter object MUST NOT have a "unit" member if the "observedProperty" * member has a "categories" member. */ public Unit unit; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter object MUST have a member with the name "observedProperty". */ public ObservedProperty observedProperty; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter object MAY have a member with the name "categoryEncoding". */ public CategoryEncoding categoryEncoding; + public Parameter() { + } + @Override public boolean equals(Object other) { if (other == this) return true; @@ -87,5 +102,4 @@ public final class Parameter extends CoverageJsonObject { observedProperty, categoryEncoding); } - } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ParameterGroup.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ParameterGroup.java index 452018b6aa..0519110283 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ParameterGroup.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ParameterGroup.java @@ -21,7 +21,9 @@ import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Arrays; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter group object MUST have either or both the members "label" or/and "observedProperty". * * @author Johann Sorel (Geomatys) @@ -29,30 +31,37 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","id","label","description","observedProperty","members"}) public final class ParameterGroup extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter group object MAY have a member with the name "id" where the * value MUST be a string and SHOULD be a common identifier. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter group object MAY have a member with the name "label" where * the value MUST be an i18n object that is the name of the parameter group * and which SHOULD be short. Note that this SHOULD be left out if it would * be identical to the "label" of the "observedProperty" member. */ public I18N label; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter group object MAY have a member with the name "description" * where the value MUST be an i18n object which is a, perhaps lengthy, * textual description of the parameter group. */ public String description; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A parameter group object MAY have a member with the name "observedProperty" * where the value is an object as specified for parameter objects. */ public ObservedProperty observedProperty; + /** * A parameter group object MUST have a member with the name "members" * where the value is a non-empty array of parameter identifiers @@ -60,6 +69,9 @@ public final class ParameterGroup extends CoverageJsonObject { */ public String[] members; + public ParameterGroup() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameters.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameters.java index 376c2b23d1..ebce911075 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameters.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Parameters.java @@ -30,6 +30,7 @@ import java.util.Map; import org.apache.sis.storage.coveragejson.binding.Parameters.Deserializer; import org.apache.sis.storage.coveragejson.binding.Parameters.Serializer; + /** * Constains a map of parameter objects. * @@ -38,8 +39,13 @@ import org.apache.sis.storage.coveragejson.binding.Parameters.Serializer; @JsonbTypeDeserializer(Deserializer.class) @JsonbTypeSerializer(Serializer.class) public final class Parameters extends Dictionary<Parameter> { + public Parameters() { + } public static class Deserializer implements JsonbDeserializer<Parameters> { + public Deserializer() { + } + @Override public Parameters deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { final Parameters parameters = new Parameters(); @@ -57,6 +63,8 @@ public final class Parameters extends Dictionary<Parameter> { } public static class Serializer implements JsonbSerializer<Parameters> { + public Serializer() { + } @Override public void serialize(Parameters parameters, JsonGenerator jg, SerializationContext sc) { @@ -66,6 +74,5 @@ public final class Parameters extends Dictionary<Parameter> { } jg.writeEnd(); } - } } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ProjectedCRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ProjectedCRS.java index a19c553c73..d99f33da36 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ProjectedCRS.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ProjectedCRS.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * Projected CRSs use two coordinates to denote positions on a Cartesian plane, * which is derived from projecting the ellipsoid according to some defined transformation. * @@ -32,18 +34,23 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","id","description"}) public final class ProjectedCRS extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The object MAY have an "id" member, whose value MUST be a string and * SHOULD be a common identifier for the reference system. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The object MAY have a "description" member, where the value MUST be an * i18n object, but no standardized content is interpreted from this description. */ public I18N description; + public ProjectedCRS() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Ranges.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Ranges.java index d272abac20..9b77013222 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Ranges.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Ranges.java @@ -27,6 +27,7 @@ import jakarta.json.stream.JsonParser; import java.lang.reflect.Type; import java.util.Map.Entry; + /** * * @author Johann Sorel (Geomatys) @@ -34,8 +35,13 @@ import java.util.Map.Entry; @JsonbTypeDeserializer(Ranges.Deserializer.class) @JsonbTypeSerializer(Ranges.Serializer.class) public final class Ranges extends Dictionary<NdArray> { + public Ranges() { + } public static class Deserializer implements JsonbDeserializer<Ranges> { + public Deserializer() { + } + @Override public Ranges deserialize(JsonParser parser, DeserializationContext ctx, Type rtType) { final Ranges candidate = new Ranges(); @@ -53,6 +59,8 @@ public final class Ranges extends Dictionary<NdArray> { } public static class Serializer implements JsonbSerializer<Ranges> { + public Serializer() { + } @Override public void serialize(Ranges ranges, JsonGenerator jg, SerializationContext sc) { @@ -62,6 +70,5 @@ public final class Ranges extends Dictionary<NdArray> { } jg.writeEnd(); } - } } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ReferenceSystemConnection.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ReferenceSystemConnection.java index 69d2b61a32..a15d6b02f6 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ReferenceSystemConnection.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/ReferenceSystemConnection.java @@ -21,7 +21,9 @@ import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.List; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A reference system connection object creates a link between values within * domain axes and a reference system to be able to interpret those values, e.g. * as coordinates in a certain coordinate reference system. @@ -31,8 +33,8 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"coordinates","system"}) public final class ReferenceSystemConnection extends Dictionary<Object> { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A reference system connection object MUST have a member "coordinates" * which has as value an array of coordinate identifiers that are referenced * in this object. Depending on the type of referencing, the ordering of the @@ -41,12 +43,17 @@ public final class ReferenceSystemConnection extends Dictionary<Object> { * in the coordinate reference system. */ public List<String> coordinates; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A reference system connection object MUST have a member "system" whose * value MUST be a Reference System Object. */ public CoverageJsonObject system; + public ReferenceSystemConnection() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Symbol.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Symbol.java index 52b26175ec..0f4f4cb3db 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Symbol.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Symbol.java @@ -20,6 +20,7 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** * * @author Johann Sorel (Geomatys) @@ -27,18 +28,22 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"value","type"}) public final class Symbol extends Dictionary<Object> { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * "value" is the symbolic unit notation */ public String value; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * "type" references the unit serialization scheme that is used. "type" MUST * HAVE the value "http://www.opengis.net/def/uom/UCUM/" if UCUM is used, or * a custom value as recommended in section Extensions. */ public String type; + public Symbol() { + } @Override public boolean equals(Object other) { diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TargetConcept.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TargetConcept.java index 0537e5187a..70e371c067 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TargetConcept.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TargetConcept.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * TargetConcept is an object that MUST have a member "label" and MAY have a member * "description" where the value of each MUST be an i18n object that is the * name or description, respectively, of the concept which is referenced in the system. @@ -34,6 +36,9 @@ public final class TargetConcept extends Dictionary<Object> { public I18N label; public I18N description; + public TargetConcept() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TemporalRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TemporalRS.java index 9159a46a53..dd27f8d6dc 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TemporalRS.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TemporalRS.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * Time is referenced by a temporal reference system (temporal RS). In the current * version of this Community Standard, only a string-based notation for time * values is defined. Future versions of this Community Standard may allow for @@ -46,19 +48,24 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","calendar","timeScale"}) public final class TemporalRS extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A temporal RS object MUST have a member "calendar" with value "Gregorian" or a URI. * If the Gregorian calendar is used, then "calendar" MUST have the value "Gregorian" and cannot be a URI. */ public String calendar; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A temporal RS object MAY have a member "timeScale" with a URI as value. * If omitted, the time scale defaults to "UTC". If the time scale is UTC, * the "timeScale" member MUST be omitted. */ public String timeScale; + public TemporalRS() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TileSet.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TileSet.java index 37a062e6b9..144f7f26eb 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TileSet.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TileSet.java @@ -21,6 +21,7 @@ import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Arrays; import java.util.Objects; + /** * * @author Johann Sorel (Geomatys) @@ -28,8 +29,8 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"tileShape","urlTemplate"}) public final class TileSet extends Dictionary<Object> { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A TileSet object MUST have a member with the name "tileShape" where * the value is an array of the same length as "shape" and where each * array element is either null or an integer lower or equal than the @@ -37,7 +38,9 @@ public final class TileSet extends Dictionary<Object> { * is not tiled. */ public Integer[] tileShape; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A TileSet object MUST have a member with the name "urlTemplate" where * the value is a Level 1 URI template as defined in RFC 6570 . * The URI template MUST contain a variable for each axis name whose @@ -55,6 +58,9 @@ public final class TileSet extends Dictionary<Object> { */ public String urlTemplate; + public TileSet() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TiledNdArray.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TiledNdArray.java index 0c9e594f79..3da50651ca 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TiledNdArray.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/TiledNdArray.java @@ -21,7 +21,9 @@ import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Arrays; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A CoverageJSON object with the type "TiledNdArray" is a TiledNdArray object. * It represents a multidimensional (>= 1D) array with named axes that is split * up into sets of linked NdArray documents. Each tileset typically covers a @@ -33,28 +35,37 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"dataType","shape","axisNames","tileSets"}) public final class TiledNdArray extends Dictionary<Object> { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A TiledNdArray object MUST have a member with the name "dataType" where * the value is either "float", "integer", or "string". */ public String dataType; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A TiledNdArray object MUST have a member with the name "shape" where the * value is a non-empty array of integers. */ public int[] shape; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A TiledNdArray object MUST have a member with the name "axisNames" where * the value is a string array of the same length as "shape". */ public String[] axisNames; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A TiledNdArray object MUST have a member with the name "tileSets" where * the value is a non-empty array of TileSet objects. */ public TileSet[] tileSets; + public TiledNdArray() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Unit.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Unit.java index 8566236e9d..8114edc85c 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Unit.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/Unit.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * A "unit" where the value is an object which MUST have either or both the members * "label" or/and "symbol". * @@ -29,20 +31,24 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"id","label","symbol"}) public final class Unit extends Dictionary<Object> { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * MAY have the member "id". * If given, the value of "id" MUST be a string and * SHOULD be a common identifier. It is RECOMMENDED to reference a unit * serialization scheme to allow automatic unit conversion. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * If given, the value of "label" MUST be an i18n object of the name of * the unit and SHOULD be short. */ public I18N label; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * If given, the value of "symbol" MUST either be a string of the symbolic notation of the unit, * or an object with the members "value" and "type". */ diff --git a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/VerticalCRS.java b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/VerticalCRS.java index 534992cb17..b5717382a7 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/VerticalCRS.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/main/org/apache/sis/storage/coveragejson/binding/VerticalCRS.java @@ -20,7 +20,9 @@ import jakarta.json.bind.annotation.JsonbNillable; import jakarta.json.bind.annotation.JsonbPropertyOrder; import java.util.Objects; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * Vertical CRSs use a single coordinate to denote some measure of height or depth, * usually approximately oriented with gravity. * @@ -29,18 +31,23 @@ import java.util.Objects; @JsonbNillable(false) @JsonbPropertyOrder({"type","id","description"}) public final class VerticalCRS extends CoverageJsonObject { - /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The object MAY have an "id" member, whose value MUST be a string and * SHOULD be a common identifier for the reference system. */ public String id; + /** + * COPIED FROM OGC SPECIFICATION (TODO: ADAPT): * The object MAY have a "description" member, where the value MUST be an * i18n object, but no standardised content is interpreted from this description. */ public I18N description; + public VerticalCRS() { + } + @Override public boolean equals(Object other) { if (other == this) return true; diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/CoverageJsonStoreTest.java b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/CoverageJsonStoreTest.java index 22a37f2155..3866b60c0c 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/CoverageJsonStoreTest.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/CoverageJsonStoreTest.java @@ -16,7 +16,6 @@ */ package org.apache.sis.storage.coveragejson; -import jakarta.json.bind.JsonbBuilder; import java.awt.image.BufferedImage; import java.awt.image.Raster; import java.awt.image.WritableRaster; @@ -24,6 +23,7 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import org.opengis.util.FactoryException; import org.apache.sis.coverage.grid.GridCoverage; import org.apache.sis.coverage.grid.GridCoverageBuilder; import org.apache.sis.coverage.grid.GridExtent; @@ -43,18 +43,20 @@ import static org.junit.jupiter.api.Assertions.*; import org.junit.Test; import org.opengis.metadata.spatial.DimensionNameType; + /** * * @author Johann Sorel (Geomatys) */ public class CoverageJsonStoreTest { + public CoverageJsonStoreTest() { + } /** * Test coverage example from https://covjson.org/playground/. */ @Test - public void testReadCoverageXYZT() throws Exception { - + public void testReadCoverageXYZT() throws DataStoreException, FactoryException { try (final DataStore store = new CoverageJsonStoreProvider().open(new StorageConnector(CoverageJsonStoreTest.class.getResource("coverage_xyzt.json")))) { //test grid coverage resource exist @@ -81,7 +83,6 @@ public class CoverageJsonStoreTest { //TODO test transform } - { //test data GridCoverage coverage = gcr.read(null); Raster data = coverage.render(null).getData(); @@ -93,7 +94,6 @@ public class CoverageJsonStoreTest { assertEquals(Double.NaN, data.getSampleDouble(2, 1, 0), 0.0); } } - } /** @@ -125,7 +125,6 @@ public class CoverageJsonStoreTest { raster.setSample(2, 1, 0, 7); raster.setSample(3, 1, 0, 8); - final GridCoverageBuilder gcb = new GridCoverageBuilder(); gcb.setDomain(grid); gcb.setValues(image); @@ -135,12 +134,9 @@ public class CoverageJsonStoreTest { aggregate.add(gcr); - String json = Files.readString(tempPath, StandardCharsets.UTF_8); - } finally { Files.deleteIfExists(tempPath); } } - } diff --git a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/BindingTest.java b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/BindingTest.java index ebfa29f159..66a60c7044 100644 --- a/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/BindingTest.java +++ b/incubator/src/org.apache.sis.storage.coveragejson/test/org/apache/sis/storage/coveragejson/binding/BindingTest.java @@ -37,6 +37,7 @@ import static org.junit.jupiter.api.Assertions.*; import org.junit.BeforeClass; import org.junit.Test; + /** * Test coverage-json bindings. * @@ -48,6 +49,9 @@ public class BindingTest { private static Jsonb jsonb; + public BindingTest() { + } + public static String readResource(String path) throws IOException { final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); @@ -134,7 +138,6 @@ public class BindingTest { @Test public void testCoverageVerticalProfile() throws Exception { - final GeographicCRS geoCrs = new GeographicCRS(); geoCrs.id = "http://www.opengis.net/def/crs/OGC/1.3/CRS84";