sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmarec...@apache.org
Subject svn commit: r1754419 - in /sis/branches/JDK8/storage: sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
Date Thu, 28 Jul 2016 14:40:30 GMT
Author: rmarechal
Date: Thu Jul 28 14:40:29 2016
New Revision: 1754419

URL: http://svn.apache.org/viewvc?rev=1754419&view=rev
Log:
add metadata attributs group and coverageDescription

Modified:
    sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
    sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java

Modified: sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java?rev=1754419&r1=1754418&r2=1754419&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/ImageFileDirectory.java
[UTF-8] Thu Jul 28 14:40:29 2016
@@ -233,6 +233,7 @@ final class ImageFileDirectory {
              * The minimum component value used. Default is 0.
              */
             case Tags.MinSampleValue: {
+                final double value = type.readDouble(reader.input, count);
                 // TODO
                 break;
             }

Modified: sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java?rev=1754419&r1=1754418&r2=1754419&view=diff
==============================================================================
--- sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
[UTF-8] (original)
+++ sis/branches/JDK8/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
[UTF-8] Thu Jul 28 14:40:29 2016
@@ -42,6 +42,11 @@ import org.apache.sis.util.iso.Types;
 
 // Branch-dependent imports
 import java.time.LocalDate;
+import org.apache.sis.metadata.iso.content.DefaultAttributeGroup;
+import org.apache.sis.metadata.iso.content.DefaultBand;
+import org.apache.sis.metadata.iso.content.DefaultCoverageDescription;
+import org.apache.sis.metadata.iso.content.DefaultRangeDimension;
+import org.apache.sis.metadata.iso.content.DefaultSampleDimension;
 
 
 /**
@@ -90,6 +95,21 @@ public class MetadataBuilder {
     private DefaultLegalConstraints constraints;
 
     /**
+     * Information about the content of a grid data cell, or {@code null} if none.
+     */
+    private DefaultCoverageDescription coverageDescription;
+
+    /**
+     * Information about content type for groups of attributes for a specific range dimension,
or {@code null} if none.
+     */
+    private DefaultAttributeGroup attributGroup;
+
+    /**
+     * The characteristic of each dimension (layer) included in the resource, or {@code null}
if none.
+     */
+    private DefaultSampleDimension sampleDimension;
+
+    /**
      * Creates a new metadata reader.
      */
     public MetadataBuilder() {
@@ -137,6 +157,17 @@ public class MetadataBuilder {
             identification().getResourceConstraints().add(constraints);
             constraints = null;
         }
+        if (sampleDimension != null) {
+            attributGroup().getAttributes().add(sampleDimension);
+        }
+        if (attributGroup != null) {
+            coverageDescription().getAttributeGroups().add(attributGroup);
+            attributGroup = null;
+        }
+        if (coverageDescription != null) {
+            metadata().getContentInfo().add(coverageDescription);
+            coverageDescription = null;
+        }
         if (identification != null) {
             metadata().getIdentificationInfo().add(identification);
             identification = null;
@@ -231,6 +262,42 @@ public class MetadataBuilder {
     }
 
     /**
+     * Creates the band information object if it does not already exists, then return it.
+     *
+     * @return the band information (never {@code null}).
+     */
+    private DefaultSampleDimension sampleDimension() {
+        if (sampleDimension == null) {
+            sampleDimension = new DefaultSampleDimension();
+        }
+        return sampleDimension;
+    }
+
+    /**
+     * Creates the attributGroup information object if it does not already exists, then return
it.
+     *
+     * @return the attributGroup information (never {@code null}).
+     */
+    private DefaultAttributeGroup attributGroup() {
+        if (attributGroup == null) {
+            attributGroup = new DefaultAttributeGroup();
+        }
+        return attributGroup;
+    }
+
+    /**
+     * Creates the coverageDescription information object if it does not already exists,
then return it.
+     *
+     * @return the coverageDescription information (never {@code null}).
+     */
+    private DefaultCoverageDescription coverageDescription() {
+        if (coverageDescription == null) {
+            coverageDescription = new DefaultCoverageDescription();
+        }
+        return coverageDescription;
+    }
+
+    /**
      * Adds the given character encoding to the metadata.
      *
      * @param encoding  the character encoding to add.
@@ -363,6 +430,11 @@ public class MetadataBuilder {
         }
     }
 
+    public final void addMinimumSampleValue(final double minimumSampleValue) {
+        if (!Double.isNaN(minimumSampleValue)) {
+        }
+    }
+
     /**
      * Elements to omit in the legal notice to be parsed by {@link MetadataBuilder#parseLegalNotice(String)}.
      * Some of those elements are implied by the metadata were the legal notice will be stored.



Mime
View raw message