sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1773274 [7/9] - in /sis/trunk: ./ application/sis-console/src/main/artifact/ application/sis-openoffice/src/main/unopkg/ core/sis-build-helper/src/main/javadoc/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/ma...
Date Thu, 08 Dec 2016 17:42:52 GMT
Modified: sis/trunk/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/build.xml?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/build.xml (original)
+++ sis/trunk/ide-project/NetBeans/build.xml Thu Dec  8 17:42:51 2016
@@ -53,6 +53,9 @@
       <fileset dir="${project.root}/storage/sis-netcdf/target/generated-resources">
         <include name="**/*.utf"/>
       </fileset>
+      <fileset dir="${project.root}/storage/sis-geotiff/target/generated-resources">
+        <include name="**/*.utf"/>
+      </fileset>
       <!-- Pending discussion about how to handle resources in the Shapefile module.
       <fileset dir="${project.root}/storage/sis-shapefile/target/generated-resources">
         <include name="**/*.utf"/>
@@ -63,6 +66,9 @@
       <fileset dir="${project.root}/core/sis-utility/src/main/resources">
         <include name="**/*.properties"/>
       </fileset>
+      <fileset dir="${project.root}/core/sis-metadata/src/main/resources">
+        <include name="**/*.sql"/>
+      </fileset>
       <fileset dir="${project.root}/core/sis-referencing/src/main/resources">
         <include name="**/*.sql"/>
       </fileset>

Modified: sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/build-impl.xml Thu Dec  8 17:42:51 2016
@@ -46,8 +46,8 @@ is divided into following sections:
         <property file="${user.properties.file}"/>
         <!-- The two properties below are usually overridden -->
         <!-- by the active platform. Just a fallback. -->
-        <property name="default.javac.source" value="1.4"/>
-        <property name="default.javac.target" value="1.4"/>
+        <property name="default.javac.source" value="1.6"/>
+        <property name="default.javac.target" value="1.6"/>
     </target>
     <target depends="-pre-init,-init-private,-init-user" name="-init-project">
         <property file="nbproject/configs/${config}.properties"/>
@@ -76,7 +76,7 @@ is divided into following sections:
             <and>
                 <isset property="javac.profile"/>
                 <length length="0" string="${javac.profile}" when="greater"/>
-                <matches pattern="1\.[89](\..*)?" string="${javac.source}"/>
+                <matches pattern="((1\.[89])|9)(\..*)?" string="${javac.source}"/>
             </and>
         </condition>
         <condition property="do.archive">
@@ -179,6 +179,7 @@ is divided into following sections:
         <property name="application.args" value=""/>
         <property name="source.encoding" value="${file.encoding}"/>
         <property name="runtime.encoding" value="${source.encoding}"/>
+        <property name="manifest.encoding" value="${source.encoding}"/>
         <condition property="javadoc.encoding.used" value="${javadoc.encoding}">
             <and>
                 <isset property="javadoc.encoding"/>
@@ -985,7 +986,7 @@ is divided into following sections:
                     </chainedmapper>
                 </pathconvert>
                 <taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs"
classpath="${libs.CopyLibs.classpath}" name="copylibs"/>
-                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}"
index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}"
rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
+                <copylibs compress="${jar.compress}" excludeFromCopy="${copylibs.excludes}"
index="${jar.index}" indexMetaInf="${jar.index.metainf}" jarfile="${dist.jar}" manifest="@{manifest}"
manifestencoding="UTF-8" rebase="${copylibs.rebase}" runtimeclasspath="${run.classpath.without.build.classes.dir}">
                     <fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
                     <manifest>
                         <attribute name="Class-Path" value="${jar.classpath}"/>
@@ -997,7 +998,7 @@ is divided into following sections:
     </target>
     <target name="-init-presetdef-jar">
         <presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
-            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}">
+            <jar compress="${jar.compress}" index="${jar.index}" jarfile="${dist.jar}"
manifestencoding="UTF-8">
                 <j2seproject1:fileset dir="${build.classes.dir}" excludes="${dist.archive.excludes}"/>
             </jar>
         </presetdef>
@@ -1132,15 +1133,15 @@ is divided into following sections:
     </target>
     <target depends="init" if="do.archive+manifest.available" name="-do-jar-copy-manifest">
         <tempfile deleteonexit="true" destdir="${build.dir}" property="tmp.manifest.file"/>
-        <copy file="${manifest.file}" tofile="${tmp.manifest.file}"/>
+        <copy encoding="${manifest.encoding}" file="${manifest.file}" outputencoding="UTF-8"
tofile="${tmp.manifest.file}"/>
     </target>
     <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+main.class.available"
name="-do-jar-set-mainclass">
-        <manifest file="${tmp.manifest.file}" mode="update">
+        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
             <attribute name="Main-Class" value="${main.class}"/>
         </manifest>
     </target>
     <target depends="init,-do-jar-create-manifest,-do-jar-copy-manifest" if="do.archive+profile.available"
name="-do-jar-set-profile">
-        <manifest file="${tmp.manifest.file}" mode="update">
+        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
             <attribute name="Profile" value="${javac.profile}"/>
         </manifest>
     </target>
@@ -1148,7 +1149,7 @@ is divided into following sections:
         <basename file="${application.splash}" property="splashscreen.basename"/>
         <mkdir dir="${build.classes.dir}/META-INF"/>
         <copy failonerror="false" file="${application.splash}" todir="${build.classes.dir}/META-INF"/>
-        <manifest file="${tmp.manifest.file}" mode="update">
+        <manifest encoding="UTF-8" file="${tmp.manifest.file}" mode="update">
             <attribute name="SplashScreen-Image" value="META-INF/${splashscreen.basename}"/>
         </manifest>
     </target>
@@ -1343,7 +1344,7 @@ is divided into following sections:
     <target depends="-profile-check" description="Profile a selected class in the IDE."
if="profiler.configured" name="profile-test-with-main">
         <fail unless="run.class">Must select one file in the IDE or set run.class</fail>
         <startprofiler/>
-        <antcal target="run-test-with-main"/>
+        <antcall target="run-test-with-main"/>
     </target>
     <target depends="-profile-check,-profile-applet-pre72" if="profiler.configured" name="profile-applet"
unless="profiler.info.jvmargs.agent">
         <fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>

Modified: sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] Thu Dec  8 17:42:51
2016
@@ -4,5 +4,5 @@ build.xml.data.CRC32=58e6b21c
 build.xml.script.CRC32=462eaba0
 build.xml.stylesheet.CRC32=28e38971@1.53.1.46
 nbproject/build-impl.xml.data.CRC32=1e4bcb46
-nbproject/build-impl.xml.script.CRC32=86d40ceb
-nbproject/build-impl.xml.stylesheet.CRC32=05530350@1.79.1.48
+nbproject/build-impl.xml.script.CRC32=6fc623fd
+nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48

Modified: sis/trunk/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/trunk/ide-project/NetBeans/nbproject/project.properties?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/trunk/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Thu Dec  8 17:42:51
2016
@@ -83,15 +83,17 @@ georss.version       = 0.9.8
 rome.version         = 0.9
 jdom1.version        = 1.0
 jdom2.version        = 2.0.4
-jee.version          = 6.0
+jee.version          = 7.0
 osgi.version         = 6.0.0
-netcdf.version       = 4.6.4
+netcdf.version       = 4.6.6
 joda-time.version    = 2.2
 httpclient.version   = 4.3.6
 slf4j.version        = 1.7.7
 junit.version        = 4.12
 hamcrest.version     = 1.3
 jaxb-ns-mapper       = 2.2.4
+hsqldb.version       = 2.3.4
+postgresql.version   = 9.4.1212.jre7
 
 #
 # Classpaths for compilation, execution and tests.
@@ -129,6 +131,8 @@ run.classpath=\
 run.test.classpath=\
     ${javac.test.classpath}:\
     ${build.test.classes.dir}:\
+    ${maven.repository}/org/hsqldb/hsqldb/${hsqldb.version}/hsqldb-${hsqldb.version}.jar:\
+    ${maven.repository}/org/postgresql/postgresql/${postgresql.version}/postgresql-${postgresql.version}.jar:\
     ${maven.repository}/org/jdom/jdom2/${jdom2.version}/jdom2-${jdom2.version}.jar:\
     ${maven.repository}/edu/ucar/udunits/${netcdf.version}/udunits-${netcdf.version}.jar:\
     ${maven.repository}/edu/ucar/httpservices/${netcdf.version}/httpservices-${netcdf.version}.jar:\

Modified: sis/trunk/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/pom.xml?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/pom.xml (original)
+++ sis/trunk/pom.xml Thu Dec  8 17:42:51 2016
@@ -432,6 +432,20 @@ Apache SIS is a free software, Java lang
         <version>1.12</version>
       </dependency>
 
+      <!-- Databases -->
+      <dependency>
+        <groupId>org.hsqldb</groupId>
+        <artifactId>hsqldb</artifactId>
+        <version>2.3.4</version>
+        <scope>test</scope>
+      </dependency>
+      <dependency>
+        <groupId>org.postgresql</groupId>
+        <artifactId>postgresql</artifactId>
+        <version>9.4.1212.jre7</version>
+        <scope>test</scope>
+      </dependency>
+
       <!-- Optional dependencies -->
       <dependency>
         <groupId>org.osgi</groupId>
@@ -490,11 +504,13 @@ Apache SIS is a free software, Java lang
     <profile>
       <id>apache-release</id>
       <properties>
-        <maven.compiler.debug>false</maven.compiler.debug> <!-- For smaller
JAR files size. -->
+        <maven.compiler.debug>false</maven.compiler.debug>              <!--
For smaller JAR files size. -->
         <maven.compiler.optimize>true</maven.compiler.optimize>
         <org.apache.sis.test.extensive>true</org.apache.sis.test.extensive>
       </properties>
     </profile>
+
+    <!-- Cross-version compilation (to be removed with JDK9). -->
     <profile>
       <id>jdk8</id>
       <activation>
@@ -537,6 +553,31 @@ Apache SIS is a free software, Java lang
             </configuration>
           </plugin>
         </plugins>
+      </build>
+    </profile>
+
+    <!-- ===================================================================
+           If the user has not set the SIS_DATA environment variable, set a
+           default value where we can create a minimalist database.
+         =================================================================== -->
+    <profile>
+      <id>sis-data</id>
+      <activation>
+        <property>
+          <name>!env.SIS_DATA</name>
+        </property>
+      </activation>
+      <build>
+        <plugins>
+          <plugin>
+            <artifactId>maven-surefire-plugin</artifactId>
+            <configuration>
+              <environmentVariables>
+                <SIS_DATA>${session.executionRootDirectory}/target</SIS_DATA>
+              </environmentVariables>
+            </configuration>
+          </plugin>
+        </plugins>
       </build>
     </profile>
   </profiles>

Propchange: sis/trunk/src/main/javadoc/overview.html
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu Dec  8 17:42:51 2016
@@ -1 +1 @@
-text/html
+text/html;charset=UTF-8

Modified: sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/LandsatReader.java
[UTF-8] Thu Dec  8 17:42:51 2016
@@ -47,6 +47,7 @@ import org.apache.sis.metadata.iso.citat
 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.sql.MetadataStoreException;
 import org.apache.sis.referencing.CRS;
 import org.apache.sis.referencing.CommonCRS;
 import org.apache.sis.storage.DataStoreException;
@@ -413,15 +414,15 @@ final class LandsatReader {
      * Invoked for every key-value pairs found in the file.
      * Leading and trailing spaces, if any, have been removed.
      *
-     * @param  key     the key in upper cases.
-     * @param  band    the band number, or 0 if none.
-     * @param  value   the value, without quotes if those quotes existed.
+     * @param  key    the key in upper cases.
+     * @param  band   the band number, or 0 if none.
+     * @param  value  the value, without quotes if those quotes existed.
      * @throws NumberFormatException if the value was expected to be a string but the parsing
failed.
      * @throws DateTimeException if the value was expected to be a date but the parsing failed,
      *         or if the result of the parsing was not of the expected type.
      * @throws IllegalArgumentException if the value is out of range.
      */
-    private void parseKeyValuePair(final String key, final int band, final String value)
+    private void parseKeyValuePair(final String key, final int band, String value)
             throws IllegalArgumentException, DateTimeException, DataStoreException
     {
         switch (key) {
@@ -510,7 +511,14 @@ final class LandsatReader {
              * Value is "GEOTIFF".
              */
             case "OUTPUT_FORMAT": {
-                metadata.addFormat(value);
+                if ("GeoTIFF".equalsIgnoreCase(value)) {
+                    value = "GeoTIFF";                      // Because 'metadata.setFormat(…)'
is case-sensitive.
+                }
+                try {
+                    metadata.setFormat(value);
+                } catch (MetadataStoreException e) {
+                    warning(key, null, e);
+                }
                 break;
             }
             /*
@@ -882,7 +890,7 @@ final class LandsatReader {
      */
     final Metadata getMetadata() throws FactoryException {
         metadata.add(Locale.ENGLISH);
-        metadata.add(ScopeCode.DATASET);
+        metadata.add(ScopeCode.valueOf("COVERAGE"));
         try {
             flushSceneTime();
         } catch (DateTimeException e) {

Propchange: sis/trunk/storage/sis-earth-observation/src/main/java/org/apache/sis/storage/earthobservation/doc-files/LandsatMetadata.html
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu Dec  8 17:42:51 2016
@@ -1 +1 @@
-text/html
+text/html;charset=UTF-8

Modified: sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-earth-observation/src/test/java/org/apache/sis/storage/earthobservation/LandsatReaderTest.java
[UTF-8] Thu Dec  8 17:42:51 2016
@@ -94,7 +94,7 @@ public class LandsatReaderTest extends T
         final String text = formatNameAndValue(DefaultMetadata.castOrCopy(actual).asTreeTable());
         assertMultilinesEquals(
                 "Metadata\n"
-                + "  ├─Spatial representation info (1 of 3)\n"
+                + "  ├─Spatial representation info (1 of 2)\n"
                 + "  │   ├─Number of dimensions…………………………………………………
2\n"
                 + "  │   ├─Axis dimension properties (1 of 2)\n"
                 + "  │   │   ├─Dimension name………………………………………………………
Sample\n"
@@ -102,8 +102,9 @@ public class LandsatReaderTest extends T
                 + "  │   ├─Axis dimension properties (2 of 2)\n"
                 + "  │   │   ├─Dimension name………………………………………………………
Line\n"
                 + "  │   │   └─Dimension size………………………………………………………
15500\n"
-                + "  │   └─Transformation parameter availability…… false\n"
-                + "  ├─Spatial representation info (2 of 3)\n"
+                + "  │   ├─Transformation parameter availability…… false\n"
+                + "  │   └─Check point availability………………………………………
false\n"
+                + "  ├─Spatial representation info (2 of 2)\n"
                 + "  │   ├─Number of dimensions…………………………………………………
2\n"
                 + "  │   ├─Axis dimension properties (1 of 2)\n"
                 + "  │   │   ├─Dimension name………………………………………………………
Sample\n"
@@ -111,16 +112,8 @@ public class LandsatReaderTest extends T
                 + "  │   ├─Axis dimension properties (2 of 2)\n"
                 + "  │   │   ├─Dimension name………………………………………………………
Line\n"
                 + "  │   │   └─Dimension size………………………………………………………
7800\n"
-                + "  │   └─Transformation parameter availability…… false\n"
-                + "  ├─Spatial representation info (3 of 3)\n"
-                + "  │   ├─Number of dimensions…………………………………………………
2\n"
-                + "  │   ├─Axis dimension properties (1 of 2)\n"
-                + "  │   │   ├─Dimension name………………………………………………………
Sample\n"
-                + "  │   │   └─Dimension size………………………………………………………
7600\n"
-                + "  │   ├─Axis dimension properties (2 of 2)\n"
-                + "  │   │   ├─Dimension name………………………………………………………
Line\n"
-                + "  │   │   └─Dimension size………………………………………………………
7800\n"
-                + "  │   └─Transformation parameter availability…… false\n"
+                + "  │   ├─Transformation parameter availability…… false\n"
+                + "  │   └─Check point availability………………………………………
false\n"
                 + "  ├─Reference system info…………………………………………………………
EPSG:WGS 84 / UTM zone 49N\n"
                 + "  ├─Identification info\n"
                 + "  │   ├─Citation\n"
@@ -133,7 +126,7 @@ public class LandsatReaderTest extends T
                 + "  │   ├─Resource format\n"
                 + "  │   │   └─Format specification citation\n"
                 + "  │   │       ├─Title……………………………………………………………………
GeoTIFF Coverage Encoding Profile\n"
-                + "  │   │       └─Alternate title…………………………………………
GEOTIFF\n"
+                + "  │   │       └─Alternate title…………………………………………
GeoTIFF\n"
                 + "  │   ├─Spatial resolution (1 of 2)\n"
                 + "  │   │   └─Distance………………………………………………………………………
15.0\n"
                 + "  │   ├─Spatial resolution (2 of 2)\n"
@@ -297,7 +290,7 @@ public class LandsatReaderTest extends T
                 + "  │   └─Date type………………………………………………………………………………
Creation\n"
                 + "  ├─Default locale+other locale…………………………………………
en\n"
                 + "  ├─Metadata scope\n"
-                + "  │   └─Resource scope…………………………………………………………………
Dataset\n"
+                + "  │   └─Resource scope…………………………………………………………………
COVERAGE\n"
                 + "  ├─Metadata identifier\n"
                 + "  │   └─Code……………………………………………………………………………………………
LandsatTest\n"
                 + "  ├─Metadata standard (1 of 2)\n"

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java
[UTF-8] Thu Dec  8 17:42:51 2016
@@ -20,8 +20,10 @@ import java.net.URL;
 import java.util.Locale;
 import java.util.MissingResourceException;
 import javax.annotation.Generated;
+import org.opengis.util.InternationalString;
 import org.apache.sis.util.resources.KeyConstants;
 import org.apache.sis.util.resources.IndexedResourceBundle;
+import org.apache.sis.util.resources.ResourceInternationalString;
 
 
 /**
@@ -59,10 +61,98 @@ public final class Resources extends Ind
         }
 
         /**
+         * No value specified for the “{0}” TIFF tag. Computed the {1} value from other
tags.
+         */
+        public static final short ComputedValueForAttribute_2 = 0;
+
+        /**
          * Apache SIS implementation requires that all “{0}” elements have the same value,
but the
          * element found in “{1}” are {2}.
          */
-        public static final short ConstantValueRequired_3 = 0;
+        public static final short ConstantValueRequired_3 = 1;
+
+        /**
+         * No value specified for the “{0}” TIFF tag. The {1} default value will be used.
+         */
+        public static final short DefaultValueForAttribute_2 = 2;
+
+        /**
+         * An ordered dither or halftone technique has been applied to the image data. The
dithering or
+         * halftoning matrix size is {0}×{1}.
+         */
+        public static final short DitheringOrHalftoningApplied_2 = 3;
+
+        /**
+         * The “{0}” GeoTIFF key has been ignored.
+         */
+        public static final short IgnoredGeoKey_1 = 16;
+
+        /**
+         * The “{0}” TIFF tag has been ignored.
+         */
+        public static final short IgnoredTag_1 = 4;
+
+        /**
+         * TIFF image “{0}” shall be either tiled or organized into strips.
+         */
+        public static final short InconsistentTileStrip_1 = 5;
+
+        /**
+         * “{1}” is not a valid value for the “{0}” GeoTIFF key.
+         */
+        public static final short InvalidGeoValue_2 = 12;
+
+        /**
+         * TIFF tag “{0}” shall contain at least {1} values but found only {2}.
+         */
+        public static final short ListTooShort_3 = 14;
+
+        /**
+         * TIFF tags “{0}” and “{1}” have values of different lengths. Found “{2}”
and “{3}” elements
+         * respectively.
+         */
+        public static final short MismatchedLength_4 = 6;
+
+        /**
+         * No value has been found for the “{0}” GeoTIFF key.
+         */
+        public static final short MissingGeoValue_1 = 9;
+
+        /**
+         * Can not read TIFF image from “{0}” because the “{1}” tag is missing.
+         */
+        public static final short MissingValue_2 = 7;
+
+        /**
+         * The file defines “{2}” with a value of {3}{4}, but that value should be {1}{4}
for
+         * consistency with {0}.
+         */
+        public static final short NotTheEpsgValue_5 = 17;
+
+        /**
+         * A randomized process such as error diffusion has been applied to the image data.
+         */
+        public static final short RandomizedProcessApplied = 8;
+
+        /**
+         * A single value was expected for the “{0}” key but {1} values have been found.
+         */
+        public static final short UnexpectedListOfValues_2 = 15;
+
+        /**
+         * Found {2} tiles or strips in the “{0}” file while {1} were expected.
+         */
+        public static final short UnexpectedTileCount_3 = 10;
+
+        /**
+         * Coordinate system kind {0} is unsupported.
+         */
+        public static final short UnsupportedCoordinateSystemKind_1 = 11;
+
+        /**
+         * Version {0} of GeoTIFF key directory is not supported.
+         */
+        public static final short UnsupportedGeoKeyDirectory_1 = 13;
     }
 
     /**
@@ -95,4 +185,43 @@ public final class Resources extends Ind
     public static Resources forLocale(final Locale locale) throws MissingResourceException
{
         return getBundle(Resources.class, locale);
     }
+
+    /**
+     * The international string to be returned by {@link formatInternational}.
+     */
+    private static final class International extends ResourceInternationalString {
+        private static final long serialVersionUID = 8489130907339662434L;
+
+        International(short key)                           {super(key);}
+        International(short key, Object args)              {super(key, args);}
+        @Override protected KeyConstants getKeyConstants() {return Keys.INSTANCE;}
+        @Override protected IndexedResourceBundle getBundle(final Locale locale) {
+            return forLocale(locale);
+        }
+    }
+
+    /**
+     * Gets an international string for the given key. This method does not check for the
key
+     * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
+     * when a {@link InternationalString#toString(Locale)} method is invoked.
+     *
+     * @param  key  the key for the desired string.
+     * @return an international string for the given key.
+     */
+    public static InternationalString formatInternational(final short key) {
+        return new International(key);
+    }
+
+    /**
+     * Gets an international string for the given key. This method does not check for the
key
+     * validity. If the key is invalid, then a {@link MissingResourceException} may be thrown
+     * when a {@link InternationalString#toString(Locale)} method is invoked.
+     *
+     * @param  key   the key for the desired string.
+     * @param  args  values to substitute to "{0}", "{1}", <i>etc</i>.
+     * @return an international string for the given key.
+     */
+    public static InternationalString formatInternational(final short key, final Object...
args) {
+        return new International(key, args);
+    }
 }

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties
[ISO-8859-1] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties
[ISO-8859-1] Thu Dec  8 17:42:51 2016
@@ -20,3 +20,20 @@
 # For resources shared by all modules in the Apache SIS project, see "org.apache.sis.util.resources"
package.
 #
 ConstantValueRequired_3           = Apache SIS implementation requires that all \u201c{0}\u201d
elements have the same value, but the element found in \u201c{1}\u201d are {2}.
+ComputedValueForAttribute_2       = No value specified for the \u201c{0}\u201d TIFF tag.
Computed the {1} value from other tags.
+DefaultValueForAttribute_2        = No value specified for the \u201c{0}\u201d TIFF tag.
The {1} default value will be used.
+DitheringOrHalftoningApplied_2    = An ordered dither or halftone technique has been applied
to the image data. The dithering or halftoning matrix size is {0}\u00d7{1}.
+IgnoredTag_1                      = The \u201c{0}\u201d TIFF tag has been ignored.
+IgnoredGeoKey_1                   = The \u201c{0}\u201d GeoTIFF key has been ignored.
+InconsistentTileStrip_1           = TIFF image \u201c{0}\u201d shall be either tiled or organized
into strips.
+InvalidGeoValue_2                 = \u201c{1}\u201d is not a valid value for the \u201c{0}\u201d
GeoTIFF key.
+ListTooShort_3                    = TIFF tag \u201c{0}\u201d shall contain at least {1} values
but found only {2}.
+MismatchedLength_4                = TIFF tags \u201c{0}\u201d and \u201c{1}\u201d have values
of different lengths. Found \u201c{2}\u201d and \u201c{3}\u201d elements respectively.
+MissingGeoValue_1                 = No value has been found for the \u201c{0}\u201d GeoTIFF
key.
+MissingValue_2                    = Can not read TIFF image from \u201c{0}\u201d because
the \u201c{1}\u201d tag is missing.
+NotTheEpsgValue_5                 = The file defines \u201c{2}\u201d with a value of {3}{4},
but that value should be {1}{4} for consistency with {0}.
+RandomizedProcessApplied          = A randomized process such as error diffusion has been
applied to the image data.
+UnexpectedListOfValues_2          = A single value was expected for the \u201c{0}\u201d key
but {1} values have been found.
+UnexpectedTileCount_3             = Found {2} tiles or strips in the \u201c{0}\u201d file
while {1} were expected.
+UnsupportedCoordinateSystemKind_1 = Coordinate system kind {0} is unsupported.
+UnsupportedGeoKeyDirectory_1      = Version {0}\u00a0of GeoTIFF key directory is not supported.

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties
[ISO-8859-1] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties
[ISO-8859-1] Thu Dec  8 17:42:51 2016
@@ -25,3 +25,20 @@
 #   U+00A0 NO-BREAK SPACE         before  :
 #
 ConstantValueRequired_3           = L\u2019impl\u00e9mentation de Apache SIS requiert que
tous les \u00e9l\u00e9ments de \u00ab\u202f{0}\u202f\u00bb aient la m\u00eame valeur, mais
les \u00e9l\u00e9ments trouv\u00e9s dans \u00ab\u202f{1}\u202f\u00bb sont {2}.
+ComputedValueForAttribute_2       = Aucune valeur n\u2019a \u00e9t\u00e9 sp\u00e9cifi\u00e9e
pour le tag TIFF \u00ab\u202f{0}\u202f\u00bb. La valeur {1} a \u00e9t\u00e9 calcul\u00e9e
\u00e0 partir des autres tags.
+DefaultValueForAttribute_2        = Aucune valeur n\u2019a \u00e9t\u00e9 sp\u00e9cifi\u00e9e
pour le tag TIFF \u00ab\u202f{0}\u202f\u00bb. La valeur par d\u00e9faut sera {1}.
+DitheringOrHalftoningApplied_2    = Un tramage ordonn\u00e9 ou une technique en demi-teinte
a \u00e9t\u00e9 appliqu\u00e9. La taille de la matrice de tramage est {0}\u00d7{1}.
+IgnoredTag_1                      = Le tag TIFF \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9
ignor\u00e9.
+IgnoredGeoKey_1                   = La cl\u00e9 GeoTIFF \u00ab\u202f{0}\u202f\u00bb a \u00e9t\u00e9
ignor\u00e9e.
+InconsistentTileStrip_1           = L\u2019image TIFF \u00ab\u202f{0}\u202f\u00bb doit \u00eatre
soit tuil\u00e9e, soit organis\u00e9e par bandes.
+InvalidGeoValue_2                 = La valeur \u00ab\u202f{1}\u202f\u00bb n\u2019est pas
valide pour la cl\u00e9 GeoTIFF \u00ab\u202f{0}\u202f\u00bb.
+ListTooShort_3                    = Le tag TIFF \u00ab\u202f{0}\u202f\u00bb devrait contenir
au moins {1} valeurs alors qu\u2019on n\u2019en a trouv\u00e9 que {2}.
+MismatchedLength_4                = Les tags TIFF \u00ab\u202f{0}\u202f\u00bb et \u00ab\u202f{1}\u202f\u00bb
contiennent des valeurs de longueurs diff\u00e9rentes. On a trouv\u00e9 {2} et {3} \u00e9l\u00e9ments
respectivement.
+MissingGeoValue_1                 = Aucune valeur n\u2019a \u00e9t\u00e9 trouv\u00e9e pour
la cl\u00e9 GeoTIFF \u00ab\u202f{0}\u202f\u00bb.
+MissingValue_2                    = Ne peut pas lire l\u2019image TIFF provenant de \u00ab\u202f{0}\u202f\u00bb
car le tag \u00ab\u202f{1}\u202f\u00bb est manquant.
+NotTheEpsgValue_5                 = Le fichier d\u00e9finit \u00ab\u202f{2}\u202f\u00bb avec
la valeur {3}{4}, mais cette valeur devrait \u00eatre {1}{4} pour \u00eatre coh\u00e9rent
avec {0}.
+RandomizedProcessApplied          = Un processus randomis\u00e9 comme la diffusion d\u2019erreur
a \u00e9t\u00e9 appliqu\u00e9.
+UnexpectedListOfValues_2          = Une seule valeur \u00e9tait attendue pour la cl\u00e9
\u00ab\u202f{0}\u202f\u00bb, mais on en a trouv\u00e9es {1}.
+UnexpectedTileCount_3             = {2} tuiles ont \u00e9t\u00e9 trouv\u00e9es dans le fichier
\u00ab\u202f{0}\u202f\u00bb alors qu\u2019on en attendait {1}.
+UnsupportedCoordinateSystemKind_1 = Le type de syst\u00e8me de coordonn\u00e9es {0} n\u2019est
pas support\u00e9.
+UnsupportedGeoKeyDirectory_1      = La version {0} du r\u00e9pertoire de cl\u00e9s GeoTIFF
n\u2019est pas support\u00e9e.

Copied: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java
(from r1773267, sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java)
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java?p2=sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java&p1=sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java&r1=1773267&r2=1773274&rev=1773274&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java
[UTF-8] Thu Dec  8 17:42:51 2016
@@ -47,13 +47,13 @@ import org.opengis.referencing.datum.Geo
 import org.opengis.referencing.datum.PrimeMeridian;
 import org.opengis.referencing.operation.Conversion;
 import org.opengis.referencing.operation.CoordinateOperation;
-import org.opengis.referencing.operation.CoordinateOperationFactory;
 import org.opengis.referencing.operation.OperationMethod;
 import org.opengis.referencing.NoSuchAuthorityCodeException;
 import org.opengis.util.FactoryException;
 
 import org.apache.sis.internal.geotiff.Resources;
 import org.apache.sis.internal.metadata.WKTKeywords;
+import org.apache.sis.internal.referencing.CoordinateOperations;
 import org.apache.sis.internal.referencing.NilReferencingObject;
 import org.apache.sis.internal.referencing.ReferencingUtilities;
 import org.apache.sis.internal.storage.MetadataBuilder;
@@ -73,6 +73,7 @@ import org.apache.sis.referencing.crs.De
 import org.apache.sis.referencing.factory.GeodeticAuthorityFactory;
 import org.apache.sis.referencing.factory.GeodeticObjectFactory;
 import org.apache.sis.io.TableAppender;
+import org.apache.sis.referencing.operation.DefaultCoordinateOperationFactory;
 import org.apache.sis.util.CharSequences;
 import org.apache.sis.util.Characters;
 import org.apache.sis.util.Debug;
@@ -224,7 +225,7 @@ final class CRSBuilder {
      *
      * @see #operationFactory()
      */
-    private CoordinateOperationFactory operationFactory;
+    private DefaultCoordinateOperationFactory operationFactory;
 
     /**
      * Name of the last object created. This is used by {@link #properties(String)} for reusing
existing instance
@@ -287,9 +288,9 @@ final class CRSBuilder {
      *
      * @return the operation factory (never {@code null}).
      */
-    private CoordinateOperationFactory operationFactory() {
+    private DefaultCoordinateOperationFactory operationFactory() {
         if (operationFactory == null) {
-            operationFactory = DefaultFactories.forBuildin(CoordinateOperationFactory.class);
+            operationFactory = CoordinateOperations.factory();
         }
         return operationFactory;
     }

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/DeferredEntry.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/DeferredEntry.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/DeferredEntry.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/DeferredEntry.java
[UTF-8] Thu Dec  8 17:42:51 2016
@@ -32,9 +32,9 @@ final class DeferredEntry implements Com
     final ImageFileDirectory owner;
 
     /**
-     * The GeoTIFF tag to decode.
+     * The GeoTIFF tag to decode, as an <strong>unsigned</strong> short.
      */
-    final int tag;
+    final short tag;
 
     /**
      * The GeoTIFF type of the value to read.
@@ -54,7 +54,7 @@ final class DeferredEntry implements Com
     /**
      * Creates a new deferred entry.
      */
-    DeferredEntry(final ImageFileDirectory owner, final int tag, final Type type, final long
count, final long offset) {
+    DeferredEntry(final ImageFileDirectory owner, final short tag, final Type type, final
long count, final long offset) {
         this.owner  = owner;
         this.tag    = tag;
         this.type   = type;

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTIFF.java
[UTF-8] Thu Dec  8 17:42:51 2016
@@ -40,12 +40,18 @@ import org.apache.sis.internal.geotiff.R
  */
 abstract class GeoTIFF implements Closeable {
     /**
-     * The timezone specified at construction time, or {@code null} for the default.
+     * The timezone for the date and time parsing, or {@code null} for the default.
      * This is not yet configurable, but may become in a future version.
      */
     private static final TimeZone TIMEZONE = null;
 
     /**
+     * The locale to use for parsers or formatter. This is <strong>not</strong>
the locale
+     * for warnings or other messages emitted to the users.
+     */
+    static final Locale LOCALE = Locale.US;
+
+    /**
      * The store which created this reader or writer.
      */
     final GeoTiffStore owner;
@@ -81,7 +87,7 @@ abstract class GeoTIFF implements Closea
      */
     final DateFormat getDateFormat() {
         if (dateFormat == null) {
-            dateFormat = new SimpleDateFormat("yyy:MM:dd HH:mm:ss", Locale.US);
+            dateFormat = new SimpleDateFormat("yyyy:MM:dd HH:mm:ss", LOCALE);
             if (TIMEZONE != null) {
                 dateFormat.setTimeZone(TIMEZONE);
             }

Modified: sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
URL: http://svn.apache.org/viewvc/sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
[UTF-8] (original)
+++ sis/trunk/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/GeoTiffStore.java
[UTF-8] Thu Dec  8 17:42:51 2016
@@ -19,13 +19,19 @@ package org.apache.sis.storage.geotiff;
 import java.util.Locale;
 import java.io.IOException;
 import java.nio.charset.Charset;
+import java.util.logging.LogRecord;
+import java.nio.charset.StandardCharsets;
+import org.opengis.util.FactoryException;
 import org.opengis.metadata.Metadata;
+import org.opengis.metadata.maintenance.ScopeCode;
 import org.apache.sis.setup.OptionKey;
 import org.apache.sis.storage.DataStore;
 import org.apache.sis.storage.StorageConnector;
 import org.apache.sis.storage.DataStoreException;
 import org.apache.sis.storage.DataStoreContentException;
 import org.apache.sis.internal.storage.ChannelDataInput;
+import org.apache.sis.internal.storage.MetadataBuilder;
+import org.apache.sis.metadata.sql.MetadataStoreException;
 import org.apache.sis.util.resources.Errors;
 import org.apache.sis.util.ArgumentChecks;
 import org.apache.sis.util.Classes;
@@ -64,12 +70,13 @@ public class GeoTiffStore extends DataSt
      * This constructor invokes {@link StorageConnector#closeAllExcept(Object)},
      * keeping open only the needed resource.
      *
-     * @param  storage information about the storage (URL, stream, <i>etc</i>).
+     * @param  storage  information about the storage (URL, stream, <i>etc</i>).
      * @throws DataStoreException if an error occurred while opening the GeoTIFF file.
      */
     public GeoTiffStore(final StorageConnector storage) throws DataStoreException {
         ArgumentChecks.ensureNonNull("storage", storage);
-        encoding = storage.getOption(OptionKey.ENCODING);
+        final Charset encoding = storage.getOption(OptionKey.ENCODING);
+        this.encoding = (encoding != null) ? encoding : StandardCharsets.US_ASCII;
         final ChannelDataInput input = storage.getStorageAs(ChannelDataInput.class);
         if (input == null) {
             throw new DataStoreException(Errors.format(Errors.Keys.IllegalInputTypeForReader_2,
@@ -93,18 +100,28 @@ public class GeoTiffStore extends DataSt
      */
     @Override
     public synchronized Metadata getMetadata() throws DataStoreException {
-        if (metadata == null) try {
-            int n = 0;
-            ImageFileDirectory dir;
+        if (metadata == null) {
+            final MetadataBuilder builder = reader.metadata;
+            try {
+                builder.setFormat("GeoTIFF");
+            } catch (MetadataStoreException e) {
+                warning(null, e);
+            }
+            builder.add(encoding);
+            builder.add(ScopeCode.valueOf("COVERAGE"));
             final Locale locale = getLocale();
-            while ((dir = reader.getImageFileDirectory(n++)) != null) {
-                dir.completeMetadata(reader.metadata, locale);
+            int n = 0;
+            try {
+                ImageFileDirectory dir;
+                while ((dir = reader.getImageFileDirectory(n++)) != null) {
+                    dir.completeMetadata(builder, locale);
+                }
+                metadata = builder.build(true);
+            } catch (IOException e) {
+                throw new DataStoreException(reader.errors().getString(Errors.Keys.CanNotRead_1,
reader.input.filename), e);
+            } catch (FactoryException | ArithmeticException e) {
+                throw new DataStoreContentException(reader.canNotDecode(), e);
             }
-            metadata = reader.metadata.build(true);
-        } catch (IOException e) {
-            throw new DataStoreException(reader.errors().getString(Errors.Keys.CanNotRead_1,
reader.input.filename), e);
-        } catch (ArithmeticException e) {
-            throw new DataStoreContentException(reader.canNotDecode(), e);
         }
         return metadata;
     }
@@ -135,4 +152,23 @@ public class GeoTiffStore extends DataSt
     final void warning(final String message, final Exception exception) {
         listeners.warning(message, exception);
     }
+
+    /**
+     * Reports a warning contained in the given {@link LogRecord}.
+     * Note that the given record will not necessarily be sent to the logging framework;
+     * if the user as registered at least one listener, then the record will be sent to the
listeners instead.
+     *
+     * <p>This method sets the {@linkplain LogRecord#setSourceClassName(String) source
class name} and
+     * {@linkplain LogRecord#setSourceMethodName(String) source method name} to hard-coded
values.
+     * Those values assume that the warnings occurred indirectly from a call to {@link #getMetadata()}
+     * in this class. We do not report private classes or methods as the source of warnings.</p>
+     *
+     * @param  record  the warning to report.
+     */
+    final void warning(final LogRecord record) {
+        // Logger name will be set by listeners.warning(record).
+        record.setSourceClassName(GeoTiffStore.class.getName());
+        record.setSourceMethodName("getMetadata");
+        listeners.warning(record);
+    }
 }




Mime
View raw message