sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1563914 - in /sis/branches/JDK7/core/sis-referencing/src: main/java/org/apache/sis/io/wkt/ main/java/org/apache/sis/referencing/datum/ test/java/org/apache/sis/io/wkt/ test/java/org/apache/sis/referencing/
Date Mon, 03 Feb 2014 14:30:37 GMT
Author: desruisseaux
Date: Mon Feb  3 14:30:36 2014
New Revision: 1563914

URL: http://svn.apache.org/r1563914
Log:
Initial support of WKT2 UNIT[...] elements.

Modified:
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
    sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/ConventionTest.java
    sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/Assert.java

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1563914&r1=1563913&r2=1563914&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Convention.java
[UTF-8] Mon Feb  3 14:30:36 2014
@@ -16,16 +16,11 @@
  */
 package org.apache.sis.io.wkt;
 
-import javax.measure.unit.Unit;
-import javax.measure.quantity.Angle;
-import javax.measure.quantity.Quantity;
 import org.opengis.metadata.citation.Citation;
 import org.opengis.referencing.crs.GeocentricCRS;
 import org.apache.sis.util.Debug;
 import org.apache.sis.metadata.iso.citation.Citations;
 
-import static javax.measure.unit.NonSI.DEGREE_ANGLE;
-
 
 /**
  * The convention to use for WKT formatting.
@@ -66,7 +61,25 @@ public enum Convention {
      * this convention SIS will favor {@linkplain Citations#EPSG EPSG} definitions of projection
      * and parameter names.</p>
      */
-    WKT2(Citations.EPSG, false, false),
+    WKT2(false),
+
+    /**
+     * The ISO 19162 format with omission of some optional elements. This convention is identical
+     * to the {@link #WKT2} convention except for the following aspects:
+     *
+     * <ul>
+     *   <li>{@code ANGLEUNIT}, {@code LENGTHUNIT}, {@code SCALEUNIT}, {@code PARAMETRICUNIT}
and
+     *       {@code TIMEUNIT} are formatted as plain {@code UNIT} elements.</li>
+     *   <li>In {@code AXIS} elements, the {@code ORDER} elements are omitted.</li>
+     * </ul>
+     *
+     * Those simplifications are allowed by the ISO 19162 standard and do not cause any information
lost.
+     * The omitted elements are not needed by Apache SIS WKT parser and often distractive
for the human reader.
+     *
+     * <p>By default this simplified format is used by {@link FormattableObject#toString()},
while the stricter
+     * {@link #WKT2} convention is used by {@link FormattableObject#toWKT()}.</p>
+     */
+    WKT2_SIMPLIFIED(false),
 
     /**
      * The OGC 01-009 format, also known as “WKT 1”.
@@ -91,7 +104,7 @@ public enum Convention {
      *   <tr><td>Geocentric Z</td> <td>Northing</td>   <td>Toward
north pole</td></tr>
      * </table>
      */
-    WKT1(Citations.OGC, true, false),
+    WKT1(true),
 
     /**
      * The <cite>Simple Feature</cite> format, also known as “WKT 1”.
@@ -108,7 +121,7 @@ public enum Convention {
      *       (e.g. "<cite>meter</cite>" instead than "<cite>metre</cite>").</li>
      * </ul>
      */
-    WKT1_COMMON_UNITS(Citations.OGC, true, true),
+    WKT1_COMMON_UNITS(true),
 
     /**
      * A special convention for formatting objects as stored internally by Apache SIS.
@@ -119,14 +132,14 @@ public enum Convention {
      * <p>This convention is used only for debugging purpose.</p>
      */
     @Debug
-    INTERNAL(Citations.OGC, false, false);
+    INTERNAL(false);
 
     /**
      * The default conventions.
      *
      * @todo Make final after we completed the migration from Geotk.
      */
-    static Convention DEFAULT = WKT2;
+    static Convention DEFAULT = WKT2, DEFAULT_SIMPLIFIED = WKT2_SIMPLIFIED;
 
     /**
      * {@code true} for using WKT 1 syntax, or {@code false} for using WKT 2 syntax.
@@ -134,33 +147,10 @@ public enum Convention {
     private final boolean isWKT1;
 
     /**
-     * {@code true} for a frequently-used convention about units instead than the standard
one.
-     * <ul>
-     *   <li>If {@code true}, forces {@code PRIMEM} and {@code PARAMETER} angular units
to degrees
-     *       instead than inferring the unit from the context. The standard value is {@code
false},
-     *       which means that the angular units are inferred from the context as required
by the
-     *       WKT 1 specification.</li>
-     *   <li>If {@code true}, uses US unit names instead of the international names.
-     *       For example Americans said {@code "meter"} instead of {@code "metre"}.</li>
-     * </ul>
-     *
-     * @see #getForcedUnit(Class)
-     */
-    final boolean commonUnits;
-
-    /**
-     * The organization, standard or project to look for when fetching Map Projection parameter
names.
-     * Should be one of the authorities known to {@link org.apache.sis.referencing.operation.provider}.
-     */
-    private final Citation authority;
-
-    /**
      * Creates a new enumeration value.
      */
-    private Convention(final Citation authority, final boolean isWKT1, final boolean commonUnits)
{
-        this.authority   = authority;
-        this.isWKT1      = isWKT1;
-        this.commonUnits = commonUnits;
+    private Convention(final boolean isWKT1) {
+        this.isWKT1 = isWKT1;
     }
 
     /**
@@ -173,6 +163,28 @@ public enum Convention {
     }
 
     /**
+     * {@code true} for a simplified WKT. The simplifications are documented in the {@link
#WKT2_SIMPLIFIED} javadoc.
+     */
+    final boolean isSimple() {
+        return this != WKT2;
+    }
+
+    /**
+     * {@code true} for a frequently-used convention about units instead than the standard
one.
+     * <ul>
+     *   <li>If {@code true}, forces {@code PRIMEM} and {@code PARAMETER} angular units
to degrees
+     *       instead than inferring the unit from the context. The standard value is {@code
false},
+     *       which means that the angular units are inferred from the context as required
by the
+     *       WKT 1 specification.</li>
+     *   <li>If {@code true}, uses US unit names instead of the international names.
+     *       For example Americans said {@code "meter"} instead of {@code "metre"}.</li>
+     * </ul>
+     */
+    final boolean usesCommonUnits() {
+        return this == WKT1_COMMON_UNITS;
+    }
+
+    /**
      * Returns the default authority to look for when fetching Map Projection parameter names.
      * The value returned by this method can be overwritten by {@link WKTFormat#setNameAuthority(Citation)}.
      *
@@ -192,27 +204,6 @@ public enum Convention {
      * @see Citations#OGC
      */
     public Citation getNameAuthority() {
-        return authority;
-    }
-
-    /**
-     * If non-null, {@code PRIMEM} and {@code PARAMETER} values shall unconditionally use
the returned units.
-     * The standard value is {@code null}, which means that units are inferred from the context
as required by the
-     * <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/doc-files/WKT.html#PRIMEM">WKT
specification</a>.
-     * However some conventions ignore the above WKT specification and use hard-coded units
instead.
-     *
-     * @param  <T>       The compile-time type specified by the {@code quantity} argument.
-     * @param  quantity  The kind of quantity for which to get the unit.
-     *                   The most typical value for this argument is <code>{@linkplain
Angle}.class</code>.
-     * @return The unit to use for the given kind of quantity, or {@code null} for inferring
the unit in the standard way.
-     */
-    @SuppressWarnings("unchecked")
-    public <T extends Quantity> Unit<T> getForcedUnit(final Class<T> quantity)
{
-        if (commonUnits) {
-            if (quantity == Angle.class) {
-                return (Unit<T>) DEGREE_ANGLE;
-            }
-        }
-        return null;
+        return isWKT1 ? Citations.OGC : Citations.EPSG;
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/FormattableObject.java?rev=1563914&r1=1563913&r2=1563914&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/FormattableObject.java
[UTF-8] Mon Feb  3 14:30:36 2014
@@ -83,6 +83,8 @@ public class FormattableObject {
      * symbols and indentation. If this object can not be represented in a standard way,
then this
      * method throws an {@link UnformattableObjectException}.
      *
+     * <p>By default this method formats this object according the {@link Convention#WKT2}
rules.</p>
+     *
      * @return The default Well Know Text representation of this object.
      * @throws UnformattableObjectException If this object can not be formatted as a standard
WKT.
      *
@@ -97,11 +99,13 @@ public class FormattableObject {
      * If this object can not be represented in a standard way, then this method fallbacks
on a non-standard
      * representation.
      *
+     * <p>By default this method formats this object according the {@link Convention#WKT2_SIMPLIFIED}
rules.</p>
+     *
      * @return The Well Known Text (WKT) or an alternative representation of this object.
      */
     @Override
     public String toString() {
-        return formatWKT(Convention.DEFAULT, WKTFormat.DEFAULT_INDENTATION, false, false);
+        return formatWKT(Convention.DEFAULT_SIMPLIFIED, WKTFormat.DEFAULT_INDENTATION, false,
false);
     }
 
     /**
@@ -130,7 +134,7 @@ public class FormattableObject {
     public void print() {
         final Console console = System.console();
         final PrintWriter out = (console != null) ? console.writer() : null;
-        final String wkt = formatWKT(Convention.DEFAULT, WKTFormat.DEFAULT_INDENTATION,
+        final String wkt = formatWKT(Convention.DEFAULT_SIMPLIFIED, WKTFormat.DEFAULT_INDENTATION,
                 (out != null) && X364.isAnsiSupported(), false);
         if (out != null) {
             out.println(wkt);

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1563914&r1=1563913&r2=1563914&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/io/wkt/Formatter.java
[UTF-8] Mon Feb  3 14:30:36 2014
@@ -638,7 +638,7 @@ public class Formatter {
     }
 
     /**
-     * Appends the given math transform.
+     * Appends the given math transform, typically (but not necessarily) in a {@code PARAM_MT[…]}
element.
      *
      * @param transform The transform object to append to the WKT, or {@code null} if none.
      */
@@ -705,7 +705,7 @@ public class Formatter {
     }
 
     /**
-     * Appends a {@linkplain ParameterValue parameter} in WKT form.
+     * Appends a {@linkplain ParameterValue parameter} in a {@code PARAMETER[…]} element.
      * If the supplied parameter is actually a {@linkplain ParameterValueGroup parameter
group},
      * all contained parameters will flattened in a single list.
      *
@@ -722,16 +722,11 @@ public class Formatter {
             final ParameterDescriptor<?> descriptor = param.getDescriptor();
             Unit<?> unit = descriptor.getUnit();
             if (unit != null && !Unit.ONE.equals(unit)) {
-                Unit<?> contextUnit = linearUnit;
-                if (contextUnit!=null && unit.isCompatible(contextUnit)) {
-                    unit = contextUnit;
+                if (linearUnit != null && unit.isCompatible(linearUnit)) {
+                    unit = linearUnit;
                 } else {
-                    contextUnit = convention.getForcedUnit(Angle.class);
-                    if (contextUnit == null) {
-                        contextUnit = angularUnit;
-                    }
-                    if (contextUnit!=null && unit.isCompatible(contextUnit)) {
-                        unit = contextUnit;
+                    if (angularUnit != null && unit.isCompatible(angularUnit)) {
+                        unit = angularUnit;
                     }
                 }
             }
@@ -951,8 +946,11 @@ public class Formatter {
     }
 
     /**
-     * Appends a unit in WKT form.
-     * For example {@code append(SI.KILOMETRE)} will append "{@code UNIT["km", 1000]}" to
the WKT.
+     * Appends a unit in a {@code UNIT[…]} element or one of the specialized elements.
Specialized elements are
+     * {@code ANGLEUNIT}, {@code LENGTHUNIT}, {@code SCALEUNIT}, {@code PARAMETRICUNIT} and
{@code TIMEUNIT}.
+     * Specialization is used in WKT 2 format except the <cite>simplified WKT 2</cite>
one.
+     *
+     * {@example <code>append(SI.KILOMETRE)</code> will append "<code>LENGTHUNIT["km",
1000]</code>" to the WKT.}
      *
      * @param unit The unit to append to the WKT, or {@code null} if none.
      */
@@ -960,13 +958,25 @@ public class Formatter {
         if (unit != null) {
             final StringBuffer buffer = this.buffer;
             appendSeparator(requestNewLine);
-            buffer.append("UNIT").appendCodePoint(symbols.getOpeningBracket(0));
+            String keyword = "UNIT";
+            if (!convention.isSimple()) {
+                if (Units.isLinear(unit)) {
+                    keyword = "LENGTHUNIT";
+                } else if (Units.isAngular(unit)) {
+                    keyword = "ANGLEUNIT";
+                } else if (Units.isScale(unit)) {
+                    keyword = "SCALEUNIT";
+                } else if (Units.isTemporal(unit)) {
+                    keyword = "TIMEUNIT";
+                }
+            }
+            buffer.append(keyword).appendCodePoint(symbols.getOpeningBracket(0));
             setColor(ElementKind.UNIT);
             final int fromIndex = buffer.appendCodePoint(symbols.getOpeningQuote(0)).length();
             if (NonSI.DEGREE_ANGLE.equals(unit)) {
                 buffer.append("degree");
             } else if (SI.METRE.equals(unit)) {
-                buffer.append(convention.commonUnits ? "meter" : "metre");
+                buffer.append(convention.usesCommonUnits() ? "meter" : "metre");
             } else {
                 unitFormat.format(unit, buffer, dummy);
             }
@@ -978,41 +988,63 @@ public class Formatter {
     }
 
     /**
-     * Returns the linear unit for expressing lengths, or {@code null} for the "natural"
unit of each WKT element.
+     * Returns the linear unit for expressing lengths, or {@code null} for the default unit
of each WKT element.
+     * If {@code null}, then the default value depends on the object to format.
+     *
+     * <p>This method may return a non-null value if the next WKT elements to format
are enclosed in a larger WKT
+     * element, and the child elements shall inherit the linear unit of the enclosing element.
The most typical
+     * cases are the {@code PARAMETER[…]} elements enclosed in a {@code PROJCS[…]} element.</p>
      *
-     * @return The unit for linear measurements. Default value is {@code null}.
+     * <p>The value returned by this method can be ignored if the WKT element to format
contains an explicit
+     * {@code UNIT[…]} element.</p>
+     *
+     * @return The unit for linear measurements, or {@code null} for the default unit.
      */
     public Unit<Length> getLinearUnit() {
         return linearUnit;
     }
 
     /**
-     * Sets the unit to use for expressing lengths.
+     * Sets the unit to use for the next lengths to format. If non-null, the given unit will
apply to all WKT elements
+     * that do not define their own {@code UNIT[…]}, until this {@code setLinearUnit(…)}
method is invoked again.
      *
-     * @param unit The new unit, or {@code null}.
+     * @param unit The new unit, or {@code null} for letting element uses their own default.
      */
     public void setLinearUnit(final Unit<Length> unit) {
         linearUnit = unit;
     }
 
     /**
-     * Returns the angular unit for expressing angles, or {@code null} for the "natural"
unit of each WKT element.
-     * This value is set for example when formatting the {@code GEOGCS} element, in which
case the enclosed
-     * {@code PRIMEM} element shall use the unit of the enclosing {@code GEOGCS}.
+     * Returns the angular unit for expressing angles, or {@code null} for the default unit
of each WKT element.
+     * If {@code null}, then the default value depends on the object to format.
+     *
+     * <p>This method may return a non-null value if the next WKT elements to format
are enclosed in a larger WKT
+     * element, and the child elements shall inherit the linear unit of the enclosing element.
A typical case is
+     * the {@code PRIMEM[…]} element enclosed in a {@code GEOGCS[…]} element.</p>
+     *
+     * <p>The value returned by this method can be ignored if the WKT element to format
contains an explicit
+     * {@code UNIT[…]} element.</p>
      *
-     * @return The unit for angle measurement. Default value is {@code null}.
+     * @return The unit for angular measurement, or {@code null} for the default unit.
      */
     public Unit<Angle> getAngularUnit() {
         return angularUnit;
     }
 
     /**
-     * Sets the angular unit for formatting measures.
+     * Sets the unit to use for the next angles to format. If non-null, the given unit will
apply to all WKT elements
+     * that do not define their own {@code UNIT[…]}, until this {@code setAngularUnit(…)}
method is invoked again.
      *
-     * @param unit The new unit, or {@code null}.
+     * {@section Special case}
+     * If the WKT conventions are {@code WKT1_COMMON_UNITS}, then this method ignores the
given unit.
+     * See {@link Convention#WKT1_COMMON_UNITS} javadoc for more information.
+     *
+     * @param unit The new unit, or {@code null} for letting element uses their own default.
      */
     public void setAngularUnit(final Unit<Angle> unit) {
-        angularUnit = unit;
+        if (!convention.usesCommonUnits()) {
+            angularUnit = unit;
+        }
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java?rev=1563914&r1=1563913&r2=1563914&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/main/java/org/apache/sis/referencing/datum/DefaultPrimeMeridian.java
[UTF-8] Mon Feb  3 14:30:36 2014
@@ -338,19 +338,11 @@ public class DefaultPrimeMeridian extend
      */
     @Override
     protected String formatTo(final Formatter formatter) {
-        /*
-         * If the PrimeMeridian is written inside a "GEOGCS", then OGC say that it must be
-         * written in the unit of the enclosing geographic coordinate system. Otherwise,
-         * default to decimal degrees. Note that ESRI and GDAL don't follow this rule.
-         */
-        Unit<Angle> context = formatter.getConvention().getForcedUnit(Angle.class);
-        if (context == null) {
-            context = formatter.getAngularUnit();
-            if (context == null) {
-                context = NonSI.DEGREE_ANGLE;
-            }
+        Unit<Angle> unit = formatter.getAngularUnit();
+        if (unit == null) {
+            unit = NonSI.DEGREE_ANGLE;
         }
-        formatter.append(getGreenwichLongitude(context));
+        formatter.append(getGreenwichLongitude(unit));
         return "PRIMEM";
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/ConventionTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/ConventionTest.java?rev=1563914&r1=1563913&r2=1563914&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/ConventionTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/io/wkt/ConventionTest.java
[UTF-8] Mon Feb  3 14:30:36 2014
@@ -16,9 +16,7 @@
  */
 package org.apache.sis.io.wkt;
 
-import javax.measure.unit.NonSI;
-import javax.measure.quantity.Angle;
-import javax.measure.quantity.Duration;
+import org.apache.sis.metadata.iso.citation.Citations;
 import org.apache.sis.test.TestCase;
 import org.junit.Test;
 
@@ -35,13 +33,38 @@ import static org.junit.Assert.*;
  */
 public final strictfp class ConventionTest extends TestCase {
     /**
-     * Tests {@link Convention#getForcedUnit(Class)}.
+     * Tests {@link Convention#getNameAuthority()}.
      */
     @Test
-    public void testGetForcedUnit() {
-        assertNull(Convention.WKT2.getForcedUnit(Angle.class));
-        assertNull(Convention.WKT1.getForcedUnit(Angle.class));
-        assertEquals(NonSI.DEGREE_ANGLE, Convention.WKT1_COMMON_UNITS.getForcedUnit(Angle.class));
-        assertNull(Convention.WKT1_COMMON_UNITS.getForcedUnit(Duration.class));
+    public void testGetNameAuthority() {
+        assertSame(Citations.EPSG, Convention.WKT2.getNameAuthority());
+        assertSame(Citations.EPSG, Convention.WKT2_SIMPLIFIED.getNameAuthority());
+        assertSame(Citations.OGC,  Convention.WKT1.getNameAuthority());
+        assertSame(Citations.OGC,  Convention.WKT1_COMMON_UNITS.getNameAuthority());
+        assertSame(Citations.EPSG, Convention.INTERNAL.getNameAuthority());
+    }
+
+    /**
+     * Tests {@link Convention#isWKT1()}.
+     */
+    @Test
+    public void testIsWKT1() {
+        assertFalse(Convention.WKT2.isWKT1());
+        assertFalse(Convention.WKT2_SIMPLIFIED.isWKT1());
+        assertTrue (Convention.WKT1.isWKT1());
+        assertTrue (Convention.WKT1_COMMON_UNITS.isWKT1());
+        assertFalse(Convention.INTERNAL.isWKT1());
+    }
+
+    /**
+     * Tests {@link Convention#isSimple()}.
+     */
+    @Test
+    public void testIsSimple() {
+        assertFalse(Convention.WKT2.isSimple());
+        assertTrue (Convention.WKT2_SIMPLIFIED.isSimple());
+        assertTrue (Convention.WKT1.isSimple());
+        assertTrue (Convention.WKT1_COMMON_UNITS.isSimple());
+        assertTrue (Convention.INTERNAL.isSimple());
     }
 }

Modified: sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/Assert.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/Assert.java?rev=1563914&r1=1563913&r2=1563914&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/Assert.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-referencing/src/test/java/org/apache/sis/referencing/Assert.java
[UTF-8] Mon Feb  3 14:30:36 2014
@@ -30,6 +30,7 @@ import org.opengis.referencing.operation
 import org.opengis.referencing.cs.AxisDirection;
 import org.opengis.referencing.cs.CoordinateSystemAxis;
 import org.opengis.referencing.cs.RangeMeaning;
+import org.apache.sis.io.wkt.Convention;
 import org.apache.sis.io.wkt.Symbols;
 import org.apache.sis.io.wkt.WKTFormat;
 import org.apache.sis.geometry.AbstractEnvelope;
@@ -60,6 +61,7 @@ public strictfp class Assert extends org
      */
     private static final WKTFormat WKT_FORMAT = new WKTFormat(null, null);
     static {
+        WKT_FORMAT.setConvention(Convention.WKT2_SIMPLIFIED);
         final Symbols s = new Symbols(Symbols.SQUARE_BRACKETS);
         s.setPairedQuotes("“”", "\"\"");
         WKT_FORMAT.setSymbols(s);



Mime
View raw message