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/07/18 17:47:23 UTC
svn commit: r1753294 [2/3] - in /sis/trunk: ./
core/sis-build-helper/src/main/ant/
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/inter...
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -375,6 +375,11 @@ public class DefaultMetadata extends ISO
/**
* Returns a unique identifier for this metadata record.
*
+ * <div class="note"><b>Note:</b>
+ * OGC 07-045 (Catalog Service Specification \u2014 ISO metadata application profile) recommends usage
+ * of a UUID (Universal Unique Identifier) as specified by <a href="http://www.ietf.org">IETF</a>
+ * to ensure identifier\u2019s uniqueness.</div>
+ *
* @return Unique identifier for this metadata record, or {@code null}.
*
* @since 0.5
@@ -611,7 +616,7 @@ public class DefaultMetadata extends ISO
/**
* Returns an identification of the parent metadata record.
- * This is non-null if this metadata is a subset (child) of another metadata.
+ * This is non-null if this metadata is a subset (child) of another metadata that is described elsewhere.
*
* @return Identification of the parent metadata record, or {@code null} if none.
*
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/AbstractStereographic.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -31,7 +31,7 @@ import org.apache.sis.referencing.operat
*
* @author Martin Desruisseaux (IRD, Geomatys)
* @since 0.6
- * @version 0.6
+ * @version 0.8
* @module
*/
@XmlTransient
@@ -42,12 +42,6 @@ abstract class AbstractStereographic ext
private static final long serialVersionUID = -8797654778436582119L;
/**
- * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite> (k\u2080) parameter value.
- * Valid values range is (0 \u2026 \u221e) and default value is 1.
- */
- public static final ParameterDescriptor<Double> SCALE_FACTOR = Mercator1SP.SCALE_FACTOR;
-
- /**
* The operation parameter descriptor for the <cite>False easting</cite> (FE) parameter value.
* Valid values range is unrestricted and default value is 0 metre.
*/
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/GeocentricAffine.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -128,13 +128,13 @@ public abstract class GeocentricAffine e
static final ParameterDescriptor<Double> DS;
static {
final ParameterBuilder builder = builder();
- TX = createShift(builder.addName("X-axis translation").addName(Citations.OGC, "dx"));
- TY = createShift(builder.addName("Y-axis translation").addName(Citations.OGC, "dy"));
- TZ = createShift(builder.addName("Z-axis translation").addName(Citations.OGC, "dz"));
- RX = createRotation(builder, "X-axis rotation", "ex");
- RY = createRotation(builder, "Y-axis rotation", "ey");
- RZ = createRotation(builder, "Z-axis rotation", "ez");
- DS = builder.addName("Scale difference").addName(Citations.OGC, "ppm").create(1, Units.PPM);
+ TX = createShift(builder.addIdentifier("8605").addName("X-axis translation").addName(Citations.OGC, "dx"));
+ TY = createShift(builder.addIdentifier("8606").addName("Y-axis translation").addName(Citations.OGC, "dy"));
+ TZ = createShift(builder.addIdentifier("8607").addName("Z-axis translation").addName(Citations.OGC, "dz"));
+ RX = createRotation(builder.addIdentifier("8608"), "X-axis rotation", "ex");
+ RY = createRotation(builder.addIdentifier("8609"), "Y-axis rotation", "ey");
+ RZ = createRotation(builder.addIdentifier("8610"), "Z-axis rotation", "ez");
+ DS = builder.addIdentifier("8611").addName("Scale difference").addName(Citations.OGC, "ppm").create(1, Units.PPM);
}
/**
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/LambertConformal2SP.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -107,9 +107,8 @@ public final class LambertConformal2SP e
* NetCDF: longitude_of_central_meridian
* GeoTIFF: FalseOriginLong
*/
- LONGITUDE_OF_FALSE_ORIGIN = createLongitude(exceptEPSG(LambertConformal1SP.LONGITUDE_OF_ORIGIN, builder
- .addIdentifier("8822")
- .addName("Longitude of false origin"))
+ LONGITUDE_OF_FALSE_ORIGIN = createLongitude(
+ rename(LambertConformal1SP.LONGITUDE_OF_ORIGIN, "8822", "Longitude of false origin", builder)
.rename(Citations.NETCDF, "longitude_of_central_meridian")
.rename(Citations.GEOTIFF, "FalseOriginLong"));
/*
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -58,7 +58,7 @@ import static org.opengis.metadata.Ident
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*/
@XmlTransient
@@ -245,47 +245,105 @@ public abstract class MapProjection exte
}
/**
- * Copies all aliases and identifiers except the ones for the given authority.
- * If the given replacement is non-null, then it will be used instead of the
- * first occurrence of the omitted name.
+ * Rename the primary name and identifier of the given descriptor. Aliases are copied as-is.
*
- * <p>This method does not copy the primary name. It is caller's responsibility to add it first.</p>
+ * @param template the parameter from which to copy the aliases.
+ * @param identifier the new EPSG identifier.
+ * @param name the new EPSG name.
+ * @param builder an initially clean builder where to add the names.
+ * @return the given {@code builder}, for method call chaining.
+ *
+ * @since 0.8
+ */
+ static ParameterBuilder rename(final ParameterDescriptor<?> template, final String identifier, final String name,
+ final ParameterBuilder builder)
+ {
+ return exceptEPSG(template, builder.addIdentifier(identifier).addName(name));
+ }
+
+ /**
+ * Copies name, aliases and identifiers of the given {@code template}, except the alias of the given authority
+ * which is replaced by the alias of the same authority in {@code replacement}.
*
- * @param source The parameter from which to copy the names.
- * @param except The authority of the name to omit. Can not be EPSG.
- * @param replacement The name to use instead of the omitted one, or {@code null} if none.
- * @param builder Where to add the names.
- * @return The given {@code builder}, for method call chaining.
+ * @param template the parameter from which to copy names and identifiers.
+ * @param toRename authority of the alias to rename.
+ * @param replacement the parameter from which to get the new name for the alias to rename.
+ * @param builder an initially clean builder where to add the names and identifiers.
+ * @return the given {@code builder}, for method call chaining.
*
- * @since 0.7
+ * @since 0.8
*/
- static ParameterBuilder except(final ParameterDescriptor<Double> source, final Citation except,
+ static ParameterBuilder renameAlias(final ParameterDescriptor<Double> template, final Citation toRename,
+ final ParameterDescriptor<Double> replacement, final ParameterBuilder builder)
+ {
+ copyAliases(template, toRename, sameNameAs(toRename, replacement), builder.addName(template.getName()));
+ for (final ReferenceIdentifier id : template.getIdentifiers()) {
+ builder.addIdentifier(id);
+ }
+ return builder;
+ }
+
+ /**
+ * Copies all aliases except the ones for the given authority. If the given replacement is non-null,
+ * then it will be used instead of the first occurrence of the omitted name.
+ *
+ * <p>This method does not copy the primary name. It is caller's responsibility to add it first.</p>
+ *
+ * @param template the parameter from which to copy the aliases.
+ * @param exclude the authority of the alias to omit. Can not be EPSG.
+ * @param replacement the alias to use instead of the omitted one, or {@code null} if none.
+ * @param builder where to add the aliases.
+ * @return the given {@code builder}, for method call chaining.
+ */
+ private static ParameterBuilder copyAliases(final ParameterDescriptor<Double> template, final Citation exclude,
GenericName replacement, final ParameterBuilder builder)
{
- for (GenericName alias : source.getAlias()) {
- if (((Identifier) alias).getAuthority() == except) {
+ for (GenericName alias : template.getAlias()) {
+ if (((Identifier) alias).getAuthority() == exclude) {
if (replacement == null) continue;
alias = replacement;
replacement = null;
}
builder.addName(alias);
}
- for (final ReferenceIdentifier id : source.getIdentifiers()) {
- builder.addIdentifier(id);
- }
return builder;
}
/**
+ * Copies all aliases and identifiers, but using the alias specified by the given authority as the primary name.
+ * The old primary name (usually the EPSG name) is discarded. Identifier are <strong>not</strong> copied, which
+ * usually implies that only the EPSG identifier is ignored (because it is usually the only parameter identifier).
+ *
+ * <p>This is a convenience method for defining the parameters of an ESRI-specific (or any other authority)
+ * projection using the EPSG parameters as template. Note that in the particular case where the desired
+ * authority is OGC, {@link #exceptEPSG(ParameterDescriptor, ParameterBuilder)} is more efficient.</p>
+ *
+ * @param template the parameter from which to copy the names.
+ * @param authority the authority to use for the primary name.
+ * @param builder an initially clean builder where to add the names.
+ * @return the given {@code builder}, for method call chaining.
+ *
+ * @since 0.8
+ */
+ static ParameterBuilder alternativeAuthority(final ParameterDescriptor<Double> template,
+ final Citation authority, final ParameterBuilder builder)
+ {
+ return copyAliases(template, authority, null, builder.addName(sameNameAs(authority, template)));
+ }
+
+ /**
* Copies all names except the EPSG one from the given parameter into the builder.
- * The EPSG name is presumed the first name and identifier (this is not verified).
+ * The EPSG information are presumed to be the primary name and the only identifier (this is not verified).
+ *
+ * <p>If this method is invoking with a "clean" builder, then the result is to promote the first alias as
+ * the primary name. The first alias is usually the OGC name.</p>
*
- * @param source The parameter from which to copy the names.
- * @param builder Where to add the names.
- * @return The given {@code builder}, for method call chaining.
+ * @param template the parameter from which to copy the names.
+ * @param builder where to add the names.
+ * @return the given {@code builder}, for method call chaining.
*/
- static ParameterBuilder exceptEPSG(final ParameterDescriptor<?> source, final ParameterBuilder builder) {
- for (final GenericName alias : source.getAlias()) {
+ static ParameterBuilder exceptEPSG(final ParameterDescriptor<?> template, final ParameterBuilder builder) {
+ for (final GenericName alias : template.getAlias()) {
builder.addName(alias);
}
return builder;
@@ -294,8 +352,8 @@ public abstract class MapProjection exte
/**
* Creates a remarks for parameters that are not formally EPSG parameter.
*
- * @param origin The name of the projection for where the parameter is formally used.
- * @return A remarks saying that the parameter is actually defined in {@code origin}.
+ * @param origin the name of the projection for where the parameter is formally used.
+ * @return a remarks saying that the parameter is actually defined in {@code origin}.
*/
static InternationalString notFormalParameter(final String origin) {
return Messages.formatInternational(Messages.Keys.NotFormalProjectionParameter_1, origin);
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator2SP.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -105,9 +105,9 @@ public final class Mercator2SP extends A
.addIdentifier(Citations.S57, "8")
.createGroupForMapProjection(
STANDARD_PARALLEL,
- latitudeOfOrigin, // Not formally a Mercator2SP parameter.
+ latitudeOfOrigin, // Not formally a Mercator2SP parameter.
Mercator1SP.LONGITUDE_OF_ORIGIN,
- SCALE_FACTOR, // Not formally a Mercator2SP parameter.
+ SCALE_FACTOR, // Not formally a Mercator2SP parameter.
FALSE_EASTING,
FALSE_NORTHING);
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Molodensky.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -92,8 +92,8 @@ public final class Molodensky extends Ge
public static final ParameterDescriptorGroup PARAMETERS;
static {
final ParameterBuilder builder = builder();
- AXIS_LENGTH_DIFFERENCE = builder.addName("Semi-major axis length difference").create(Double.NaN, SI.METRE);
- FLATTENING_DIFFERENCE = builder.addName("Flattening difference").createBounded(-1, +1, Double.NaN, Unit.ONE);
+ AXIS_LENGTH_DIFFERENCE = builder.addIdentifier("8654").addName("Semi-major axis length difference").create(Double.NaN, SI.METRE);
+ FLATTENING_DIFFERENCE = builder.addIdentifier("8655").addName("Flattening difference").createBounded(-1, +1, Double.NaN, Unit.ONE);
PARAMETERS = builder.setRequired(true)
.addIdentifier("9604")
.addName("Molodensky")
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/ObliqueStereographic.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -31,7 +31,7 @@ import org.apache.sis.referencing.operat
* @author Rueben Schulz (UBC)
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*
* @see <a href="http://www.remotesensing.org/geotiff/proj_list/oblique_stereographic.html">Oblique Stereographic on RemoteSensing.org</a>
@@ -56,6 +56,12 @@ public final class ObliqueStereographic
public static final ParameterDescriptor<Double> LONGITUDE_OF_ORIGIN = Mercator1SP.LONGITUDE_OF_ORIGIN;
/**
+ * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite> (k\u2080) parameter value.
+ * Valid values range is (0 \u2026 \u221e) and default value is 1.
+ */
+ public static final ParameterDescriptor<Double> SCALE_FACTOR = Mercator1SP.SCALE_FACTOR; // Same as PolarStereographicA.
+
+ /**
* The group of all parameters expected by this coordinate operation.
*/
private static final ParameterDescriptorGroup PARAMETERS;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicA.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -29,7 +29,7 @@ import org.apache.sis.parameter.Paramete
* @author Rueben Schulz (UBC)
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*
* @see <a href="http://www.remotesensing.org/geotiff/proj_list/polar_stereographic.html">Polar Stereographic on RemoteSensing.org</a>
@@ -64,6 +64,12 @@ public final class PolarStereographicA e
public static final ParameterDescriptor<Double> LONGITUDE_OF_ORIGIN;
/**
+ * The operation parameter descriptor for the <cite>Scale factor at natural origin</cite> (k\u2080) parameter value.
+ * Valid values range is (0 \u2026 \u221e) and default value is 1.
+ */
+ public static final ParameterDescriptor<Double> SCALE_FACTOR = Mercator1SP.SCALE_FACTOR;
+
+ /**
* The group of all parameters expected by this coordinate operation.
*/
private static final ParameterDescriptorGroup PARAMETERS;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicB.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -31,7 +31,7 @@ import org.apache.sis.parameter.Paramete
* @author Rueben Schulz (UBC)
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.6
+ * @version 0.8
* @module
*/
@XmlTransient
@@ -67,7 +67,6 @@ public final class PolarStereographicB e
* because it is sometime used in Well Known Text (WKT). However it shall be interpreted as a
* <cite>Scale factor at the standard parallel</cite> rather than at the natural origin.</p>
*/
- @SuppressWarnings("FieldNameHidesFieldInSuperclass")
static final ParameterDescriptor<Double> SCALE_FACTOR;
/**
@@ -77,8 +76,7 @@ public final class PolarStereographicB e
static {
final ParameterBuilder builder = builder();
LONGITUDE_OF_ORIGIN = createLongitude(
- exceptEPSG(PolarStereographicA.LONGITUDE_OF_ORIGIN,
- builder.addIdentifier("8833").addName("Longitude of origin")));
+ rename(PolarStereographicA.LONGITUDE_OF_ORIGIN, "8833", "Longitude of origin", builder));
STANDARD_PARALLEL = createMandatoryLatitude(builder
.addIdentifier("8832").addName("Latitude of standard parallel")
@@ -98,7 +96,7 @@ public final class PolarStereographicB e
.createGroupForMapProjection(
STANDARD_PARALLEL,
LONGITUDE_OF_ORIGIN,
- SCALE_FACTOR, // Not formally a parameter of this projection.
+ SCALE_FACTOR, // Not formally a parameter of this projection.
FALSE_EASTING,
FALSE_NORTHING);
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/PolarStereographicSouth.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -44,22 +44,18 @@ public final class PolarStereographicSou
private static final long serialVersionUID = -6173635411676914083L;
/**
- * Copies all names and identifiers, but using the ESRI authority as the primary name.
- * This is a convenience method for defining the parameters of an ESRI-specific projection
- * using the EPSG parameters as template.
- */
- private static ParameterBuilder addNamesAndIdentifiers(final ParameterDescriptor<Double> source, final ParameterBuilder builder) {
- return except(source, Citations.ESRI, null, builder.addName(sameNameAs(Citations.ESRI, source)).addName(source.getName()));
- }
-
- /**
- * Returns the same parameter than the given one, except that the primary name is the ESRI name
- * instead than the EPSG one.
+ * Returns the same parameter than the given one, except that the alias of the ESRI authority
+ * is promoted as the primary name. The old primary name and identifiers (which are usually the
+ * EPSG ones) are discarded.
+ *
+ * @param template the parameter from which to copy the names and identifiers.
+ * @param builder an initially clean builder where to add the names.
+ * @return the given {@code builder}, for method call chaining.
*/
@SuppressWarnings("unchecked")
- private static ParameterDescriptor<Double> forESRI(final ParameterDescriptor<Double> source, final ParameterBuilder builder) {
- return addNamesAndIdentifiers(source, builder).createBounded((MeasurementRange<Double>)
- ((DefaultParameterDescriptor<Double>) source).getValueDomain(), source.getDefaultValue());
+ private static ParameterDescriptor<Double> forESRI(final ParameterDescriptor<Double> template, final ParameterBuilder builder) {
+ return alternativeAuthority(template, Citations.ESRI, builder).createBounded((MeasurementRange<Double>)
+ ((DefaultParameterDescriptor<Double>) template).getValueDomain(), template.getDefaultValue());
}
/**
@@ -69,13 +65,13 @@ public final class PolarStereographicSou
static {
final ParameterBuilder builder = builder();
final ParameterDescriptor<?>[] parameters = {
- addNamesAndIdentifiers(PolarStereographicB.STANDARD_PARALLEL, builder)
+ alternativeAuthority(PolarStereographicB.STANDARD_PARALLEL, Citations.ESRI, builder)
.createBounded(Latitude.MIN_VALUE, 0, Latitude.MIN_VALUE, NonSI.DEGREE_ANGLE),
forESRI(PolarStereographicB.LONGITUDE_OF_ORIGIN, builder),
- forESRI(PolarStereographicB.SCALE_FACTOR, builder),
- forESRI(PolarStereographicB.FALSE_EASTING, builder),
- forESRI(PolarStereographicB.FALSE_NORTHING, builder)
+ PolarStereographicB.SCALE_FACTOR, // Not formally a parameter of this projection.
+ forESRI(LambertCylindricalEqualArea.FALSE_EASTING, builder),
+ forESRI(LambertCylindricalEqualArea.FALSE_NORTHING, builder)
};
PARAMETERS = builder
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/RegionalMercator.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -74,19 +74,16 @@ public class RegionalMercator extends Ab
static {
final ParameterBuilder builder = builder();
- LATITUDE_OF_FALSE_ORIGIN = createLatitude(exceptEPSG(Mercator1SP.LATITUDE_OF_ORIGIN, builder
- .addIdentifier("8821")
- .addName("Latitude of false origin"))
+ LATITUDE_OF_FALSE_ORIGIN = createLatitude(
+ rename(Mercator1SP.LATITUDE_OF_ORIGIN, "8821", "Latitude of false origin", builder)
.rename(Citations.GEOTIFF, "FalseOriginLat"), false);
- EASTING_AT_FALSE_ORIGIN = createShift(exceptEPSG(FALSE_EASTING, builder
- .addIdentifier("8826")
- .addName("Easting at false origin"))
+ EASTING_AT_FALSE_ORIGIN = createShift(
+ rename(FALSE_EASTING, "8826", "Easting at false origin", builder)
.rename(Citations.GEOTIFF, "FalseOriginEasting"));
- NORTHING_AT_FALSE_ORIGIN = createShift(exceptEPSG(FALSE_NORTHING, builder
- .addIdentifier("8827")
- .addName("Northing at false origin"))
+ NORTHING_AT_FALSE_ORIGIN = createShift(
+ rename(FALSE_NORTHING, "8827", "Northing at false origin", builder)
.rename(Citations.GEOTIFF, "FalseOriginNorthing"));
PARAMETERS = builder
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/TransverseMercator.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -90,9 +90,8 @@ public final class TransverseMercator ex
LATITUDE_OF_ORIGIN = createLatitude(builder
.addNamesAndIdentifiers(Mercator1SP.LATITUDE_OF_ORIGIN), true);
- builder.addName(Mercator1SP.LONGITUDE_OF_ORIGIN.getName());
- LONGITUDE_OF_ORIGIN = createLongitude(except(Mercator1SP.LONGITUDE_OF_ORIGIN, Citations.NETCDF,
- sameNameAs(Citations.NETCDF, LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN), builder));
+ LONGITUDE_OF_ORIGIN = createLongitude(renameAlias(Mercator1SP.LONGITUDE_OF_ORIGIN,
+ Citations.NETCDF, LambertConformal2SP.LONGITUDE_OF_FALSE_ORIGIN, builder));
SCALE_FACTOR = createScale(builder
.addNamesAndIdentifiers(Mercator1SP.SCALE_FACTOR)
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/package-info.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -22,7 +22,7 @@
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*
* @see org.apache.sis.referencing.operation.transform.MathTransformProvider
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterBuilder.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -125,7 +125,7 @@ public class ParameterBuilder extends Bu
/**
* Creates a new builder initialized to properties of the given object.
*
- * @param descriptor The descriptor from which to inherit properties, or {@code null}.
+ * @param descriptor the descriptor from which to inherit properties, or {@code null}.
*
* @since 0.6
*/
@@ -165,10 +165,10 @@ public class ParameterBuilder extends Bu
/**
* Creates a descriptor for values of the given type without domain restriction.
*
- * @param <T> The compile-time type of the {@code valueClass} argument.
- * @param valueClass The class that describe the type of the parameter values.
- * @param defaultValue The default value for the parameter, or {@code null} if none.
- * @return The parameter descriptor for the given default value and unit.
+ * @param <T> the compile-time type of the {@code valueClass} argument.
+ * @param valueClass the class that describe the type of the parameter values.
+ * @param defaultValue the default value for the parameter, or {@code null} if none.
+ * @return the parameter descriptor for the given default value and unit.
*/
public <T> ParameterDescriptor<T> create(final Class<T> valueClass, final T defaultValue) {
return create(valueClass, null, null, defaultValue);
@@ -178,9 +178,9 @@ public class ParameterBuilder extends Bu
* Creates a descriptor for floating point values without domain restriction.
* All {@code double} values are considered valid.
*
- * @param defaultValue The default value for the parameter, or {@link Double#NaN} if none.
- * @param unit The default unit, or {@code null} if none.
- * @return The parameter descriptor for the given default value and unit.
+ * @param defaultValue the default value for the parameter, or {@link Double#NaN} if none.
+ * @param unit the default unit, or {@code null} if none.
+ * @return the parameter descriptor for the given default value and unit.
*/
public ParameterDescriptor<Double> create(final double defaultValue, final Unit<?> unit) {
final Range<Double> valueDomain;
@@ -196,9 +196,9 @@ public class ParameterBuilder extends Bu
* Creates a descriptor for floating point values greater than zero.
* The zero value is not considered valid. There is no maximal value.
*
- * @param defaultValue The default value for the parameter, or {@link Double#NaN} if none.
- * @param unit The default unit, or {@code null} if none.
- * @return The parameter descriptor for the given default value and unit.
+ * @param defaultValue the default value for the parameter, or {@link Double#NaN} if none.
+ * @param unit the default unit, or {@code null} if none.
+ * @return the parameter descriptor for the given default value and unit.
*/
public ParameterDescriptor<Double> createStrictlyPositive(final double defaultValue, final Unit<?> unit) {
final Range<Double> valueDomain;
@@ -213,11 +213,11 @@ public class ParameterBuilder extends Bu
/**
* Creates a descriptor for floating point values restricted to the given domain.
*
- * @param minimumValue The minimum parameter value (inclusive), or {@link Double#NEGATIVE_INFINITY} if none.
- * @param maximumValue The maximum parameter value (inclusive), or {@link Double#POSITIVE_INFINITY} if none.
- * @param defaultValue The default value for the parameter, or {@link Double#NaN} if none.
- * @param unit The unit for default, minimum and maximum values, or {@code null} if none.
- * @return The parameter descriptor for the given domain of values.
+ * @param minimumValue the minimum parameter value (inclusive), or {@link Double#NEGATIVE_INFINITY} if none.
+ * @param maximumValue the maximum parameter value (inclusive), or {@link Double#POSITIVE_INFINITY} if none.
+ * @param defaultValue the default value for the parameter, or {@link Double#NaN} if none.
+ * @param unit the unit for default, minimum and maximum values, or {@code null} if none.
+ * @return the parameter descriptor for the given domain of values.
*/
public ParameterDescriptor<Double> createBounded(final double minimumValue, final double maximumValue,
final double defaultValue, final Unit<?> unit)
@@ -236,10 +236,10 @@ public class ParameterBuilder extends Bu
/**
* Creates a descriptor for integer values restricted to the given domain.
*
- * @param minimumValue The minimum parameter value (inclusive).
- * @param maximumValue The maximum parameter value (inclusive).
- * @param defaultValue The default value for the parameter.
- * @return The parameter descriptor for the given domain of values.
+ * @param minimumValue the minimum parameter value (inclusive).
+ * @param maximumValue the maximum parameter value (inclusive).
+ * @param defaultValue the default value for the parameter.
+ * @return the parameter descriptor for the given domain of values.
*/
public ParameterDescriptor<Integer> createBounded(final int minimumValue, final int maximumValue,
final int defaultValue)
@@ -250,12 +250,12 @@ public class ParameterBuilder extends Bu
/**
* Creates a descriptor for values of the given type restricted to the given domain.
*
- * @param <T> The compile-time type of the {@code valueClass} argument.
- * @param valueClass The class that describe the type of the parameter values.
- * @param minimumValue The minimum parameter value (inclusive), or {@code null} if none.
- * @param maximumValue The maximum parameter value (inclusive), or {@code null} if none.
- * @param defaultValue The default value for the parameter, or {@code null} if none.
- * @return The parameter descriptor for the given domain of values.
+ * @param <T> the compile-time type of the {@code valueClass} argument.
+ * @param valueClass the class that describe the type of the parameter values.
+ * @param minimumValue the minimum parameter value (inclusive), or {@code null} if none.
+ * @param maximumValue the maximum parameter value (inclusive), or {@code null} if none.
+ * @param defaultValue the default value for the parameter, or {@code null} if none.
+ * @return the parameter descriptor for the given domain of values.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public <T extends Comparable<? super T>> ParameterDescriptor<T> createBounded(final Class<T> valueClass,
@@ -277,10 +277,10 @@ public class ParameterBuilder extends Bu
* Creates a descriptor for values in the domain represented by the given {@code Range} object.
* This method allows to specify whether the minimum and maximum values are inclusive or not.
*
- * @param <T> The type of the parameter values.
- * @param valueDomain The minimum value, maximum value and unit of measurement.
- * @param defaultValue The default value for the parameter, or {@code null} if none.
- * @return The parameter descriptor for the given domain of values.
+ * @param <T> the type of the parameter values.
+ * @param valueDomain the minimum value, maximum value and unit of measurement.
+ * @param defaultValue the default value for the parameter, or {@code null} if none.
+ * @return the parameter descriptor for the given domain of values.
*/
public <T extends Comparable<? super T>> ParameterDescriptor<T> createBounded(
final Range<T> valueDomain, final T defaultValue)
@@ -297,12 +297,12 @@ public class ParameterBuilder extends Bu
* a {@linkplain org.opengis.util.CodeList code list} or {@linkplain Enum enumeration} subset.
* It is not necessary to provide this property when all values from the code list or enumeration are valid.</p>
*
- * @param <T> The compile-time type of the {@code valueClass} argument.
- * @param valueClass The class that describe the type of the parameter values.
- * @param validValues A finite set of valid values (usually from a code list or enumeration)
- * or {@code null} if it doesn't apply.
- * @param defaultValue The default value for the parameter, or {@code null} if none.
- * @return The parameter descriptor for the given set of valid values.
+ * @param <T> the compile-time type of the {@code valueClass} argument.
+ * @param valueClass the class that describe the type of the parameter values.
+ * @param validValues a finite set of valid values (usually from a code list or enumeration)
+ * or {@code null} if it doesn't apply.
+ * @param defaultValue the default value for the parameter, or {@code null} if none.
+ * @return the parameter descriptor for the given set of valid values.
*/
public <T> ParameterDescriptor<T> createEnumerated(final Class<T> valueClass, final T[] validValues, final T defaultValue) {
ensureNonNull("valueClass", valueClass);
@@ -330,13 +330,13 @@ public class ParameterBuilder extends Bu
/**
* Creates a descriptor group for the given cardinality and parameters.
*
- * @param minimumOccurs The {@linkplain DefaultParameterDescriptorGroup#getMinimumOccurs() minimum}
- * number of times that values for this parameter group are required.
- * @param maximumOccurs The {@linkplain DefaultParameterDescriptorGroup#getMaximumOccurs() maximum}
- * number of times that values for this parameter group are required.
- * @param parameters The {@linkplain DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
- * for the group to create.
- * @return The parameter descriptor group.
+ * @param minimumOccurs the {@linkplain DefaultParameterDescriptorGroup#getMinimumOccurs() minimum}
+ * number of times that values for this parameter group are required.
+ * @param maximumOccurs the {@linkplain DefaultParameterDescriptorGroup#getMaximumOccurs() maximum}
+ * number of times that values for this parameter group are required.
+ * @param parameters the {@linkplain DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
+ * for the group to create.
+ * @return the parameter descriptor group.
*/
public ParameterDescriptorGroup createGroup(final int minimumOccurs, final int maximumOccurs,
final GeneralParameterDescriptor... parameters)
@@ -356,9 +356,9 @@ public class ParameterBuilder extends Bu
* {@link #createGroup(int, int, GeneralParameterDescriptor[])} with a cardinality of [0 \u2026 1]
* or [1 \u2026 1] depending on the value given to the last call to {@link #setRequired(boolean)}.
*
- * @param parameters The {@linkplain DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
+ * @param parameters the {@linkplain DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
* for the group to create.
- * @return The parameter descriptor group.
+ * @return the parameter descriptor group.
*/
public ParameterDescriptorGroup createGroup(final GeneralParameterDescriptor... parameters) {
return createGroup(required ? 1 : 0, 1, parameters);
@@ -373,8 +373,8 @@ public class ParameterBuilder extends Bu
* expect the same parameters than their <cite>"Position Vector transformation"</cite> counterpart
* (EPSG codes 1033, 1037 and 9606) but perform the rotation in the opposite direction.</div>
*
- * @param parameters The existing group from which to copy the parameters.
- * @return The parameter descriptor group.
+ * @param parameters the existing group from which to copy the parameters.
+ * @return the parameter descriptor group.
*
* @since 0.7
*/
@@ -421,9 +421,9 @@ public class ParameterBuilder extends Bu
* minimum} and {@linkplain DefaultParameterDescriptorGroup#getMaximumOccurs() maximum occurrence} of 1,
* regardless the value given to {@link #setRequired(boolean)}.
*
- * @param parameters The {@linkplain DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
+ * @param parameters the {@linkplain DefaultParameterDescriptorGroup#descriptors() parameter descriptors}
* for the group to create.
- * @return The parameter descriptor group for a map projection.
+ * @return the parameter descriptor group for a map projection.
*
* @since 0.6
*/
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/DefaultCoordinateOperationFactory.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -567,7 +567,7 @@ next: for (int i=components.size(); --
* from ISO 19111 since 'SingleOperation' is conceptually abstract. But we do that as a way to said that
* we are missing this important piece of information but still go ahead.
*
- * It is unconvenient to guarantee that the created operation is an instance of 'baseType' since the user
+ * It is inconvenient to guarantee that the created operation is an instance of 'baseType' since the user
* could have specified an implementation class or a custom sub-interface. We will perform the type check
* only after object creation.
*/
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/ConformalProjection.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -167,10 +167,10 @@ abstract class ConformalProjection exten
* For each line below, add the smallest values first in order to reduce rounding errors.
* The smallest values are the one using the eccentricity raised to the highest power.
*/
- ci2 = 13/ 360.* e8 + 1/ 12.* e6 + 5/24.* e4 + e2/2;
- ci4 = 811/ 11520.* e8 + 29/240.* e6 + 7/48.* e4;
- ci6 = 81/ 1120.* e8 + 7/120.* e6;
- ci8 = 4279/161280.* e8;
+ ci2 = 13/ 360. * e8 + 1/ 12. * e6 + 5/24. * e4 + e2/2;
+ ci4 = 811/ 11520. * e8 + 29/240. * e6 + 7/48. * e4;
+ ci6 = 81/ 1120. * e8 + 7/120. * e6;
+ ci8 = 4279/161280. * e8;
/*
* When rewriting equations using trigonometric identities, some constants appear.
* For example sin(2\u03b8) = 2\u22c5sin\u03b8\u22c5cos\u03b8, so we can factor out the 2 constant into the
@@ -257,7 +257,7 @@ abstract class ConformalProjection exten
+ ci2 * sin(2*\u03c6);
} else {
/*
- * Same formula than above, be rewriten using trigonometric identities in order to have only two
+ * Same formula than above, but rewriten using trigonometric identities in order to have only two
* calls to Math.sin/cos instead than 5. The performance gain is twice faster on tested machine.
*/
final double sin_2\u03c6 = sin(2*\u03c6);
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Initializer.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -20,6 +20,7 @@ import java.util.Map;
import org.opengis.parameter.ParameterDescriptor;
import org.opengis.parameter.ParameterNotFoundException;
import org.opengis.referencing.operation.OperationMethod;
+import org.apache.sis.internal.referencing.Formulas;
import org.apache.sis.internal.referencing.provider.MapProjection;
import org.apache.sis.internal.util.Constants;
import org.apache.sis.parameter.Parameters;
@@ -88,19 +89,33 @@ final class Initializer {
final DoubleDouble eccentricitySquared;
/**
- * Map projection variant. This is a convenience field left at
- * the discretion of {@link NormalizedProjection} subclasses.
+ * Map projection variant.
+ * Values from 0 to 127 inclusive are convenience values at the discretion of {@link NormalizedProjection} subclasses.
+ * Values from 128 to 255 inclusive are values handled in a special way by {@link Initializer} constructor.
*/
final byte variant;
/**
+ * A {@link #variant} value telling the constructor to computing the authalic radius instead than using
+ * the semi-major and semi-minor axis lengths directly.
+ *
+ * <p>Note that this value is not necessarily equivalent to the {@code SPHERICAL} value defined in some
+ * map projection, because EPSG guidance notes recommend different approaches for spherical implementations.
+ * For example the Mercator projection will use the radius of conformal sphere instead than the authalic radius.</p>
+ */
+ static final byte AUTHALIC_RADIUS = (byte) 128;
+
+ /**
* Creates a new initializer. The parameters are described in
* {@link NormalizedProjection#NormalizedProjection(OperationMethod, Parameters, Map)}.
*
- * @param method Description of the map projection parameters.
- * @param parameters The parameters of the projection to be created.
- * @param roles Parameters to look for <cite>central meridian</cite>, <cite>scale factor</cite>,
- * <cite>false easting</cite>, <cite>false northing</cite> and other values.
+ * @param method description of the map projection parameters.
+ * @param parameters the parameters of the projection to be created.
+ * @param roles parameters to look for <cite>central meridian</cite>, <cite>scale factor</cite>,
+ * <cite>false easting</cite>, <cite>false northing</cite> and other values.
+ * @param variant convenience field left at the discretion of {@link NormalizedProjection} subclasses.
+ * Values equal to greater than 128 are special values recognized by this constructor
+ * (see {@link #AUTHALIC_RADIUS}).
*/
Initializer(final OperationMethod method, final Parameters parameters,
final Map<ParameterRole, ? extends ParameterDescriptor<? extends Number>> roles,
@@ -114,8 +129,7 @@ final class Initializer {
this.variant = variant;
/*
* Note: we do not use Map.getOrDefault(K,V) below because the user could have explicitly associated
- * a null value to keys (we are paranoiac...) and because it conflicts with the "? extends" part of
- * in this constructor signature.
+ * a null value to keys (we are paranoiac...) and because it conflicts with the "? extends" parts.
*/
ParameterDescriptor<? extends Number> semiMajor = roles.get(ParameterRole.SEMI_MAJOR);
ParameterDescriptor<? extends Number> semiMinor = roles.get(ParameterRole.SEMI_MINOR);
@@ -133,65 +147,70 @@ final class Initializer {
eccentricitySquared = new DoubleDouble();
DoubleDouble k = new DoubleDouble(a); // The value by which to multiply all results of normalized projection.
if (a != b) {
- /*
- * (1) Using axis lengths: \u212f� = 1 - (b/a)�
- * (2) Using flattening; \u212f� = 2f - f� where f is the (NOT inverse) flattening factor.
- *
- * If the inverse flattening factor is the definitive factor for the ellipsoid, we use (2).
- * Otherwise use (1). With double-double arithmetic, this makes a difference in the 3 last
- * digits for the WGS84 ellipsoid.
- */
- boolean isIvfDefinitive;
- try {
- isIvfDefinitive = parameters.parameter(Constants.IS_IVF_DEFINITIVE).booleanValue();
- } catch (ParameterNotFoundException e) {
- /*
- * Should never happen with Apache SIS implementation, but may happen if the given parameters come
- * from another implementation. We can safely abandon our attempt to get the inverse flattening value,
- * since it was redundant with semi-minor axis length.
- */
- isIvfDefinitive = false;
- }
- /*
- * The ellipsoid parameters (a, b or ivf) are assumed accurate in base 10 rather than in base 2,
- * because they are defined by authorities. For example the semi-major axis length of the WGS84
- * ellipsoid is equal to exactly 6378137 metres by definition of that ellipsoid. The DoubleDouble
- * constructor applies corrections for making those values more accurate in base 10 rather than 2.
- */
- if (isIvfDefinitive) {
- final DoubleDouble f = new DoubleDouble(parameters.parameter(Constants.INVERSE_FLATTENING).doubleValue());
- f.inverseDivide(1,0);
- eccentricitySquared.setFrom(f);
- eccentricitySquared.multiply(2,0);
- f.square();
- eccentricitySquared.subtract(f);
+ if (variant == AUTHALIC_RADIUS) {
+ k.value = Formulas.getAuthalicRadius(a, b);
+ k.error = 0;
} else {
- final DoubleDouble rs = new DoubleDouble(b);
- rs.divide(k); // rs = b/a
- rs.square();
- eccentricitySquared.value = 1;
- eccentricitySquared.subtract(rs);
- }
- final ParameterDescriptor<? extends Number> radius = roles.get(ParameterRole.LATITUDE_OF_CONFORMAL_SPHERE_RADIUS);
- if (radius != null) {
/*
- * EPSG said: R is the radius of the sphere and will normally be one of the CRS parameters.
- * If the figure of the earth used is an ellipsoid rather than a sphere then R should be calculated
- * as the radius of the conformal sphere at the projection origin at latitude \u03c6\u2080 using the formula
- * for Rc given in section 1.2, table 3.
- *
- * Table 3 gives:
- * Radius of conformal sphere Rc = a \u221a(1 \u2013 \u212f�) / (1 \u2013 \u212f�\u22c5sin�\u03c6)
- *
- * Using \u221a(1 \u2013 \u212f�) = b/a we rewrite as: Rc = b / (1 \u2013 \u212f�\u22c5sin�\u03c6)
+ * (1) Using axis lengths: \u212f� = 1 - (b/a)�
+ * (2) Using flattening; \u212f� = 2f - f� where f is the (NOT inverse) flattening factor.
*
- * Equivalent Java code:
- *
- * final double sin\u03c6 = sin(toRadians(parameters.doubleValue(radius)));
- * k = b / (1 - eccentricitySquared * (sin\u03c6*sin\u03c6));
+ * If the inverse flattening factor is the definitive factor for the ellipsoid, we use (2).
+ * Otherwise use (1). With double-double arithmetic, this makes a difference in the 3 last
+ * digits for the WGS84 ellipsoid.
+ */
+ boolean isIvfDefinitive;
+ try {
+ isIvfDefinitive = parameters.parameter(Constants.IS_IVF_DEFINITIVE).booleanValue();
+ } catch (ParameterNotFoundException e) {
+ /*
+ * Should never happen with Apache SIS implementation, but may happen if the given parameters come
+ * from another implementation. We can safely abandon our attempt to get the inverse flattening value,
+ * since it was redundant with semi-minor axis length.
+ */
+ isIvfDefinitive = false;
+ }
+ /*
+ * The ellipsoid parameters (a, b or ivf) are assumed accurate in base 10 rather than in base 2,
+ * because they are defined by authorities. For example the semi-major axis length of the WGS84
+ * ellipsoid is equal to exactly 6378137 metres by definition of that ellipsoid. The DoubleDouble
+ * constructor applies corrections for making those values more accurate in base 10 rather than 2.
*/
- k = r\u03bd2(sin(toRadians(parameters.doubleValue(radius))));
- k.inverseDivide(b, 0);
+ if (isIvfDefinitive) {
+ final DoubleDouble f = new DoubleDouble(parameters.parameter(Constants.INVERSE_FLATTENING).doubleValue());
+ f.inverseDivide(1,0);
+ eccentricitySquared.setFrom(f);
+ eccentricitySquared.multiply(2,0);
+ f.square();
+ eccentricitySquared.subtract(f);
+ } else {
+ final DoubleDouble rs = new DoubleDouble(b);
+ rs.divide(k); // rs = b/a
+ rs.square();
+ eccentricitySquared.value = 1;
+ eccentricitySquared.subtract(rs);
+ }
+ final ParameterDescriptor<? extends Number> radius = roles.get(ParameterRole.LATITUDE_OF_CONFORMAL_SPHERE_RADIUS);
+ if (radius != null) {
+ /*
+ * EPSG said: R is the radius of the sphere and will normally be one of the CRS parameters.
+ * If the figure of the earth used is an ellipsoid rather than a sphere then R should be calculated
+ * as the radius of the conformal sphere at the projection origin at latitude \u03c6\u2080 using the formula
+ * for Rc given in section 1.2, table 3.
+ *
+ * Table 3 gives:
+ * Radius of conformal sphere Rc = a \u221a(1 \u2013 \u212f�) / (1 \u2013 \u212f�\u22c5sin�\u03c6)
+ *
+ * Using \u221a(1 \u2013 \u212f�) = b/a we rewrite as: Rc = b / (1 \u2013 \u212f�\u22c5sin�\u03c6)
+ *
+ * Equivalent Java code:
+ *
+ * final double sin\u03c6 = sin(toRadians(parameters.doubleValue(radius)));
+ * k = b / (1 - eccentricitySquared * (sin\u03c6*sin\u03c6));
+ */
+ k = r\u03bd2(sin(toRadians(parameters.doubleValue(radius))));
+ k.inverseDivide(b, 0);
+ }
}
}
/*
@@ -239,7 +258,7 @@ final class Initializer {
final Number defaultValue = descriptor.getDefaultValue();
if (defaultValue == null || !defaultValue.equals(value)) {
MapProjection.validate(descriptor, value);
- context.parameter(descriptor.getName().getCode()).setValue(value);
+ context.getOrCreate(descriptor).setValue(value);
}
return value;
}
@@ -255,7 +274,7 @@ final class Initializer {
return defaultValue;
}
MapProjection.validate(descriptor, value);
- context.parameter(descriptor.getName().getCode()).setValue(value);
+ context.getOrCreate(descriptor).setValue(value);
return value;
}
@@ -291,8 +310,8 @@ final class Initializer {
* (otherwise we get {@link Double#NaN}).</li>
* </ul>
*
- * @param sin\u03c6 The sine of the \u03c6 latitude.
- * @return Reciprocal squared of the radius of curvature of the ellipsoid
+ * @param sin\u03c6 the sine of the \u03c6 latitude.
+ * @return reciprocal squared of the radius of curvature of the ellipsoid
* perpendicular to the meridian at latitude \u03c6.
*/
private DoubleDouble r\u03bd2(final double sin\u03c6) {
@@ -321,8 +340,8 @@ final class Initializer {
* the use of \u03c6\u2080 (or \u03c6\u2081 as relevant to method) for \u03c6 is suggested, except if the projection is
* equal area when the radius of authalic sphere should be used.
*
- * @param sin\u03c6 The sine of the \u03c6 latitude.
- * @return Radius of the conformal sphere at latitude \u03c6.
+ * @param sin\u03c6 the sine of the \u03c6 latitude.
+ * @return radius of the conformal sphere at latitude \u03c6.
*/
final double radiusOfConformalSphere(final double sin\u03c6) {
final DoubleDouble Rc = verbatim(1);
@@ -340,9 +359,9 @@ final class Initializer {
* The result is returned as a {@code double} because the limited precision of {@code sin\u03c6} and {@code cos\u03c6}
* makes the error term meaningless. We use double-double arithmetic only for intermediate calculation.
*
- * @param sin\u03c6 The sine of the \u03c6 latitude.
- * @param cos\u03c6 The cosine of the \u03c6 latitude.
- * @return Scale factor at latitude \u03c6.
+ * @param sin\u03c6 the sine of the \u03c6 latitude.
+ * @param cos\u03c6 the cosine of the \u03c6 latitude.
+ * @return scale factor at latitude \u03c6.
*/
final double scaleAt\u03c6(final double sin\u03c6, final double cos\u03c6) {
final DoubleDouble s = r\u03bd2(sin\u03c6);
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/Mercator.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -95,8 +95,8 @@ public class Mercator extends ConformalP
*
* @see #getVariant(OperationMethod)
*/
- private static final byte SPHERICAL = 1, PSEUDO = 3, // Must be odd and SPHERICAL must be 1.
- REGIONAL = 2, MILLER = 4; // Must be even.
+ private static final byte SPHERICAL = 1, PSEUDO = 3, // Must be odd and SPHERICAL must be 1.
+ REGIONAL = 2, MILLER = 4; // Must be even.
/**
* Returns the variant of the projection based on the name and identifier of the given operation method.
@@ -291,7 +291,7 @@ public class Mercator extends ConformalP
if (\u03c60 == 0 && isPositive(\u03c61 != 0 ? \u03c61 : \u03c60)) {
final Number reverseSign = verbatim(-1);
normalize .convertBefore(1, reverseSign, null);
- denormalize.convertBefore(1, reverseSign, null); // Must be before false easting/northing.
+ denormalize.convertBefore(1, reverseSign, null); // Must be before false easting/northing.
}
}
@@ -354,7 +354,7 @@ public class Mercator extends ConformalP
// about why we perform explicit checks for the pole cases.
final double a = abs(\u03c6);
if (a < PI/2) {
- y = log(expOfNorthing(\u03c6, eccentricity * sin\u03c6)); // Snyder (7-7)
+ y = log(expOfNorthing(\u03c6, eccentricity * sin\u03c6)); // Snyder (7-7)
} else if (a <= (PI/2 + ANGULAR_TOLERANCE)) {
y = copySign(POSITIVE_INFINITY, \u03c6);
} else {
@@ -390,7 +390,7 @@ public class Mercator extends ConformalP
} else {
dstOff--;
while (--numPts >= 0) {
- final double \u03c6 = dstPts[dstOff += 2]; // Same as srcPts[srcOff + 1].
+ final double \u03c6 = dstPts[dstOff += 2]; // Same as srcPts[srcOff + 1].
if (\u03c6 != 0) {
// See the javadoc of the Spherical inner class for a note
// about why we perform explicit checks for the pole cases.
@@ -420,8 +420,8 @@ public class Mercator extends ConformalP
final double[] dstPts, final int dstOff)
throws ProjectionException
{
- final double y = srcPts[srcOff+1]; // Must be before writing x.
- dstPts[dstOff ] = srcPts[srcOff ]; // Must be before writing y.
+ final double y = srcPts[srcOff+1]; // Must be before writing x.
+ dstPts[dstOff ] = srcPts[srcOff ]; // Must be before writing y.
dstPts[dstOff+1] = \u03c6(exp(-y));
}
@@ -488,7 +488,7 @@ public class Mercator extends ConformalP
// See class javadoc for a note about explicit check for poles.
final double a = abs(\u03c6);
if (a < PI/2) {
- y = log(tan(PI/4 + 0.5*\u03c6)); // Part of Snyder (7-2)
+ y = log(tan(PI/4 + 0.5*\u03c6)); // Part of Snyder (7-2)
} else if (a <= (PI/2 + ANGULAR_TOLERANCE)) {
y = copySign(POSITIVE_INFINITY, \u03c6);
} else {
@@ -518,13 +518,13 @@ public class Mercator extends ConformalP
} else {
dstOff--;
while (--numPts >= 0) {
- final double \u03c6 = dstPts[dstOff += 2]; // Same as srcPts[srcOff + 1].
+ final double \u03c6 = dstPts[dstOff += 2]; // Same as srcPts[srcOff + 1].
if (\u03c6 != 0) {
// See class javadoc for a note about explicit check for poles.
final double a = abs(\u03c6);
final double y;
if (a < PI/2) {
- y = log(tan(PI/4 + 0.5*\u03c6)); // Part of Snyder (7-2)
+ y = log(tan(PI/4 + 0.5*\u03c6)); // Part of Snyder (7-2)
} else if (a <= (PI/2 + ANGULAR_TOLERANCE)) {
y = copySign(POSITIVE_INFINITY, \u03c6);
} else {
@@ -544,9 +544,9 @@ public class Mercator extends ConformalP
final double[] dstPts, final int dstOff)
throws ProjectionException
{
- final double y = srcPts[srcOff+1]; // Must be before writing x.
- dstPts[dstOff ] = srcPts[srcOff]; // Must be before writing y.
- dstPts[dstOff+1] = PI/2 - 2*atan(exp(-y)); // Part of Snyder (7-4);
+ final double y = srcPts[srcOff+1]; // Must be before writing x.
+ dstPts[dstOff ] = srcPts[srcOff]; // Must be before writing y.
+ dstPts[dstOff+1] = PI/2 - 2*atan(exp(-y)); // Part of Snyder (7-4);
}
}
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/PolarStereographic.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -113,7 +113,6 @@ public class PolarStereographic extends
* Work around for RFE #4093999 in Sun's bug database
* ("Relax constraint on placement of this()/super() call in constructors").
*/
- @SuppressWarnings("fallthrough")
@Workaround(library="JDK", version="1.7")
private static Initializer initializer(final OperationMethod method, final Parameters parameters) {
final byte variant = getVariant(method);
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/package-info.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -160,7 +160,7 @@
* @author R�mi Mar�chal (Geomatys)
* @author Adrian Custer (Geomatys)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*
* @see <a href="http://www.remotesensing.org/geotiff/proj_list">Projections list on RemoteSensing.org</a>
Modified: sis/trunk/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/resources/META-INF/services/org.opengis.referencing.operation.OperationMethod [UTF-8] Mon Jul 18 17:47:22 2016
@@ -27,6 +27,8 @@ org.apache.sis.internal.referencing.prov
org.apache.sis.internal.referencing.provider.PseudoMercator
org.apache.sis.internal.referencing.provider.RegionalMercator
org.apache.sis.internal.referencing.provider.MillerCylindrical
+org.apache.sis.internal.referencing.provider.LambertCylindricalEqualArea
+org.apache.sis.internal.referencing.provider.LambertCylindricalEqualAreaSpherical
org.apache.sis.internal.referencing.provider.LambertConformal1SP
org.apache.sis.internal.referencing.provider.LambertConformal2SP
org.apache.sis.internal.referencing.provider.LambertConformalWest
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/internal/referencing/provider/ProvidersTest.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -37,7 +37,7 @@ import static org.junit.Assert.*;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*/
@DependsOn({
@@ -79,6 +79,8 @@ public final strictfp class ProvidersTes
PseudoMercator.class,
RegionalMercator.class,
MillerCylindrical.class,
+ LambertCylindricalEqualArea.class,
+ LambertCylindricalEqualAreaSpherical.class,
LambertConformal1SP.class,
LambertConformal2SP.class,
LambertConformalWest.class,
Copied: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java (from r1753266, sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java)
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java?p2=sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java&p1=sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java&r1=1753266&r2=1753294&rev=1753294&view=diff
==============================================================================
--- sis/branches/JDK6/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/CylindricalEqualAreaTest.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -18,7 +18,6 @@ package org.apache.sis.referencing.opera
import org.opengis.util.FactoryException;
import org.opengis.referencing.operation.TransformException;
-import org.opengis.test.ToleranceModifier;
import org.apache.sis.internal.referencing.Formulas;
import org.apache.sis.internal.referencing.provider.LambertCylindricalEqualArea;
import org.apache.sis.internal.referencing.provider.LambertCylindricalEqualAreaSpherical;
@@ -71,7 +70,6 @@ public final strictfp class CylindricalE
public void testEllipsoidal() throws FactoryException, TransformException {
createCompleteProjection(true, 0, 0);
tolerance = Formulas.LINEAR_TOLERANCE;
- toleranceModifier = ToleranceModifier.PROJECTION;
final double \u03bb = 2;
final double \u03c6 = 1;
final double x = 222638.98; // Test point from Proj.4.
@@ -92,7 +90,6 @@ public final strictfp class CylindricalE
public void testSpherical() throws FactoryException, TransformException {
createCompleteProjection(false, 0, 0);
tolerance = Formulas.LINEAR_TOLERANCE;
- toleranceModifier = ToleranceModifier.PROJECTION;
final double \u03bb = 2;
final double \u03c6 = 1;
final double x = 222390.10; // Anti-regression values (not from an external source).
@@ -116,7 +113,6 @@ public final strictfp class CylindricalE
public void testSphericalWithConformalSphereRadius() throws FactoryException, TransformException {
createCompleteProjection(new LambertCylindricalEqualAreaSpherical(), true, 0, 0, 0, 1, 0, 0);
tolerance = Formulas.LINEAR_TOLERANCE;
- toleranceModifier = ToleranceModifier.PROJECTION;
final double \u03bb = 2;
final double \u03c6 = 1;
final double x = 222390.10; // Anti-regression values (not from an external source).
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/projection/MercatorTest.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -127,7 +127,7 @@ public final strictfp class MercatorTest
/**
* Tests the projection at some special latitudes (0, �\u03c0/2, NaN).
*
- * @throws ProjectionException Should never happen.
+ * @throws ProjectionException if an error occurred while projecting a point.
*/
@Test
public void testSpecialLatitudes() throws ProjectionException {
@@ -157,7 +157,7 @@ public final strictfp class MercatorTest
* Tests the derivatives at a few points. This method compares the derivatives computed by
* the projection with an estimation of derivatives computed by the finite differences method.
*
- * @throws TransformException Should never happen.
+ * @throws TransformException if an error occurred while projecting a point.
*/
@Test
@DependsOnMethod("testSpecialLatitudes")
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransformTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransformTest.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransformTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/InterpolatedMolodenskyTransformTest.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -115,8 +115,8 @@ public final strictfp class Interpolated
" Param_MT[\u201cMolodensky inverse interpolation (radians domain)\u201d,\n" +
" Parameter[\u201csrc_semi_major\u201d, 6378249.2],\n" +
" Parameter[\u201csrc_semi_minor\u201d, 6356515.0],\n" +
- " Parameter[\u201cSemi-major axis length difference\u201d, -112.2],\n" +
- " Parameter[\u201cFlattening difference\u201d, -5.4738838833299144E-5],\n" +
+ " Parameter[\u201cSemi-major axis length difference\u201d, -112.2, Id[\u201cEPSG\u201d, 8654]],\n" +
+ " Parameter[\u201cFlattening difference\u201d, -5.4738838833299144E-5, Id[\u201cEPSG\u201d, 8655]],\n" +
" ParameterFile[\u201cGeocentric translation file\u201d, \u201c\\E.*\\W\\Q" +
FranceGeocentricInterpolationTest.TEST_FILE + "\u201d, Id[\u201cEPSG\u201d, 8727],\n" +
" Remark[\u201c\\E.*\\Q\u201d]],\n" +
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MathTransformTestCase.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -181,7 +181,7 @@ public abstract strictfp class MathTrans
final float[] asFloats = Numerics.copyAsFloats(coordinates);
final float[] result = verifyConsistency(asFloats);
for (int i=0; i<coordinates.length; i++) {
- assertEquals("Detected change in source coordinates.", (float) coordinates[i], asFloats[i], 0f); // Paranoiac check.
+ assertEquals("Detected change in source coordinates.", (float) coordinates[i], asFloats[i], 0f); // Paranoiac check.
}
/*
* The comparison below needs a higher tolerance threshold, because we converted the source
@@ -195,7 +195,7 @@ public abstract strictfp class MathTrans
for (int i=0; i<expected.length; i++) {
final double e = expected[i];
double tol = 1E-6 * abs(e);
- if (!(tol > tolerance)) { // Use '!' for replacing NaN by 'tolerance'.
+ if (!(tol > tolerance)) { // Use '!' for replacing NaN by 'tolerance'.
tol = tolerance;
}
assertEquals(e, result[i], tol);
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/operation/transform/MolodenskyTransformTest.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -302,11 +302,11 @@ public final strictfp class MolodenskyTr
" Param_MT[\u201cMolodensky (radians domain)\u201d,\n" +
" Parameter[\u201csrc_semi_major\u201d, 6378137.0],\n" +
" Parameter[\u201csrc_semi_minor\u201d, 6356752.314245179],\n" +
- " Parameter[\u201cSemi-major axis length difference\u201d, 251.0],\n" +
- " Parameter[\u201cFlattening difference\u201d, 1.4192702255886284E-5],\n" +
- " Parameter[\u201cX-axis translation\u201d, 84.87],\n" +
- " Parameter[\u201cY-axis translation\u201d, 96.49],\n" +
- " Parameter[\u201cZ-axis translation\u201d, 116.95],\n" +
+ " Parameter[\u201cSemi-major axis length difference\u201d, 251.0, Id[\u201cEPSG\u201d, 8654]],\n" +
+ " Parameter[\u201cFlattening difference\u201d, 1.4192702255886284E-5, Id[\u201cEPSG\u201d, 8655]],\n" +
+ " Parameter[\u201cX-axis translation\u201d, 84.87, Id[\u201cEPSG\u201d, 8605]],\n" +
+ " Parameter[\u201cY-axis translation\u201d, 96.49, Id[\u201cEPSG\u201d, 8606]],\n" +
+ " Parameter[\u201cZ-axis translation\u201d, 116.95, Id[\u201cEPSG\u201d, 8607]],\n" +
" Parameter[\u201cabridged\u201d, TRUE],\n" +
" Parameter[\u201cdim\u201d, 3]],\n" +
" Param_MT[\u201cAffine\u201d,\n" +
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/CoordinateOperationMethods.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -66,7 +66,7 @@ import org.opengis.referencing.Reference
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.7
+ * @version 0.8
* @module
*/
public strictfp class CoordinateOperationMethods extends HTMLGenerator {
@@ -165,7 +165,7 @@ public strictfp class CoordinateOperatio
* @throws IOException if an error occurred while writing to the file.
*/
public CoordinateOperationMethods() throws IOException {
- super("CoordinateOperationMethods.html", "Apache SIS Coordinate Operation Methods");
+ super("CoordinateOperationMethods.html", "Apache SIS Coordinate Operation Methods", "authority-codes.css");
domainOfValidity = Collections.emptyMap(); // TODO: not yet available.
rangeFormat = new RangeFormat(LOCALE);
final int header = openTag("header");
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/HTMLGenerator.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -83,11 +83,12 @@ abstract strictfp class HTMLGenerator im
* Creates a new instance which will write in the given file.
* This constructor immediately writes the HTML header up to the {@code <body>} line, inclusive.
*
- * @param filename The name of the file where to write.
- * @param title The document title.
+ * @param filename the name of the file where to write.
+ * @param title the document title.
+ * @param path path to the CSS file.
* @throws IOException if the file can not be created (e.g. because it already exists).
*/
- HTMLGenerator(final String filename, final String title) throws IOException {
+ HTMLGenerator(final String filename, final String title, final String css) throws IOException {
final File file = new File(filename);
if (file.exists()) {
throw new IOException("File " + file.getAbsolutePath() + " already exists.");
@@ -112,7 +113,11 @@ abstract strictfp class HTMLGenerator im
out.newLine();
println("title", title);
openTag("style type=\"text/css\" media=\"all\"");
- println("@import url(\"../tables.css\");");
+ out.write(margin);
+ out.write("@import url(\"");
+ out.write(css);
+ out.write("\");");
+ out.newLine();
closeTags(head);
openTag("body");
}
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/package-info.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/package-info.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/package-info.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/referencing/report/package-info.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -23,7 +23,7 @@
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.7
- * @version 0.7
+ * @version 0.8
* @module
*/
package org.apache.sis.referencing.report;
Modified: sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java?rev=1753294&r1=1753293&r2=1753294&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/test/java/org/apache/sis/test/suite/ReferencingTestSuite.java [UTF-8] Mon Jul 18 17:47:22 2016
@@ -164,6 +164,7 @@ import org.junit.BeforeClass;
org.apache.sis.referencing.operation.projection.TransverseMercatorTest.class,
org.apache.sis.referencing.operation.projection.PolarStereographicTest.class,
org.apache.sis.referencing.operation.projection.ObliqueStereographicTest.class,
+ org.apache.sis.referencing.operation.projection.CylindricalEqualAreaTest.class,
// Coordinate operation and derived Coordinate Reference Systems (cyclic dependency).
org.apache.sis.referencing.operation.DefaultTransformationTest.class,