sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 08/15: Port bug fixes from 1.0 development branch.
Date Thu, 21 Jun 2018 09:19:48 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to tag 0.8
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 6ec888f6f12b0c65e9d52335e620626cce633bb6
Author: Martin Desruisseaux <desruisseaux@apache.org>
AuthorDate: Sun Nov 5 18:08:33 2017 +0000

    Port bug fixes from 1.0 development branch.
    
    
    git-svn-id: https://svn.apache.org/repos/asf/sis/branches/0.8@1814370 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sis/internal/book/Assembler.java    |   3 +++
 .../org/apache/sis/internal/book/package-info.java |  17 ++++++++++++-
 .../provider/ZonedTransverseMercator.java          |  11 ++++++++
 .../sis/test/integration/ConsistencyTest.java      |  28 ++++++++++++++++-----
 .../main/resources/native/linux/libproj-binding.so | Bin
 5 files changed, 52 insertions(+), 7 deletions(-)

diff --git a/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
b/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
index f2bc1b1..dd03b4a 100644
--- a/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
+++ b/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/Assembler.java
@@ -63,6 +63,8 @@ import static org.apache.sis.internal.book.CodeColorizer.toArray;
  *   <li>Generate below {@code <h1>} elements the navigation bar with links to
the previous and next chapters.</li>
  * </ul>
  *
+ * See package javadoc for usage example.
+ *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.8
  * @since   0.7
@@ -595,6 +597,7 @@ public final class Assembler {
      * Generates the {@code "content/book/en|fr/developer-guide.html"} file from {@code "book/en|fr/index.html"}.
      * The only argument expected by this method is the language: {@code "en"} or {@code
"fr"}.
      * The current directory shall be the parent directory of {@code "book"} and {@code "content"}.
+     * See package javadoc for usage example.
      *
      * @param  args  command-line arguments. Should contain exactly on value, which is the
language.
      * @throws Exception if an I/O error, a XML parsing error or other kinds of error occurred.
diff --git a/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/package-info.java
b/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/package-info.java
index c9986fc..b85a168 100644
--- a/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/package-info.java
+++ b/core/sis-build-helper/src/main/java/org/apache/sis/internal/book/package-info.java
@@ -21,7 +21,22 @@
  * {@code http://svn.apache.org/repos/asf/sis/site/trunk/content/book/} directory.
  *
  * <p>The main class in this package is {@link org.apache.sis.internal.book.Assembler}.
- * Other classes are helper classes that should be ignored.</p>
+ * Other classes are helper classes that should be ignored. Assuming the following directory
layout:</p>
+ *
+ * <pre>&lt;current directory&gt;
+ * ├─ trunk
+ * └─ site
+ *     ├─ book
+ *     └─ content
+ * </pre>
+ *
+ * Then the command can be used as below:
+ *
+ * <pre>cd site
+ * java -classpath ../trunk/core/sis-build-helper/target/classes org.apache.sis.internal.book.Assembler
en
+ * </pre>
+ *
+ * Replace {@code en} by {@code fr} for generating the French version.
  *
  * @author  Martin Desruisseaux (Geomatys)
  * @version 0.8
diff --git a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ZonedTransverseMercator.java
b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ZonedTransverseMercator.java
index c7d8460..1df8763 100644
--- a/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ZonedTransverseMercator.java
+++ b/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ZonedTransverseMercator.java
@@ -100,6 +100,17 @@ public final class ZonedTransverseMercator extends AbstractProvider {
     }
 
     /**
+     * Notifies {@code DefaultMathTransformFactory} that this projection requires
+     * values for the {@code "semi_major"} and {@code "semi_minor"} parameters.
+     *
+     * @return 1, meaning that the operation requires a source ellipsoid.
+     */
+    @Override
+    public final int getEllipsoidsMask() {
+        return 1;
+    }
+
+    /**
      * Creates a map projection from the specified group of parameter values.
      *
      * @param  factory     the factory to use for creating and concatenating the (de)normalization
transforms.
diff --git a/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ConsistencyTest.java
b/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ConsistencyTest.java
index d59eb45..ac33282 100644
--- a/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ConsistencyTest.java
+++ b/core/sis-referencing/src/test/java/org/apache/sis/test/integration/ConsistencyTest.java
@@ -25,6 +25,7 @@ import org.opengis.util.FactoryException;
 import org.opengis.util.NoSuchIdentifierException;
 import org.opengis.referencing.crs.CoordinateReferenceSystem;
 import org.apache.sis.referencing.factory.FactoryDataException;
+import org.apache.sis.referencing.factory.UnavailableFactoryException;
 import org.apache.sis.referencing.IdentifiedObjects;
 import org.apache.sis.referencing.CRS;
 import org.apache.sis.io.wkt.Convention;
@@ -67,11 +68,22 @@ public final strictfp class ConsistencyTest extends TestCase {
      * Codes to exclude for now.
      */
     private static final Set<String> EXCLUDES = new HashSet<>(Arrays.asList(
-        "CRS:1",            // Computer display
-        "EPSG:5819"         // EPSG topocentric example A
+        "CRS:1",            // Computer display: WKT parser alters the (i,j) axis names.
+        "EPSG:5819",        // EPSG topocentric example A: error while parsing WKT.
+        "AUTO2:42001",      // This projection requires parameters, but we provide none.
+        "AUTO2:42002",      // This projection requires parameters, but we provide none.
+        "AUTO2:42003",      // This projection requires parameters, but we provide none.
+        "AUTO2:42004",      // This projection requires parameters, but we provide none.
+        "AUTO2:42005"       // This projection requires parameters, but we provide none.
     ));
 
     /**
+     * Width of the code columns in the warnings formatted by {@link #print(String, String,
Object)}.
+     * We begin with an arbitrary width and will expand if necessary.
+     */
+    private int codeWidth = 15;
+
+    /**
      * Verifies the WKT consistency of all CRS instances.
      *
      * @throws FactoryException if an error other than "unsupported operation method" occurred.
@@ -92,7 +104,7 @@ public final strictfp class ConsistencyTest extends TestCase {
                 final CoordinateReferenceSystem crs;
                 try {
                     crs = CRS.forCode(code);
-                } catch (NoSuchIdentifierException | FactoryDataException e) {
+                } catch (UnavailableFactoryException | NoSuchIdentifierException | FactoryDataException
e) {
                     print(code, "WARNING", e.getLocalizedMessage());
                     continue;
                 }
@@ -118,9 +130,13 @@ public final strictfp class ConsistencyTest extends TestCase {
      * Prints the given code followed by spaces and the given {@code "ERROR"} or {@code "WARNING"}
word,
      * then the given message.
      */
-    private static void print(final String code, final String word, final Object message)
{
+    private void print(final String code, final String word, final Object message) {
+        final int currentWidth = code.length();
+        if (currentWidth >= codeWidth) {
+            codeWidth = currentWidth + 1;
+        }
         out.print(code);
-        out.print(CharSequences.spaces(15 - code.length()));
+        out.print(CharSequences.spaces(codeWidth - currentWidth));
         out.print(word);
         out.print(": ");
         out.println(message);
@@ -135,7 +151,7 @@ public final strictfp class ConsistencyTest extends TestCase {
      * @param  crs   the CRS to test.
      * @return the parsed CRS.
      */
-    private static CoordinateReferenceSystem parseAndFormat(final WKTFormat f,
+    private CoordinateReferenceSystem parseAndFormat(final WKTFormat f,
             final String code, final CoordinateReferenceSystem crs)
     {
         String wkt = f.format(crs);
diff --git a/storage/sis-gdal/src/main/resources/native/linux/libproj-binding.so b/storage/sis-gdal/src/main/resources/native/linux/libproj-binding.so
old mode 100644
new mode 100755


Mime
View raw message