Author: desruisseaux
Date: Mon Mar 23 16:40:45 2015
New Revision: 1668681
URL: http://svn.apache.org/r1668681
Log:
Referencing: added parameter declaration for the "Mercator (variant B)" case.
Modified:
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/UnitaryProjection.java
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
Modified:
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java?rev=1668681&r1=1668680&r2=1668681&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
[UTF-8] (original)
+++
sis/branches/JDK8/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/citation/Citations.java
[UTF-8] Mon Mar 23 16:40:45 2015
@@ -160,6 +160,16 @@ public final class Citations extends Sta
public static final IdentifierSpace<Integer> MAP_INFO = new
Authority<>("MapInfo", "MapInfo");
/**
+ * The <a
href="http://www.iho.int/iho_pubs/standard/S-57Ed3.1/31Main.pdf">IHO transfer
standard
+ * for digital hydrographic data</a> specification.
+ *
+ * @category Code space
+ *
+ * @since 0.6
+ */
+ public static final IdentifierSpace<Integer> S57 = new Authority<>("S-57",
"S57");
+
+ /**
* <cite>International Standard Book Number</cite> (ISBN) defined by
ISO-2108.
* The ISO-19115 metadata standard defines a specific attribute for this
information,
* but the SIS library handles it like any other identifier.
@@ -185,7 +195,7 @@ public final class Citations extends Sta
* List of citations declared in this class.
*/
private static final Citation[] CITATIONS = {
- ISO, OGC, OGP, EPSG, SIS, ESRI, ORACLE, NETCDF, GEOTIFF, PROJ4,
MAP_INFO, ISBN, ISSN
+ ISO, OGC, OGP, EPSG, SIS, ESRI, ORACLE, NETCDF, GEOTIFF, PROJ4,
MAP_INFO, S57, ISBN, ISSN
};
/**
Modified:
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java?rev=1668681&r1=1668680&r2=1668681&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
[UTF-8] (original)
+++
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/MapProjection.java
[UTF-8] Mon Mar 23 16:40:45 2015
@@ -18,7 +18,13 @@ package org.apache.sis.internal.referenc
import java.util.Map;
import java.util.HashMap;
+import java.util.NoSuchElementException;
import javax.measure.unit.SI;
+import org.opengis.util.InternationalString;
+import org.opengis.metadata.Identifier;
+import org.opengis.metadata.citation.Citation;
+import org.opengis.parameter.ParameterDescriptor;
+import org.opengis.parameter.GeneralParameterDescriptor;
import org.opengis.util.GenericName;
import org.opengis.parameter.ParameterValueGroup;
import org.opengis.parameter.ParameterDescriptorGroup;
@@ -30,6 +36,8 @@ import org.apache.sis.measure.Measuremen
import org.apache.sis.referencing.NamedIdentifier;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.parameter.DefaultParameterDescriptor;
+import org.apache.sis.parameter.ParameterBuilder;
+import org.apache.sis.util.resources.Messages;
import static org.opengis.metadata.Identifier.AUTHORITY_KEY;
@@ -125,4 +133,50 @@ public abstract class MapProjection exte
*/
@Override
public abstract MathTransform2D createMathTransform(ParameterValueGroup
values) throws ParameterNotFoundException;
+
+ /**
+ * Returns the name of the given authority declared in the given parameter
descriptor.
+ * This method is used only as a way to avoid creating many instances of
the same name.
+ */
+ static GenericName sameNameAs(final Citation authority, final
GeneralParameterDescriptor parameters) {
+ for (final GenericName candidate : parameters.getAlias()) {
+ if (((Identifier) candidate).getAuthority() == authority) {
+ return candidate;
+ }
+ }
+ throw new NoSuchElementException();
+ }
+
+ /**
+ * Copies the names and identifiers from the given parameter into the
builder.
+ * This is used for sharing name instances created for an other operation.
+ *
+ * The given {@code esri} and {@code netcdf} parameters will be inserted
after the OGC name.
+ */
+ static ParameterBuilder withEsriAndNetcdf(final ParameterDescriptor<?>
source, final ParameterBuilder builder,
+ final String esri, final String netcdf)
+ {
+ for (final Identifier identifier : source.getIdentifiers()) {
+ builder.addIdentifier(identifier);
+ }
+ builder.addName(source.getName());
+ for (final GenericName alias : source.getAlias()) {
+ builder.addName(alias);
+ if (((Identifier) alias).getAuthority() == Citations.OGC) {
+ builder.addName(Citations.ESRI, esri)
+ .addName(Citations.NETCDF, netcdf);
+ }
+ }
+ return builder;
+ }
+
+ /**
+ * 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.
+ * @param usedIn The name of the projection where we also use that
parameter.
+ */
+ static InternationalString notFormallyEPSG(final String origin, final
String usedIn) {
+ return
Messages.formatInternational(Messages.Keys.NotFormallyAnEpsgParameter_2,
origin, usedIn);
+ }
}
Modified:
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java?rev=1668681&r1=1668680&r2=1668681&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
[UTF-8] (original)
+++
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
[UTF-8] Mon Mar 23 16:40:45 2015
@@ -45,59 +45,39 @@ public final class Mercator1SP extends M
private static final long serialVersionUID = -5886510621481710072L;
/**
- * The operation parameter descriptor for the {@linkplain
- *
org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#centralMeridian
- * central meridian} parameter value.
- *
- * This parameter is mandatory.
- * Valid values range is [-180 … 180]° and default value is 0°.
+ * The operation parameter descriptor for the <cite>Latitude of natural
origin</cite> parameter value.
+ * Valid values range is (-90 … 90)° and default value is 0°.
*/
- public static final ParameterDescriptor<Double> CENTRAL_MERIDIAN;
+ static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
/**
- * The operation parameter descriptor for the {@linkplain
- *
org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#latitudeOfOrigin
- * latitude of origin} parameter value.
- *
- * This parameter is mandatory.
- * Valid values range is [-90 … 90]° and default value is 0°.
+ * The operation parameter descriptor for the <cite>Longitude of natural
origin</cite> parameter value.
+ * Valid values range is [-180 … 180]° and default value is 0°.
*/
- public static final ParameterDescriptor<Double> LATITUDE_OF_ORIGIN;
+ static final ParameterDescriptor<Double> CENTRAL_MERIDIAN;
/**
- * The operation parameter descriptor for the {@linkplain
- *
org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#scaleFactor
- * scale factor} parameter value.
- *
- * This parameter is mandatory.
+ * The operation parameter descriptor for the <cite>Scale factor at
natural origin</cite> parameter value.
* Valid values range is (0 … ∞) and default value is 1.
*/
- public static final ParameterDescriptor<Double> SCALE_FACTOR;
+ static final ParameterDescriptor<Double> SCALE_FACTOR;
/**
- * The operation parameter descriptor for the {@linkplain
- *
org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#falseEasting
- * false easting} parameter value.
- *
- * This parameter is mandatory.
+ * The operation parameter descriptor for the <cite>False easting</cite>
parameter value.
* Valid values range is unrestricted and default value is 0 metre.
*/
- public static final ParameterDescriptor<Double> FALSE_EASTING;
+ static final ParameterDescriptor<Double> FALSE_EASTING;
/**
- * The operation parameter descriptor for the {@linkplain
- *
org.apache.sis.referencing.operation.projection.UnitaryProjection.Parameters#falseNorthing
- * false northing} parameter value.
- *
- * This parameter is mandatory.
+ * The operation parameter descriptor for the <cite>False northing</cite>
parameter value.
* Valid values range is unrestricted and default value is 0 metre.
*/
- public static final ParameterDescriptor<Double> FALSE_NORTHING;
+ static final ParameterDescriptor<Double> FALSE_NORTHING;
/**
* The group of all parameters expected by this coordinate operation.
*/
- private static final ParameterDescriptorGroup PARAMETERS;
+ public static final ParameterDescriptorGroup PARAMETERS;
static {
final ParameterBuilder builder = builder();
@@ -150,8 +130,12 @@ public final class Mercator1SP extends M
.addIdentifier(Citations.GEOTIFF, "7")
.addIdentifier(Citations.MAP_INFO, "10")
.addIdentifier(Citations.MAP_INFO, "26")
- .createGroupForMapProjection(LATITUDE_OF_ORIGIN, CENTRAL_MERIDIAN,
- SCALE_FACTOR, FALSE_EASTING, FALSE_NORTHING);
+ .createGroupForMapProjection(
+ LATITUDE_OF_ORIGIN,
+ CENTRAL_MERIDIAN,
+ SCALE_FACTOR,
+ FALSE_EASTING,
+ FALSE_NORTHING);
}
/**
@@ -178,6 +162,6 @@ public final class Mercator1SP extends M
*/
@Override
public MathTransform2D createMathTransform(ParameterValueGroup values) {
- return null; // TODO Mercator.create(getParameters(), values);
+ return null; // TODO Mercator.create(this, values);
}
}
Modified:
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/UnitaryProjection.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/UnitaryProjection.java?rev=1668681&r1=1668680&r2=1668681&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/UnitaryProjection.java
[UTF-8] (original)
+++
sis/branches/JDK8/core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/projection/UnitaryProjection.java
[UTF-8] Mon Mar 23 16:40:45 2015
@@ -201,6 +201,16 @@ public abstract class UnitaryProjection
}
/**
+ * Returns {@code true} if this projection is done on a sphere rather than
an ellipsoid.
+ * Projections on spheres have an {@linkplain #excentricity} equals to
zero.
+ *
+ * @return {@code true} if this projection is on a sphere.
+ */
+ public final boolean isSpherical() {
+ return excentricity == 0;
+ }
+
+ /**
* Converts a single coordinate in {@code srcPts} at the given offset and
stores the result
* in {@code dstPts} at the given offset. In addition, opportunistically
computes the
* transform derivative if requested.
@@ -323,16 +333,6 @@ public abstract class UnitaryProjection
}
/**
- * Returns {@code true} if this class is a {@code Spherical} nested class.
- * This information is used sometime for selecting formulas, and for
testing purpose.
- *
- * This method is not public because the usage of those nested classes is
specific to Apache SIS implementation.
- */
- boolean isSpherical() {
- return false;
- }
-
- /**
* Computes a hash code value for this unitary projection.
* The default implementation computes a value from the parameters given
at construction time.
*
Modified:
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java?rev=1668681&r1=1668680&r2=1668681&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
[UTF-8] (original)
+++
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.java
[UTF-8] Mon Mar 23 16:40:45 2015
@@ -98,6 +98,11 @@ public final class Messages extends Inde
public static final short MismatchedEllipsoidAxisLength_3 = 9;
/**
+ * This parameter from the “{0}” projection is not formally a
parameter of “{1}” projection.
+ */
+ public static final short NotFormallyAnEpsgParameter_2 = 10;
+
+ /**
* Property “{0}” is hidden by “{1}”.
*/
public static final short PropertyHiddenBy_2 = 4;
Modified:
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties?rev=1668681&r1=1668680&r2=1668681&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
[ISO-8859-1] (original)
+++
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages.properties
[ISO-8859-1] Mon Mar 23 16:40:45 2015
@@ -23,4 +23,5 @@ IgnoredPropertyAssociatedTo_1 = Ignore
PropertyHiddenBy_2 = Property \u201c{0}\u201d is hidden by
\u201c{1}\u201d.
LocalesDiscarded = Text were discarded for some locales.
MismatchedEllipsoidAxisLength_3 = The \u201c{1}\u201d parameter could have
been omitted. But it has been given a value of {2} which does not match the
definition of the \u201c{0}\u201d ellipsoid.
+NotFormallyAnEpsgParameter_2 = This parameter from the \u201c{0}\u201d
projection is not formally a parameter of \u201c{1}\u201d projection.
UnparsableValueStoredAsText_2 = Can not parse \u201c{1}\u201d as an instance
of \u2018{0}\u2019. The value is stored as plain text instead, but will be
ignored by some processing.
Modified:
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties?rev=1668681&r1=1668680&r2=1668681&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
[ISO-8859-1] (original)
+++
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Messages_fr.properties
[ISO-8859-1] Mon Mar 23 16:40:45 2015
@@ -22,5 +22,6 @@ IgnoredPropertiesAfterFirst_1 = Des pr
IgnoredPropertyAssociatedTo_1 = Une propri\u00e9t\u00e9 associ\u00e9e \u00e0
\u2018{0}\u2019 a \u00e9t\u00e9 ignor\u00e9e.
PropertyHiddenBy_2 = La propri\u00e9t\u00e9
\u00ab\u202f{0}\u202f\u00bb est masqu\u00e9e par \u00ab\u202f{1}\u202f\u00bb.
LocalesDiscarded = Des textes ont \u00e9t\u00e9 ignor\u00e9s
pour certaines langues.
-MismatchedEllipsoidAxisLength_3 = Le param\u00e8tre
\u00ab\u202f{1}\u202f\u00bb aurait pu \u00eatre omis. Mais il lui a
\u00e9t\u00e9 donn\u00e9 la valeur {2} qui ne correspond pas \u00e0 la
d\u00e9finition de l'ellipso\u00efde \u00ab\u202f{0}\u202f\u00bb.
+MismatchedEllipsoidAxisLength_3 = Le param\u00e8tre
\u00ab\u202f{1}\u202f\u00bb aurait pu \u00eatre omis. Mais il lui a
\u00e9t\u00e9 donn\u00e9 la valeur {2} qui ne correspond pas \u00e0 la
d\u00e9finition de l\u2019ellipso\u00efde \u00ab\u202f{0}\u202f\u00bb.
+NotFormallyAnEpsgParameter_2 = Ce param\u00e8tre de la projection
\u00ab\u202f{0}\u202f\u00bb n\u2019est pas formellement un param\u00e8tre de la
projection \u00ab\u202f{1}\u202f\u00bb.
UnparsableValueStoredAsText_2 = La valeur \u00ab\u202f{1}\u202f\u00bb ne
peut pas \u00eatre interpr\u00e9t\u00e9e comme une instance de \u2018{0}\u2019.
Elle est donc m\u00e9moris\u00e9e sous sa forme textuelle, mais sera
ignor\u00e9e par certains traitements.
Modified:
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
URL:
http://svn.apache.org/viewvc/sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties?rev=1668681&r1=1668680&r2=1668681&view=diff
==============================================================================
---
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] (original)
+++
sis/branches/JDK8/core/sis-utility/src/main/java/org/apache/sis/util/resources/Vocabulary_fr.properties
[ISO-8859-1] Mon Mar 23 16:40:45 2015
@@ -66,7 +66,7 @@ NumberOfNaN = Nombre de \u20
Obligation = Obligation
Of_3 = {0} ({1} de {2})
Offset = D\u00e9calage
-OperatingSystem = Syst\u00e8me d'exploitation
+OperatingSystem = Syst\u00e8me d\u2019exploitation
Optional = Optionnel
Options = Options
Others = Autres
@@ -91,7 +91,7 @@ Unnamed = Sans nom
Untitled = Sans titre
UnavailableContent = Contenu non-disponible.
Units = Unit\u00e9s
-UserHome = R\u00e9pertoire de l'utilisateur
+UserHome = R\u00e9pertoire de l\u2019utilisateur
Value = Valeur
ValueDomain = Domaine des valeurs
Variables = Variables