sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1801832 [2/4] - in /sis/branches/JDK7: ./ core/sis-feature/ core/sis-feature/src/main/java/org/apache/sis/feature/ core/sis-feature/src/main/java/org/apache/sis/feature/builder/ core/sis-feature/src/main/java/org/apache/sis/internal/featur...
Date Thu, 13 Jul 2017 12:10:36 GMT
Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/OS.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -16,12 +16,23 @@
  */
 package org.apache.sis.internal.system;
 
+import java.net.URL;
+import java.net.URISyntaxException;
+import java.io.File;
+import java.io.InputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import org.apache.sis.util.logging.Logging;
+import org.apache.sis.util.resources.Errors;
+
 
 /**
  * The operation system on which SIS is running.
  *
  * @author  Martin Desruisseaux (Geomatys)
- * @version 0.3
+ * @version 0.8
  * @since   0.3
  * @module
  */
@@ -29,22 +40,29 @@ public enum OS {
     /**
      * Unknown system.
      */
-    UNKNOWN(false),
+    UNKNOWN(null, false),
 
     /**
      * Windows.
      */
-    WINDOWS(false),
+    WINDOWS("windows", false),
 
     /**
      * Mac OS.
      */
-    MAC_OS(true),
+    MAC_OS("darwin", true),
 
     /**
      * Linux.
      */
-    LINUX(true);
+    LINUX("linux", true);
+
+    /**
+     * The sub-directory where to look for native files ({@code .so} or {@code .dll}).
+     * Those subdirectories are not standard (as far as we know) and could change in
+     * any future Apache SIS version. The directory is {@code null} for unknown OS.
+     */
+    private final String libdir;
 
     /**
      * {@code true} if this OS is a kind of Unix.
@@ -54,8 +72,9 @@ public enum OS {
     /**
      * Creates a new enumeration.
      */
-    private OS(final boolean unix) {
-        this.unix = unix;
+    private OS(final String libdir, final boolean unix) {
+        this.libdir = libdir;
+        this.unix   = unix;
     }
 
     /**
@@ -72,4 +91,59 @@ public enum OS {
         }
         return UNKNOWN;
     }
+
+    /**
+     * Loads the native library of the given name from the JAR file of the given class.
+     * This method searches for a resource in the {@code /native/<os>} directory where
+     * {@code <os>} is {@code windows}, {@code darwin} or {@code linux}.
+     *
+     * @param  caller  a class in the JAR file where to look for native resources.
+     * @param  name    the native library name without {@code ".so"} or {@code ".dll"} extension.
+     * @throws UnsatisfiedLinkError if the native library can not be loaded for the current OS.
+     *
+     * @see System#load(String)
+     */
+    public static void load(final Class<?> caller, final String name) {
+        try {
+            System.load(current().nativeLibrary(caller.getClassLoader(), name));
+        } catch (IOException | SecurityException e) {
+            throw (UnsatisfiedLinkError) new UnsatisfiedLinkError(e.getMessage()).initCause(e);
+        }
+    }
+
+    /**
+     * Returns an absolute path to the library of the given name in the JAR file.
+     * If the resources can not be accessed by an absolute path, then this method
+     * copies the resource in a temporary file.
+     *
+     * @param  loader  the loader of the JAR file where to look for native resources.
+     * @param  name    the native library name without {@code ".so"} or {@code ".dll"} extension.
+     * @return absolute path to the library (may be a temporary file).
+     * @throws IOException if an error occurred while copying the library to a temporary file.
+     * @throws SecurityException if the security manager denies loading resource, creating absolute path, <i>etc</i>.
+     * @throws UnsatisfiedLinkError if no native resource has been found for the current OS.
+     *
+     * @see System#load(String)
+     */
+    private String nativeLibrary(final ClassLoader loader, String name) throws IOException {
+        if (libdir != null) {
+            final String ext = unix ? ".so" : ".dll";
+            name = "native/" + libdir + '/' + name + ext;
+            final URL res = loader.getResource(name);
+            if (res != null) {
+                try {
+                    return new File(res.toURI()).getAbsolutePath();
+                } catch (IllegalArgumentException | URISyntaxException e) {
+                    Logging.recoverableException(Logging.getLogger(Loggers.SYSTEM), OS.class, "nativeLibrary", e);
+                }
+                final Path tmp = Files.createTempFile(name, ext).toAbsolutePath();
+                tmp.toFile().deleteOnExit();
+                try (InputStream in = res.openStream()) {
+                    Files.copy(in, tmp, StandardCopyOption.REPLACE_EXISTING);
+                }
+                return tmp.toString();
+            }
+        }
+        throw new UnsatisfiedLinkError(Errors.format(Errors.Keys.NativeInterfacesNotFound_2, System.getProperty("os.name"), name));
+    }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/ArrayVector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/ArrayVector.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/ArrayVector.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/ArrayVector.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -83,92 +83,77 @@ abstract class ArrayVector<E extends Num
     }
 
     /**
-     * Returns a vector with the same data than this vector but encoded in a more compact way,
-     * or {@code this} if this method can not do better than current {@code Vector} instance.
-     */
-    @Override
-    public final Vector compress(final double tolerance) {
-        final Vector vec = super.compress(tolerance);
-        if (vec == this && !isEmpty()) {
-            if (isInteger()) {
-                /*
-                 * For integer values, verify if we can pack the data into a smaller type.
-                 * We will use a vector backed by IntegerList in order to use only the amount of bits needed,
-                 * unless that amount is exactly the number of bits of a primitive type (8, 16, 32 or 64) in
-                 * which case using one of the specialized class in this ArrayVector is more performant.
-                 */
-                final NumberRange<?> range = range();
-                if (range != null && !range.isEmpty() && range.getMinDouble() >= Long.MIN_VALUE
-                                                      && range.getMaxDouble() <= Long.MAX_VALUE)
-                {
-                    final long min      = range.getMinValue().longValue();
-                    final long max      = range.getMaxValue().longValue();
-                    final long delta    = JDK8.subtractExact(max, min);
-                    final int  bitCount = Long.SIZE - Long.numberOfLeadingZeros(delta);
-                    if (bitCount != Numbers.primitiveBitCount(getElementType())) {
-                        switch (bitCount) {
-                            case Byte.SIZE: {
-                                final boolean isSigned = (min >= Byte.MIN_VALUE && max <= Byte.MAX_VALUE);
-                                if (isSigned || (min >= 0 && max <= 0xFF)) {
-                                    final byte[] array = new byte[size()];
-                                    for (int i=0; i < array.length; i++) {
-                                        array[i] = (byte) intValue(i);
-                                    }
-                                    return isSigned ? new Bytes(array) : new UnsignedBytes(array);
-                                }
-                                break;
-                            }
-                            case Short.SIZE: {
-                                final boolean isSigned = (min >= Short.MIN_VALUE && max <= Short.MAX_VALUE);
-                                if (isSigned || (min >= 0 && max <= 0xFFFF)) {
-                                    final short[] array = new short[size()];
-                                    for (int i=0; i < array.length; i++) {
-                                        array[i] = (short) intValue(i);
-                                    }
-                                    return isSigned ? new Shorts(array) : new UnsignedShorts(array);
-                                }
-                                break;
-                            }
-                            case Integer.SIZE: {
-                                final boolean isSigned = (min >= Integer.MIN_VALUE && max <= Integer.MAX_VALUE);
-                                if (isSigned || (min >= 0 && max <= 0xFFFFFFFF)) {
-                                    final int[] array = new int[size()];
-                                    for (int i=0; i < array.length; i++) {
-                                        array[i] = (int) longValue(i);
-                                    }
-                                    return isSigned ? new Integers(array) : new UnsignedIntegers(array);
-                                }
-                                break;
-                            }
-                            // The Long.SIZE case should never happen because of the 'bitCount' check before the switch.
-                        }
-                        return new PackedVector(this, min, JDK8.toIntExact(delta));
-                    }
-                }
-            } else if (!Float.class.equals(getElementType())) {
-                /*
-                 * For floating point types, verify if values are equivalent to 'float' values.
-                 * There is two different ways to pad extra fraction digits in 'double' values:
-                 * with zero fraction digits in base 2 representation (the standard Java cast),
-                 * or with zero fraction digits in base 10 representation.
-                 */
-                final int length = size();
-                int i = 0;
-                double v;
-                do if (i >= length) {
-                    return new Floats(floatValues());
-                } while (!(Math.abs((v = doubleValue(i++)) - (float) v) > tolerance));    // Use '!' for accepting NaN.
-                /*
-                 * Same try than above loop, but now using base 10 representation.
-                 * This is a more costly computation.
-                 */
-                i = 0;
-                do if (i >= length) {
-                    return new Decimal(floatValues());
-                } while (!(Math.abs((v = doubleValue(i++)) - DecimalFunctions.floatToDouble((float) v)) > tolerance));
+     * Returns a vector with the same data than the given vector but encoded in a more compact way,
+     * or {@code null} if this method can not do better than the given {@code Vector} instance.
+     * This method shall be invoked only for vector of integer values (this is not verified).
+     */
+    static Vector compress(final Vector source, final long min, final long max) {
+        boolean isSigned = (min >= Byte.MIN_VALUE && max <= Byte.MAX_VALUE);
+        if (isSigned || (min >= 0 && max <= 0xFF)) {
+            if (source instanceof Bytes) return null;
+            final byte[] array = new byte[source.size()];
+            for (int i=0; i < array.length; i++) {
+                array[i] = (byte) source.intValue(i);
+            }
+            return isSigned ? new Bytes(array) : new UnsignedBytes(array);
+        }
+        isSigned = (min >= Short.MIN_VALUE && max <= Short.MAX_VALUE);
+        if (isSigned || (min >= 0 && max <= 0xFFFF)) {
+            if (source instanceof Shorts) return null;
+            final short[] array = new short[source.size()];
+            for (int i=0; i < array.length; i++) {
+                array[i] = (short) source.intValue(i);
+            }
+            return isSigned ? new Shorts(array) : new UnsignedShorts(array);
+        }
+        isSigned = (min >= Integer.MIN_VALUE && max <= Integer.MAX_VALUE);
+        if (isSigned || (min >= 0 && max <= 0xFFFFFFFF)) {
+            if (source instanceof Integers) return null;
+            final int[] array = new int[source.size()];
+            for (int i=0; i < array.length; i++) {
+                array[i] = (int) source.longValue(i);
             }
+            return isSigned ? new Integers(array) : new UnsignedIntegers(array);
         }
-        return vec;
+        if (!(source instanceof Longs) && !(source instanceof Floats) && !(source instanceof Doubles)) {
+            final long[] array = new long[source.size()];
+            for (int i=0; i < array.length; i++) {
+                array[i] = source.longValue(i);
+            }
+            return new Longs(array);
+        }
+        return null;
+    }
+
+    /**
+     * Returns a vector with the same data than the given vector but encoded in a more compact way,
+     * or {@code null} if this method can not do better than the given {@code Vector} instance.
+     * This method shall be invoked only for vector of floating point values (this is not verified).
+     */
+    static Vector compress(final Vector source, final double tolerance) {
+        if (!Float.class.equals(source.getElementType())) {
+            /*
+             * For floating point types, verify if values are equivalent to 'float' values.
+             * There is two different ways to pad extra fraction digits in 'double' values:
+             * with zero fraction digits in base 2 representation (the standard Java cast),
+             * or with zero fraction digits in base 10 representation.
+             */
+            final int length = source.size();
+            int i = 0;
+            double v;
+            do if (i >= length) {
+                return new Floats(source.floatValues());
+            } while (!(Math.abs((v = source.doubleValue(i++)) - (float) v) > tolerance));    // Use '!' for accepting NaN.
+            /*
+             * Same try than above loop, but now using base 10 representation.
+             * This is a more costly computation.
+             */
+            i = 0;
+            do if (i >= length) {
+                return new Decimal(source.floatValues());
+            } while (!(Math.abs((v = source.doubleValue(i++)) - DecimalFunctions.floatToDouble((float) v)) > tolerance));
+        }
+        return null;
     }
 
     /**
@@ -414,6 +399,11 @@ abstract class ArrayVector<E extends Num
             return Long.class;
         }
 
+        /** Values in this vector are guaranteed to be integers. */
+        @Override public final boolean isInteger() {
+            return true;
+        }
+
         /** Returns the string representation at the given index. */
         @Override public String stringValue(final int index) {
             return Long.toString(array[index]);
@@ -495,6 +485,11 @@ abstract class ArrayVector<E extends Num
             return Integer.class;
         }
 
+        /** Values in this vector are guaranteed to be integers. */
+        @Override public final boolean isInteger() {
+            return true;
+        }
+
         /** Returns the string representation at the given index. */
         @Override public String stringValue(final int index) {
             return Integer.toString(array[index]);
@@ -580,6 +575,11 @@ abstract class ArrayVector<E extends Num
             return Short.class;
         }
 
+        /** Values in this vector are guaranteed to be integers. */
+        @Override public final boolean isInteger() {
+            return true;
+        }
+
         /** Returns the string representation at the given index. */
         @Override public String stringValue(final int index) {
             return Short.toString(array[index]);
@@ -640,6 +640,11 @@ abstract class ArrayVector<E extends Num
             return Byte.class;
         }
 
+        /** Values in this vector are guaranteed to be integers. */
+        @Override public final boolean isInteger() {
+            return true;
+        }
+
         /** Returns the string representation at the given index. */
         @Override public String stringValue(final int index) {
             return Byte.toString(array[index]);

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Fraction.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -137,7 +137,7 @@ public final class Fraction extends Numb
                 num /= den;                     // Simplify  xy/x  as  y/1
                 den = 1;
             } else {
-                do {                            // Search for greater common divisor with Euclid's algorithm.
+                do {                            // Search for greatest common divisor with Euclid's algorithm.
                     a   = gcd;
                     gcd = remainder;
                     remainder = a % gcd;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/MathFunctions.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -559,8 +559,9 @@ public final class MathFunctions extends
      * Some of those bits, named the <cite>payload</cite>, can be used for storing custom information.
      * This method maps some of the payload values to each ordinal value.
      *
-     * <p>The relationship between payload values and ordinal values is implementation dependent and
-     * may change in any future version of the SIS library. The current implementation restricts the
+     * <p>This method guarantees that {@code toNanFloat(0)} returns the standard {@link Float#NaN} value.
+     * For all other {@code ordinal} values, the relationship to the payload values is implementation dependent
+     * and may change in any future version of the SIS library. The current implementation restricts the
      * range of allowed ordinal values to a smaller one than the range of all possible values.</p>
      *
      * @param  ordinal  the NaN ordinal value, from {@code -0x200000} to {@code 0x1FFFFF} inclusive.
@@ -580,6 +581,10 @@ public final class MathFunctions extends
      * Returns the ordinal value of the given NaN number.
      * This method is the converse of {@link #toNanFloat(int)}.
      *
+     * <p>If the given float is the standard {@link Float#NaN} value, then this method returns 0.
+     * For all other values, the relationship between the float payload and the returned ordinal
+     * is implementation dependent and may change in any future Apache SIS version.</p>
+     *
      * @param  value  the value from which to get the NaN ordinal value.
      * @return the NaN ordinal value of the given floating point value.
      * @throws IllegalArgumentException if the given value is not a NaN value,

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/PackedVector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/PackedVector.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/PackedVector.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/PackedVector.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -18,6 +18,9 @@ package org.apache.sis.math;
 
 import org.apache.sis.util.Numbers;
 import org.apache.sis.util.collection.IntegerList;
+import org.apache.sis.util.resources.Errors;
+
+// Branch-dependent imports
 import org.apache.sis.internal.jdk8.JDK8;
 
 
@@ -34,7 +37,13 @@ final class PackedVector extends ArrayVe
     /**
      * For cross-version compatibility.
      */
-    private static final long serialVersionUID = 2025113345434607526L;
+    private static final long serialVersionUID = 5097586732924434042L;
+
+    /**
+     * Minimal length for creating a packed vector.
+     * This is an arbitrary value that may change in any future version.
+     */
+    static final int MINIMAL_SIZE = 8;
 
     /**
      * The compressed list of integer values. This list can store values from 0 to {@code delta} inclusive.
@@ -42,6 +51,11 @@ final class PackedVector extends ArrayVe
     private final IntegerList data;
 
     /**
+     * The value by which to multiply the {@linkplain #data} before to add the {@linkplain #offset}.
+     */
+    private final long increment;
+
+    /**
      * The offset to add to the {@link #data} in order to get the values to return.
      */
     private final long offset;
@@ -49,20 +63,84 @@ final class PackedVector extends ArrayVe
     /**
      * Creates a new compressed vector initialized to a copy of the data provided by the given vector.
      *
-     * @param  source  the vector to copy.
-     * @param  offset  the minimal value in the source vector.
-     * @param  delta   the maximal value in the source vector minus {@code offset}.
-     */
-    PackedVector(final Vector source, final long offset, final int delta) {
-        this.offset = offset;
+     * @param  source     the vector to copy.
+     * @param  increment  the common divisor of all (sample minus offset) values.
+     * @param  offset     the minimal value in the source vector.
+     * @param  delta      the maximal value in the source vector minus {@code offset} divided by {@code increment}.
+     */
+    private PackedVector(final Vector source, final long increment, final long offset, final int delta) {
+        this.increment = increment;
+        this.offset    = offset;
         final int length = source.size();
         data = new IntegerList(length, delta, true);
         for (int i=0; i<length; i++) {
-            data.setInt(i, JDK8.toIntExact(source.longValue(i) - offset));
+            data.setInt(i, JDK8.toIntExact((source.longValue(i) - offset) / increment));
         }
     }
 
     /**
+     * Creates a new compressed vector initialized to a copy of the data provided by the given vector.
+     * All values in the given vector shall be assignable to the {@code long} type (this is not verified).
+     *
+     * @param  source  the vector to copy.
+     * @param  min     the minimal value in the given vector, inclusive.
+     * @param  max     the maximal value in the given vector, inclusive.
+     * @return the compressed vector, or {@code null} if the vector can not or should not be compressed.
+     */
+    static PackedVector compress(final Vector source, final long min, final long max) {
+        long delta = max - min;
+        if (delta > 0) {                                    // Negative if (max - min) overflow.
+            long inc = delta;
+            final int length = source.size();
+            if (length >= MINIMAL_SIZE) {
+                for (int i=0; i<length; i++) {
+                    long t = source.longValue(i) - min;
+                    if (t < 0) return null;                 // May happen if the given 'min' value is wrong.
+                    if ((t % inc) != 0) {
+                        do {
+                            final long r = (inc % t);       // Search for greatest common divisor with Euclid's algorithm.
+                            inc = t;
+                            t = r;
+                        } while (t != 0);
+                        if (inc == 1) {
+                            /*
+                             * If we reach this point, the increment is of no use for compressing data.
+                             * If in addition the minimal number of bits required for storing all values:
+                             *
+                             *     numBits = Long.SIZE - Long.numberOfLeadingZeros(delta);
+                             *
+                             * is equal to the number of bits of a primitive type (byte, short, int or long)
+                             * and all values are in the range of that primitive type, then there is nothing
+                             * to win compared to an array of that primitive type.
+                             */
+                            final long high = Long.highestOneBit(delta);
+                            if ((high & ((1L << (Byte   .SIZE - 1)) |
+                                         (1L << (Short  .SIZE - 1)) |
+                                         (1L << (Integer.SIZE - 1)) |
+                                         (1L << (Long   .SIZE - 1)))) != 0)
+                            {
+                                long limit = high - 1;                  // Maximal value of signed integers.
+                                if (min >= 0) {
+                                    limit |= high;                      // Maximal value of unsigned integers.
+                                    if (limit < 0) return null;         // Overflow the 'long' primitve type.
+                                }
+                                if (max <= limit && min >= ~limit) {    // Really tild (~), not minus (-).
+                                    return null;                        // All values in range of primitive type.
+                                }
+                            }
+                            break;                                      // No need to check other values.
+                        }
+                    }
+                }
+                delta /= inc;
+                if (delta > Integer.MAX_VALUE) return null;
+                return new PackedVector(source, inc, min, (int) delta);
+            }
+        }
+        return null;
+    }
+
+    /**
      * Type of elements fixed to {@code Long} even if the actual storage used by this class is more compact.
      * The reason for the {@code Long} type is that this class can return any value in the {@code Long} range,
      * because of the {@link #offset}.
@@ -101,7 +179,7 @@ final class PackedVector extends ArrayVe
      */
     @Override
     public long longValue(final int index) {
-        return data.getInt(index) + offset;
+        return data.getInt(index) * increment + offset;
     }
 
     /**
@@ -126,8 +204,19 @@ final class PackedVector extends ArrayVe
     @Override
     public Number set(final int index, final Number value) {
         verifyType(value.getClass(), Numbers.LONG);
-        final Number old = get(index);
-        data.setInt(index, JDK8.toIntExact(JDK8.subtractExact(value.longValue(), offset)));
-        return old;
+        long v = value.longValue();
+        if (v >= offset) {
+            v -= offset;
+            if ((v % increment) == 0) {
+                v /= increment;
+                if (v <= data.maximalValue()) {
+                    final Number old = get(index);
+                    data.setInt(index, (int) v);
+                    modCount++;
+                    return old;
+                }
+            }
+        }
+        throw new IllegalArgumentException(Errors.format(Errors.Keys.CanNotStoreInVector_1, value));
     }
 }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/SequenceVector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/SequenceVector.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/SequenceVector.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/SequenceVector.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -90,7 +90,7 @@ abstract class SequenceVector extends Ve
      */
     @Override
     public final Number set(final int index, final Number value) {
-        throw new UnsupportedOperationException(Errors.format(Errors.Keys.UnmodifiableObject_1, "Vector"));
+        throw new UnsupportedOperationException(Errors.format(Errors.Keys.CanNotStoreInVector_1, value));
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/math/Vector.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -448,7 +448,7 @@ public abstract class Vector extends Abs
      * @throws UnsupportedOperationException if this vector is read-only.
      * @throws IndexOutOfBoundsException if the given index is out of bounds.
      * @throws NumberFormatException if the previous value was stored as a {@code String} and can not be parsed.
-     * @throws ArithmeticException if this vector uses some {@linkplain #compress(double) compression} technic
+     * @throws IllegalArgumentException if this vector uses some {@linkplain #compress(double) compression} technic
      *         and the given value is out of range for that compression.
      */
     @Override
@@ -994,8 +994,8 @@ public abstract class Vector extends Abs
      *
      * <div class="section">When to use</div>
      * It is usually not worth to compress small arrays. Performance-critical arrays may not be compressed neither.
-     * This method is best suited for arrays that may potentially be large and for which the cost of reading that
-     * array is small compared to the calculation performed with the values.
+     * This method is best suited for vectors that may potentially be large and for which the cost of fetching
+     * values in that vector is small compared to the calculation performed with the values.
      *
      * @param  tolerance  maximal difference allowed between original and compressed vectors (can be zero).
      * @return a more compact vector with the same data than this vector, or {@code this}.
@@ -1012,11 +1012,38 @@ public abstract class Vector extends Abs
          * returns null if the array contains NaN. Note that for array of integers, 'isNaN(int)' is very
          * efficient and the loop will stop immediately after the first iteration.
          */
-        for (int i=0; i<length; i++) {
-            if (!isNaN(i)) return this;
+        int i = 0;
+        do if (i >= length) {
+            final Double NaN = Numerics.valueOf(Double.NaN);
+            return new SequenceVector.Doubles(getElementType(), NaN, NaN, length);
+        } while (isNaN(i++));
+        /*
+         * Try to copy the values in a more compact format.
+         * We will use a vector backed by IntegerList in order to use only the amount of bits needed,
+         * unless that amount is exactly the number of bits of a primitive type (8, 16, 32 or 64) in
+         * which case using one of the specialized classes in this ArrayVector is more performant.
+         */
+        final NumberRange<?> range = range();
+        if (range != null && !range.isEmpty()) {
+            final Number min = range.getMinValue();
+            final Number max = range.getMaxValue();
+            final boolean isInteger = (min.doubleValue() >= Long.MIN_VALUE &&
+                                       max.doubleValue() <= Long.MAX_VALUE &&
+                                       isInteger());                                // May scan the vector.
+            Vector vec;
+            if (isInteger) {
+                vec = PackedVector.compress(this, min.longValue(), max.longValue());
+                if (vec == null) {
+                    vec = ArrayVector.compress(this, min.longValue(), max.longValue());
+                }
+            } else {
+                vec = ArrayVector.compress(this, tolerance);
+            }
+            if (vec != null) {
+                return vec;
+            }
         }
-        final Double NaN = Numerics.valueOf(Double.NaN);
-        return new SequenceVector.Doubles(getElementType(), NaN, NaN, length);
+        return this;
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/measure/UnitFormat.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -421,13 +421,17 @@ public class UnitFormat extends Format i
         final Unit<?> unitForOldLabel = labelToUnit.remove(unitToLabel.put(unit, label));
         final Unit<?> oldUnitForLabel = labelToUnit.put(label, unit);
         if (oldUnitForLabel != null && !oldUnitForLabel.equals(unit) && !label.equals(unitToLabel.remove(oldUnitForLabel))) {
-            // Assuming there is no bug in our algorithm, this exception should never happen
-            // unless this UnitFormat has been modified concurrently in another thread.
+            /*
+             * Assuming there is no bug in our algorithm, this exception should never happen
+             * unless this UnitFormat has been modified concurrently in another thread.
+             */
             throw new CorruptedObjectException("unitToLabel");
         }
         if (unitForOldLabel != null && !unitForOldLabel.equals(unit)) {
-            // Assuming there is no bug in our algorithm, this exception should never happen
-            // unless this UnitFormat has been modified concurrently in another thread.
+            /*
+             * Assuming there is no bug in our algorithm, this exception should never happen
+             * unless this UnitFormat has been modified concurrently in another thread.
+             */
             throw new CorruptedObjectException("labelToUnit");
         }
     }

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/iso/Names.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -208,7 +208,7 @@ public final class Names extends Static
      *
      * @param  namespace  the namespace, or {@code null} for the global namespace.
      * @param  separator  the separator between the namespace and the local part, or {@code null}
-     *                    for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}..
+     *                    for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}.
      * @param  localPart  the name which is locale in the given namespace.
      * @return a type name in the given namespace.
      *
@@ -230,7 +230,7 @@ public final class Names extends Static
      *
      * @param  namespace  the namespace, or {@code null} for the global namespace.
      * @param  separator  the separator between the namespace and the local part, or {@code null}
-     *                    for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}..
+     *                    for the {@linkplain DefaultNameSpace#DEFAULT_SEPARATOR default separator}.
      * @param  localPart  the name which is locale in the given namespace.
      * @param  valueClass the type of values, used for inferring a {@link TypeName} instance.
      * @return a member name in the given namespace for values of the given type.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -151,6 +151,11 @@ public final class Errors extends Indexe
         public static final short CanNotSetPropertyValue_1 = 15;
 
         /**
+         * Can not store the {0} value in this vector.
+         */
+        public static final short CanNotStoreInVector_1 = 175;
+
+        /**
          * Can not transform envelope.
          */
         public static final short CanNotTransformEnvelope = 16;
@@ -551,6 +556,11 @@ public final class Errors extends Indexe
         public static final short MutuallyExclusiveOptions_2 = 91;
 
         /**
+         * Native interfaces “{1}” not available for the {0} platform.
+         */
+        public static final short NativeInterfacesNotFound_2 = 176;
+
+        /**
          * Argument ‘{0}’ shall not be negative. The given value was {1}.
          */
         public static final short NegativeArgument_2 = 92;

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors.properties [ISO-8859-1] Thu Jul 13 12:10:35 2017
@@ -41,6 +41,7 @@ CanNotReadPropertyInFile_2        = Can
 CanNotRepresentInFormat_2         = Can not represent \u201c{1}\u201d in a strictly standard-compliant {0} format.
 CanNotSetParameterValue_1         = Can not set a value for parameter \u201c{0}\u201d.
 CanNotSetPropertyValue_1          = Can not set a value for property \u201c{0}\u201d.
+CanNotStoreInVector_1             = Can not store the {0} value in this vector.
 CanNotTransformEnvelope           = Can not transform envelope.
 CanNotWriteFile_2                 = Can not write \u201c{1}\u201d as a file in the {0} format.
 CircularReference                 = Circular reference.
@@ -120,6 +121,7 @@ MissingValueForProperty_1         = Miss
 MissingValueInColumn_1            = Missing value in the \u201c{0}\u201d column.
 MultiOccurenceValueAtIndices_3    = Can not return a single value for \u201c{0}\u201d because there is at least two occurrences, at indices {1} and {2}.
 MutuallyExclusiveOptions_2        = Options \u201c{0}\u201d and \u201c{1}\u201d are mutually exclusive.
+NativeInterfacesNotFound_2        = Native interfaces \u201c{1}\u201d not available for the {0} platform.
 NegativeArgument_2                = Argument \u2018{0}\u2019 shall not be negative. The given value was {1}.
 NegativeArrayLength_1             = Can not create a \u201c{0}\u201d array of negative length.
 NestedElementNotAllowed_1         = Nested \u201c{0}\u201d elements are not allowed.

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/resources/Errors_fr.properties [ISO-8859-1] Thu Jul 13 12:10:35 2017
@@ -38,6 +38,7 @@ CanNotReadPropertyInFile_2        = Ne p
 CanNotRepresentInFormat_2         = Ne peut pas repr\u00e9senter \u00ab\u202f{1}\u202f\u00bb dans un format {0} strictement conforme.
 CanNotSetParameterValue_1         = Ne peut pas d\u00e9finir une valeur pour le param\u00e8tre \u00ab\u202f{0}\u202f\u00bb.
 CanNotSetPropertyValue_1          = Ne peut pas d\u00e9finir une valeur pour la propri\u00e9t\u00e9 \u00ab\u202f{0}\u202f\u00bb.
+CanNotStoreInVector_1             = Ne peut pas stocker la valeur {0} dans ce vecteur.
 CanNotTransformEnvelope           = Ne peut pas transformer l\u2019enveloppe.
 CanNotWriteFile_2                 = Ne peut pas \u00e9crire \u00ab\u202f{1}\u202f\u00bb comme un fichier au format {0}.
 CircularReference                 = R\u00e9f\u00e9rence circulaire.
@@ -117,6 +118,7 @@ MissingValueForProperty_1         = Aucu
 MissingValueInColumn_1            = Il manque une valeur dans la colonne \u00ab\u202f{0}\u202f\u00bb.
 MultiOccurenceValueAtIndices_3    = Ne peut pas retourner une valeur unique pour \u00ab\u202f{0}\u202f\u00bb parce qu\u2019il y a au moins deux occurrences, aux index {1} et {2}.
 MutuallyExclusiveOptions_2        = Les options \u00ab\u202f{0}\u202f\u00bb et \u00ab\u202f{1}\u202f\u00bb sont mutuellement exclusives.
+NativeInterfacesNotFound_2        = Les interfaces natives \u00ab\u202f{1}\u202f\u00bb ne sont pas disponibles pour la plateforme {0}.
 NegativeArgument_2                = L\u2019argument \u2018{0}\u2019 ne doit pas \u00eatre n\u00e9gatif. La valeur donn\u00e9e \u00e9tait {1}.
 NegativeArrayLength_1             = Ne peut pas cr\u00e9er un tableau \u00ab\u202f{0}\u202f\u00bb de longueur n\u00e9gative.
 NestedElementNotAllowed_1         = L\u2019imbrication d\u2019\u00e9l\u00e9ments \u00ab\u202f{0}\u202f\u00bb n\u2019est pas autoris\u00e9e.

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/MathFunctionsTest.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -36,7 +36,7 @@ import org.apache.sis.internal.jdk8.JDK8
  *
  * @author  Martin Desruisseaux (IRD, Geomatys)
  * @author  Johann Sorel (Geomatys)
- * @version 0.7
+ * @version 0.8
  * @since   0.3
  * @module
  */
@@ -246,6 +246,7 @@ public final strictfp class MathFunction
      * Tests the {@link MathFunctions#toNanFloat(int)} method. This will indirectly test the
      * converse {@link MathFunctions#toNanOrdinal(float)} method through Java assertions.
      */
+    @Test
     public void testToNanFloat() {
         final int standardNaN = Float.floatToRawIntBits(Float.NaN);
         for (int ordinal = 0; ordinal < MathFunctions.MAX_NAN_ORDINAL; ordinal += 256) {
@@ -260,6 +261,15 @@ public final strictfp class MathFunction
     }
 
     /**
+     * Tests a part of the {@link MathFunctions#toNanOrdinal(float)} method contract.
+     * More extensive tests is performed indirectly by the {@link #testToNanFloat()} method.
+     */
+    @Test
+    public void testToNanOrdinal() {
+        assertEquals(0, toNanOrdinal(Float.NaN));
+    }
+
+    /**
      * Tests the {@link MathFunctions#quadrupleToDouble(long, long)} method. Values used in this test are taken from
      * <a href="https://en.wikipedia.org/wiki/Quadruple-precision_floating-point_format">Quadruple-precision
      * floating-point format</a> on Wikipedia.

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/VectorTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/VectorTest.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/VectorTest.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/math/VectorTest.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -370,14 +370,16 @@ public final strictfp class VectorTest e
          */
         vec =  Vector.create(new double[] {30, 120, -50, -120}, false);
         assertNotSame(vec, compressed = vec.compress(0));
+        assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
         assertEquals("elementType", Byte.class, compressed.getElementType());
         assertFalse("isUnsigned()", compressed.isUnsigned());
         assertContentEquals(vec, compressed);
         /*
-         * Values that can be compressed as unsigned signed bytes.
+         * Values that can be compressed as unsigned bytes.
          */
         vec =  Vector.create(new float[] {30, 120, 250, 1}, false);
         assertNotSame(vec, compressed = vec.compress(0));
+        assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
         assertEquals("elementType", Byte.class, compressed.getElementType());
         assertTrue("isUnsigned()", compressed.isUnsigned());
         assertContentEquals(vec, compressed);
@@ -386,6 +388,7 @@ public final strictfp class VectorTest e
          */
         vec =  Vector.create(new long[] {32000, 120, -25000, 14}, false);
         assertNotSame(vec, compressed = vec.compress(0));
+        assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
         assertEquals("elementType", Short.class, compressed.getElementType());
         assertFalse("isUnsigned()", compressed.isUnsigned());
         assertContentEquals(vec, compressed);
@@ -394,14 +397,36 @@ public final strictfp class VectorTest e
          */
         vec =  Vector.create(new float[] {3, 60000, 25, 4}, false);
         assertNotSame(vec, compressed = vec.compress(0));
+        assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
         assertEquals("elementType", Short.class, compressed.getElementType());
         assertTrue("isUnsigned()", compressed.isUnsigned());
         assertContentEquals(vec, compressed);
         /*
          * Values that can be compressed in a PackedVector.
          * Values below require less bits than the 'byte' type.
+         * Note that we need at least PackedVector.MINIMAL_SIZE data for enabling this test.
          */
-        vec =  Vector.create(new double[] {30, 27, 93, 72, -8}, false);
+        vec =  Vector.create(new double[] {30, 27, 93, 72, -8, -3, 12, 4, 29, -5}, false);
+        assertTrue(vec.size() >= PackedVector.MINIMAL_SIZE);
+        assertNotSame(vec, compressed = vec.compress(0));
+        assertInstanceOf("vector.compress(0)", PackedVector.class, compressed);
+        assertContentEquals(vec, compressed);
+        /*
+         * Vector that could be compressed in a PackedVector, but without advantage
+         * because the number of bits required for storing the values is exactly 8.
+         */
+        vec =  Vector.create(new double[] {200, 100, 20, 80, 180, 10, 11, 12}, false);
+        assertTrue(vec.size() >= PackedVector.MINIMAL_SIZE);
+        assertNotSame(vec, compressed = vec.compress(0));
+        assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
+        assertEquals("elementType", Byte.class, compressed.getElementType());
+        assertTrue("isUnsigned()", compressed.isUnsigned());
+        assertContentEquals(vec, compressed);
+        /*
+         * Vector that can be compressed in a PackedVector as bytes with a factor of 20.
+         */
+        vec =  Vector.create(new double[] {200, 100, 20, 80, 180, 2000, 500, 120}, false);
+        assertTrue(vec.size() >= PackedVector.MINIMAL_SIZE);
         assertNotSame(vec, compressed = vec.compress(0));
         assertInstanceOf("vector.compress(0)", PackedVector.class, compressed);
         assertContentEquals(vec, compressed);
@@ -410,6 +435,7 @@ public final strictfp class VectorTest e
          */
         vec =  Vector.create(new double[] {3.10, 60.59, -25.32, 4.78}, false);
         assertNotSame(vec, compressed = vec.compress(0));
+        assertInstanceOf("vector.compress(0)", ArrayVector.class, compressed);
         assertEquals("elementType", Float.class, compressed.getElementType());
         assertFalse("isUnsigned()", compressed.isUnsigned());
         assertContentEquals(vec, compressed);

Modified: sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/SerializableRecordSchema.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/SerializableRecordSchema.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/SerializableRecordSchema.java [UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/test/java/org/apache/sis/util/iso/SerializableRecordSchema.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -48,7 +48,7 @@ final class SerializableRecordSchema ext
     /**
      * On serialization, returns a proxy which will be resolved as {@link #INSTANCE} on deserialization.
      */
-    Object writeReplace() throws ObjectStreamException {
+    protected Object writeReplace() throws ObjectStreamException {
         return new Proxy();
     }
 

Modified: sis/branches/JDK7/ide-project/NetBeans/build.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/build.xml?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/build.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/build.xml Thu Jul 13 12:10:35 2017
@@ -60,7 +60,7 @@
       </fileset>
       -->
 
-      <!-- Other resources (properties files, SQL scripts). -->
+      <!-- Other resources (properties files, SQL scripts, native libraries). -->
       <fileset dir="${project.root}/core/sis-utility/src/main/resources">
         <include name="**/*.properties"/>
       </fileset>
@@ -73,6 +73,11 @@
       <fileset dir="${project.root}/storage/sis-xmlstore/src/main/resources">
         <include name="**/*.properties"/>
       </fileset>
+      <fileset dir="${project.root}/storage/sis-gdal/src/main/resources">
+        <include name="**/*.txt"/>
+        <include name="**/*.dll"/>
+        <include name="**/*.so"/>
+      </fileset>
       <fileset dir="${project.root}/application/sis-console/src/main/resources">
         <include name="**/*.properties"/>
       </fileset>

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/build-impl.xml Thu Jul 13 12:10:35 2017
@@ -129,6 +129,7 @@ is divided into following sections:
                 <available file="${test.netcdf.dir}"/>
                 <available file="${test.shapefile.dir}"/>
                 <available file="${test.xmlstore.dir}"/>
+                <available file="${test.gdal.dir}"/>
                 <available file="${test.storage.dir}"/>
                 <available file="${test.feature.dir}"/>
                 <available file="${test.referencing.dir}"/>
@@ -148,6 +149,8 @@ is divided into following sections:
                 <available file="${src.netcdf.dir}"/>
                 <available file="${src.shapefile.dir}"/>
                 <available file="${src.xmlstore.dir}"/>
+                <available file="${src.gdal.dir}"/>
+                <available file="${src.c.gdal.dir}"/>
                 <available file="${src.storage.dir}"/>
                 <available file="${src.feature.dir}"/>
                 <available file="${src.referencing.dir}"/>
@@ -265,6 +268,8 @@ is divided into following sections:
         <fail unless="src.netcdf.dir">Must set src.netcdf.dir</fail>
         <fail unless="src.shapefile.dir">Must set src.shapefile.dir</fail>
         <fail unless="src.xmlstore.dir">Must set src.xmlstore.dir</fail>
+        <fail unless="src.gdal.dir">Must set src.gdal.dir</fail>
+        <fail unless="src.c.gdal.dir">Must set src.c.gdal.dir</fail>
         <fail unless="src.storage.dir">Must set src.storage.dir</fail>
         <fail unless="src.feature.dir">Must set src.feature.dir</fail>
         <fail unless="src.referencing.dir">Must set src.referencing.dir</fail>
@@ -279,6 +284,7 @@ is divided into following sections:
         <fail unless="test.netcdf.dir">Must set test.netcdf.dir</fail>
         <fail unless="test.shapefile.dir">Must set test.shapefile.dir</fail>
         <fail unless="test.xmlstore.dir">Must set test.xmlstore.dir</fail>
+        <fail unless="test.gdal.dir">Must set test.gdal.dir</fail>
         <fail unless="test.storage.dir">Must set test.storage.dir</fail>
         <fail unless="test.feature.dir">Must set test.feature.dir</fail>
         <fail unless="test.referencing.dir">Must set test.referencing.dir</fail>
@@ -306,7 +312,7 @@ is divided into following sections:
     </target>
     <target depends="-init-ap-cmdline-properties" if="ap.supported.internal" name="-init-macrodef-javac-with-processors">
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
+            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -347,7 +353,7 @@ is divided into following sections:
     </target>
     <target depends="-init-ap-cmdline-properties" name="-init-macrodef-javac-without-processors" unless="ap.supported.internal">
         <macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
+            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <attribute default="${javac.processorpath}" name="processorpath"/>
@@ -380,7 +386,7 @@ is divided into following sections:
     </target>
     <target depends="-init-macrodef-javac-with-processors,-init-macrodef-javac-without-processors" name="-init-macrodef-javac">
         <macrodef name="depend" uri="http://www.netbeans.org/ns/j2se-project/3">
-            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
+            <attribute default="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}" name="srcdir"/>
             <attribute default="${build.classes.dir}" name="destdir"/>
             <attribute default="${javac.classpath}" name="classpath"/>
             <sequential>
@@ -488,6 +494,9 @@ is divided into following sections:
                         <fileset dir="${test.xmlstore.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
                         </fileset>
+                        <fileset dir="${test.gdal.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
                         <fileset dir="${test.storage.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
                         </fileset>
@@ -559,6 +568,9 @@ is divided into following sections:
                     <fileset dir="${test.xmlstore.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
                         <filename name="@{testincludes}"/>
                     </fileset>
+                    <fileset dir="${test.gdal.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
+                        <filename name="@{testincludes}"/>
+                    </fileset>
                     <fileset dir="${test.storage.dir}" excludes="@{excludes},**/*.xml,${excludes}" includes="@{includes}">
                         <filename name="@{testincludes}"/>
                     </fileset>
@@ -710,6 +722,9 @@ is divided into following sections:
                         <fileset dir="${test.xmlstore.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
                         </fileset>
+                        <fileset dir="${test.gdal.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
+                            <filename name="@{testincludes}"/>
+                        </fileset>
                         <fileset dir="${test.storage.dir}" excludes="@{excludes},${excludes}" includes="@{includes}">
                             <filename name="@{testincludes}"/>
                         </fileset>
@@ -1103,7 +1118,7 @@ is divided into following sections:
                 <include name="*"/>
             </dirset>
         </pathconvert>
-        <j2seproject3:depend srcdir="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}:${build.generated.subdirs}"/>
+        <j2seproject3:depend srcdir="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}:${build.generated.subdirs}"/>
     </target>
     <target depends="init,deps-jar,-pre-pre-compile,-pre-compile, -copy-persistence-xml,-compile-depend" if="have.sources" name="-do-compile">
         <j2seproject3:javac gensrcdir="${build.generated.sources.dir}"/>
@@ -1116,6 +1131,8 @@ is divided into following sections:
             <fileset dir="${src.netcdf.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.shapefile.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.xmlstore.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${src.c.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.storage.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.feature.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${src.referencing.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -1143,7 +1160,7 @@ is divided into following sections:
     <target depends="init,deps-jar,-pre-pre-compile" name="-do-compile-single">
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
         <j2seproject3:force-recompile/>
-        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}"/>
+        <j2seproject3:javac excludes="" gensrcdir="${build.generated.sources.dir}" includes="${javac.includes}" sourcepath="${src.local-src.dir}:${src.webapp.dir}:${src.console.dir}:${src.earth-obs.dir}:${src.geotiff.dir}:${src.netcdf.dir}:${src.shapefile.dir}:${src.xmlstore.dir}:${src.gdal.dir}:${src.c.gdal.dir}:${src.storage.dir}:${src.feature.dir}:${src.referencing.dir}:${src.ref-by-id.dir}:${src.metadata.dir}:${src.utility.dir}:${src.fra-profile.dir}"/>
     </target>
     <target name="-post-compile-single">
         <!-- Empty placeholder for easier customization. -->
@@ -1433,6 +1450,12 @@ is divided into following sections:
             <fileset dir="${src.xmlstore.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
+            <fileset dir="${src.gdal.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
+            <fileset dir="${src.c.gdal.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
+                <filename name="**/*.java"/>
+            </fileset>
             <fileset dir="${src.storage.dir}" excludes="${bug5101868workaround},${excludes}" includes="${includes}">
                 <filename name="**/*.java"/>
             </fileset>
@@ -1485,6 +1508,12 @@ is divided into following sections:
             <fileset dir="${src.xmlstore.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
+            <fileset dir="${src.gdal.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
+            <fileset dir="${src.c.gdal.dir}" excludes="${excludes}" includes="${includes}">
+                <filename name="**/doc-files/**"/>
+            </fileset>
             <fileset dir="${src.storage.dir}" excludes="${excludes}" includes="${includes}">
                 <filename name="**/doc-files/**"/>
             </fileset>
@@ -1528,10 +1557,10 @@ is divided into following sections:
         <!-- You can override this target in the ../build.xml file. -->
     </target>
     <target if="do.depend.true" name="-compile-test-depend">
-        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
+        <j2seproject3:depend classpath="${javac.test.classpath}" destdir="${build.test.classes.dir}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.gdal.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
     </target>
     <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test,-compile-test-depend" if="have.tests" name="-do-compile-test">
-        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" processorpath="${javac.test.processorpath}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.gdal.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
         <copy todir="${build.test.classes.dir}">
             <fileset dir="${test.webapp.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.console.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -1540,6 +1569,7 @@ is divided into following sections:
             <fileset dir="${test.netcdf.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.shapefile.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.xmlstore.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${test.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.storage.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.feature.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.referencing.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -1561,7 +1591,7 @@ is divided into following sections:
     <target depends="init,deps-jar,compile,-pre-pre-compile-test,-pre-compile-test-single" if="have.tests" name="-do-compile-test-single">
         <fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
         <j2seproject3:force-recompile destdir="${build.test.classes.dir}"/>
-        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
+        <j2seproject3:javac apgeneratedsrcdir="${build.test.classes.dir}" classpath="${javac.test.classpath}" debug="true" destdir="${build.test.classes.dir}" excludes="" includes="${javac.includes}" processorpath="${javac.test.processorpath}" sourcepath="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.gdal.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}" srcdir="${test.webapp.dir}:${test.console.dir}:${test.earth-obs.dir}:${test.geotiff.dir}:${test.netcdf.dir}:${test.shapefile.dir}:${test.xmlstore.dir}:${test.gdal.dir}:${test.storage.dir}:${test.feature.dir}:${test.referencing.dir}:${test.ref-by-id.dir}:${test.metadata.dir}:${test.utility.dir}:${test.fra-profile.dir}"/>
         <copy todir="${build.test.classes.dir}">
             <fileset dir="${test.webapp.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.console.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
@@ -1570,6 +1600,7 @@ is divided into following sections:
             <fileset dir="${test.netcdf.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.shapefile.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.xmlstore.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
+            <fileset dir="${test.gdal.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.storage.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.feature.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>
             <fileset dir="${test.referencing.dir}" excludes="${build.classes.excludes},${excludes}" includes="${includes}"/>

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/genfiles.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/genfiles.properties?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/genfiles.properties [ISO-8859-1] Thu Jul 13 12:10:35 2017
@@ -3,6 +3,6 @@
 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=18a5b904
-nbproject/build-impl.xml.script.CRC32=4fad40a6
+nbproject/build-impl.xml.data.CRC32=2d60067c
+nbproject/build-impl.xml.script.CRC32=723c782e
 nbproject/build-impl.xml.stylesheet.CRC32=830a3534@1.80.1.48

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/project.properties [ISO-8859-1] Thu Jul 13 12:10:35 2017
@@ -61,6 +61,9 @@ src.shapefile.dir    = ${project.root}/s
 test.shapefile.dir   = ${project.root}/storage/sis-shapefile/src/test/java
 src.xmlstore.dir     = ${project.root}/storage/sis-xmlstore/src/main/java
 test.xmlstore.dir    = ${project.root}/storage/sis-xmlstore/src/test/java
+src.gdal.dir         = ${project.root}/storage/sis-gdal/src/main/java
+src.c.gdal.dir       = ${project.root}/storage/sis-gdal/src/main/c
+test.gdal.dir        = ${project.root}/storage/sis-gdal/src/test/java
 src.storage.dir      = ${project.root}/storage/sis-storage/src/main/java
 test.storage.dir     = ${project.root}/storage/sis-storage/src/test/java
 src.feature.dir      = ${project.root}/core/sis-feature/src/main/java

Modified: sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml (original)
+++ sis/branches/JDK7/ide-project/NetBeans/nbproject/project.xml Thu Jul 13 12:10:35 2017
@@ -31,6 +31,8 @@
                 <root id="src.netcdf.dir" name="NetCDF"/>
                 <root id="src.shapefile.dir" name="Shapefile"/>
                 <root id="src.xmlstore.dir" name="XMLStore"/>
+                <root id="src.gdal.dir" name="GDAL/Proj4"/>
+                <root id="src.c.gdal.dir" name="GDAL/Proj4 JNI"/>
                 <root id="src.storage.dir" name="Storage"/>
                 <root id="src.feature.dir" name="Feature"/>
                 <root id="src.referencing.dir" name="Referencing"/>
@@ -47,6 +49,7 @@
                 <root id="test.netcdf.dir" name="Test NetCDF"/>
                 <root id="test.shapefile.dir" name="Test Shapefile"/>
                 <root id="test.xmlstore.dir" name="Test XMLStore"/>
+                <root id="test.gdal.dir" name="Test GDAL/Proj4"/>
                 <root id="test.storage.dir" name="Test Storage"/>
                 <root id="test.feature.dir" name="Test Feature"/>
                 <root id="test.referencing.dir" name="Test Referencing"/>

Modified: sis/branches/JDK7/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/pom.xml?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/pom.xml (original)
+++ sis/branches/JDK7/pom.xml Thu Jul 13 12:10:35 2017
@@ -409,6 +409,7 @@ Apache SIS is a free software, Java lang
         <groupId>com.esri.geometry</groupId>
         <artifactId>esri-geometry-api</artifactId>
         <version>1.2.1</version>
+        <optional>true</optional>
       </dependency>
       <dependency>
         <groupId>gov.nist.math</groupId>

Modified: sis/branches/JDK7/storage/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/pom.xml?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/pom.xml (original)
+++ sis/branches/JDK7/storage/pom.xml Thu Jul 13 12:10:35 2017
@@ -164,6 +164,7 @@
     <module>sis-geotiff</module>
     <module>sis-xmlstore</module>
     <module>sis-earth-observation</module>
+    <module>sis-gdal</module>
   </modules>
 
 </project>

Modified: sis/branches/JDK7/storage/sis-gdal/pom.xml
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/pom.xml?rev=1801832&r1=1801816&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/pom.xml (original)
+++ sis/branches/JDK7/storage/sis-gdal/pom.xml Thu Jul 13 12:10:35 2017
@@ -28,7 +28,7 @@
   <parent>
     <groupId>org.apache.sis</groupId>
     <artifactId>storage</artifactId>
-    <version>0.8-jdk8-SNAPSHOT</version>
+    <version>0.8-jdk7-SNAPSHOT</version>
   </parent>
 
 

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java?rev=1801832&r1=1801816&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/EPSGFactory.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -80,7 +80,7 @@ final class EPSGFactory extends Abstract
      *        use the axis order declared by the EPSG database, or {@code false} for
      *        the Proj.4 axis order. The default value is {@code true}.
      */
-    private EPSGFactory(final boolean useEpsgAxisOrder) {
+    EPSGFactory(final boolean useEpsgAxisOrder) {
         this.useEpsgAxisOrder = useEpsgAxisOrder;
     }
 

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java?rev=1801832&r1=1801816&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/PJ.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -18,7 +18,6 @@ package org.apache.sis.storage.gdal;
 
 import java.util.Date;
 import java.util.Objects;
-import java.lang.annotation.Native;
 import javax.measure.Unit;
 import javax.measure.quantity.Angle;
 import javax.measure.quantity.Length;
@@ -54,7 +53,6 @@ final class PJ extends PJObject implemen
      * The maximal number of dimension accepted by the {@link #transform(PJ, int, double[], int, int)} method.
      * This upper limit is actually somewhat arbitrary. This limit exists mostly as a safety against potential misuse.
      */
-    @Native
     static final int DIMENSION_MAX = 100;
 
     /**

Modified: sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java?rev=1801832&r1=1801816&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/main/java/org/apache/sis/storage/gdal/Proj4.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -109,7 +109,7 @@ public final class Proj4 extends Static
         if (beginParam >= 0) {
             beginParam += AXIS_ORDER_PARAM.length();
             final int length = definition.length();
-            while (beginParam < length) { // Skip whitespaces.
+            while (beginParam < length) {                                   // Skip whitespaces.
                 final int c = definition.codePointAt(beginParam);
                 if (!Character.isWhitespace(c)) break;
                 beginParam += Character.charCount(c);

Modified: sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java?rev=1801832&r1=1801816&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-gdal/src/test/java/org/apache/sis/test/suite/GDALTestSuite.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -30,7 +30,8 @@ import org.junit.runners.Suite;
  * @module
  */
 @Suite.SuiteClasses({
-    org.apache.sis.storage.gdal.PJTest.class
+    org.apache.sis.storage.gdal.PJTest.class,
+    org.apache.sis.storage.gdal.EPSGFactoryTest.class
 })
 public final strictfp class GDALTestSuite extends TestSuite {
     /**

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -146,6 +146,11 @@ public final class Resources extends Ind
         public static final short RandomizedProcessApplied = 15;
 
         /**
+         * The “{0}” GeoTIFF file does not specify the values format.
+         */
+        public static final short UndefinedDataFormat_1 = 25;
+
+        /**
          * A single value was expected for the “{0}” key but {1} values have been found.
          */
         public static final short UnexpectedListOfValues_2 = 16;

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources.properties [ISO-8859-1] Thu Jul 13 12:10:35 2017
@@ -35,6 +35,7 @@ MissingGeoValue_1                 = No v
 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 value {3}{4}, but that value should be {1}{4} according parent definition ({0}).
 RandomizedProcessApplied          = A randomized process such as error diffusion has been applied to the image data.
+UndefinedDataFormat_1             = The \u201c{0}\u201d GeoTIFF file does not specify the values format.
 UnexpectedListOfValues_2          = A single value was expected for the \u201c{0}\u201d key but {1} values have been found.
 UnexpectedParameter_2             = The \u201c{1}\u201d parameter was not expected for the \u201c{0}\u201d projection method.
 UnexpectedTileCount_3             = Found {2} tiles or strips in the \u201c{0}\u201d file while {1} were expected.

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties [ISO-8859-1] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/internal/geotiff/Resources_fr.properties [ISO-8859-1] Thu Jul 13 12:10:35 2017
@@ -40,6 +40,7 @@ MissingGeoValue_1                 = Aucu
 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 en accord avec la d\u00e9finition du parent {0}.
 RandomizedProcessApplied          = Un processus randomis\u00e9 comme la diffusion d\u2019erreur a \u00e9t\u00e9 appliqu\u00e9.
+UndefinedDataFormat_1             = Le fichier GeoTIFF \u00ab\u202f{0}\u202f\u00bb ne sp\u00e9cifie pas le format de ses valeurs.
 UnexpectedListOfValues_2          = Une seule valeur \u00e9tait attendue pour la cl\u00e9 \u00ab\u202f{0}\u202f\u00bb, mais on en a trouv\u00e9es {1}.
 UnexpectedParameter_2             = Le param\u00e8tre \u00ab\u202f{1}\u202f\u00bb est inattendu pour la m\u00e9thode de projection \u00ab\u202f{0}\u202f\u00bb.
 UnexpectedTileCount_3             = {2} tuiles ont \u00e9t\u00e9 trouv\u00e9es dans le fichier \u00ab\u202f{0}\u202f\u00bb alors qu\u2019on en attendait {1}.

Modified: sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java?rev=1801832&r1=1801831&r2=1801832&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java [UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-geotiff/src/main/java/org/apache/sis/storage/geotiff/CRSBuilder.java [UTF-8] Thu Jul 13 12:10:35 2017
@@ -745,6 +745,8 @@ final class CRSBuilder {
      * <ul>
      *   <li>{@link #build(Vector, Vector, String)} must have been invoked before this method.</li>
      *   <li>{@link ImageFileDirectory} must have filled its part of metadata before to invoke this method.</li>
+     *   <li>{@link MetadataBuilder#newGridRepresentation(MetadataBuilder.GridType)} should have been invoked
+     *       with the appropriate {@code GEORECTIFIED} or {@code GEOREFERENCEABLE} type.</li>
      * </ul>
      *
      * After execution, this method emits a warning for unprocessed GeoTIFF tags.
@@ -753,7 +755,6 @@ final class CRSBuilder {
      * @throws NumberFormatException if a numeric value was stored as a string and can not be parsed.
      */
     final void complete(final MetadataBuilder metadata) {
-        metadata.newGridRepresentation(MetadataBuilder.GridType.GEORECTIFIED);
         /*
          * ASCII reference to published documentation on the overall configuration of the GeoTIFF file.
          * Often the projected CRS name, despite GeoKeys.PCSCitation being already for that purpose.
@@ -921,13 +922,13 @@ final class CRSBuilder {
     private PrimeMeridian createPrimeMeridian(final String[] names, final Unit<Angle> unit) throws FactoryException {
         final int epsg = getAsInteger(GeoKeys.PrimeMeridian);
         switch (epsg) {
-            case GeoCodes.undefined: {
-                break;                      // If not specified, default to Greenwich.
-            }
+            case GeoCodes.undefined:      // If not specified, should default to Greenwich but we nevertheless verify.
             case GeoCodes.userDefined: {
                 final double longitude = getAsDouble(GeoKeys.PrimeMeridianLong);
                 if (Double.isNaN(longitude)) {
-                    missingValue(GeoKeys.PrimeMeridianLong);
+                    if (epsg != GeoCodes.undefined) {
+                        missingValue(GeoKeys.PrimeMeridianLong);
+                    }
                 } else if (longitude != 0) {
                     /*
                      * If the prime meridian is not Greenwich, create that meridian but do not use the



Mime
View raw message