You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2016/04/22 14:25:40 UTC
svn commit: r1740494 - in /sis/branches/JDK8/core:
sis-metadata/src/main/java/org/apache/sis/io/wkt/
sis-referencing/src/main/java/org/apache/sis/referencing/operation/
sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/
Author: desruisseaux
Date: Fri Apr 22 12:25:40 2016
New Revision: 1740494
URL: http://svn.apache.org/viewvc?rev=1740494&view=rev
Log:
Add "ID[...]" element in SourceCRS and TargetCRS of ConcatenatedOperation WKT.
Modified:
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
Modified: sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1740494&r1=1740493&r2=1740494&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Fri Apr 22 12:25:40 2016
@@ -692,7 +692,8 @@ public class Formatter implements Locali
info = ((GeneralParameterValue) object).getDescriptor();
}
if (info != null) {
- appendComplement(info, (stackDepth != 0) ? enclosingElements.get(stackDepth - 1) : null);
+ appendComplement(info, (stackDepth >= 1) ? enclosingElements.get(stackDepth - 1) : null,
+ (stackDepth >= 2) ? enclosingElements.get(stackDepth - 2) : null);
}
buffer.appendCodePoint(symbols.getClosingBracket(0));
indent(-1);
@@ -707,9 +708,10 @@ public class Formatter implements Locali
* and have a special treatment: they are written by {@link #append(FormattableObject)}
* after the {@code formatTo(Formatter)} method returned.
*
- * <p>The {@code ID[<name>,<code>,…]} element is written only for the root element, unless the convention are
- * INTERNAL. If formatted, the ID element will be on the same line than the enclosing one if no line separator
- * were requested (e.g. SPHEROID["Clarke 1866", …, ID["EPSG", 7008]]), or on a new line otherwise. Example:</p>
+ * <p>The {@code ID[<name>,<code>,…]} element is normally written only for the root element
+ * (unless the convention is {@code INTERNAL}), but there is various exceptions to this rule.
+ * If formatted, the {@code ID} element will be by default on the same line than the enclosing
+ * element (e.g. {@code SPHEROID["Clarke 1866", …, ID["EPSG", 7008]]}). Other example:</p>
*
* {@preformat text
* PROJCS["NAD27 / Idaho Central",
@@ -730,7 +732,7 @@ public class Formatter implements Locali
* A {@code <remark>} can be included within the descriptions of source and target CRS embedded within
* a coordinate transformation as well as within the coordinate transformation itself.</blockquote>
*/
- private void appendComplement(final IdentifiedObject object, final FormattableObject parent) {
+ private void appendComplement(final IdentifiedObject object, final FormattableObject parent, final FormattableObject gp) {
isComplement = true;
final boolean showIDs; // Whether to format ID[…] elements.
final boolean filterID; // Whether we shall limit to a single ID[…] element.
@@ -753,6 +755,9 @@ public class Formatter implements Locali
*/
if (parent == null || parent instanceof CompoundCRS) {
showIDs = true;
+ } else if (gp instanceof CoordinateOperation && !(parent instanceof IdentifiedObject)) {
+ // "SourceCRS[…]" and "TargetCRS[…]" sub-elements in CoordinateOperation.
+ showIDs = true;
} else if (convention == Convention.WKT2_SIMPLIFIED) {
showIDs = false;
} else {
@@ -769,7 +774,7 @@ public class Formatter implements Locali
showRemarks = showOthers;
} else if (object instanceof ReferenceSystem) {
showOthers = (parent == null);
- showRemarks = (parent == null) || (getEnclosingElement(2) instanceof CoordinateOperation);
+ showRemarks = (parent == null) || (gp instanceof CoordinateOperation);
} else {
showOthers = false; // Mandated by ISO 19162.
showRemarks = false;
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java?rev=1740494&r1=1740493&r2=1740494&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/AbstractCoordinateOperation.java [UTF-8] Fri Apr 22 12:25:40 2016
@@ -930,6 +930,7 @@ check: for (int isTarget=0; ; isTar
return type;
}
});
+ formatter.newLine();
}
}
Modified: sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java?rev=1740494&r1=1740493&r2=1740494&view=diff
==============================================================================
--- sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java [UTF-8] (original)
+++ sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/MathTransforms.java [UTF-8] Fri Apr 22 12:25:40 2016
@@ -163,10 +163,14 @@ public final class MathTransforms extend
* Furthermore the returned transform is affine (i.e. implement the {@link LinearTransform} interface)
* if the interval between each {@code preimage} and {@code values} element is constant.
*
+ * <p>The current implementation uses linear interpolation. This may be changed in a future SIS version.</p>
+ *
* @param preimage the input values (<var>x</var>) in the function domain, or {@code null}.
* @param values the output values (<var>y</var>) in the function range, or {@code null}.
* @return the <i>y=f(x)</i> function.
*
+ * @see org.opengis.coverage.InterpolationMethod
+ *
* @since 0.7
*/
public static MathTransform1D interpolate(final double[] preimage, final double[] values) {