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/12/08 17:42:52 UTC
svn commit: r1773274 [2/9] - in /sis/trunk: ./
application/sis-console/src/main/artifact/
application/sis-openoffice/src/main/unopkg/
core/sis-build-helper/src/main/javadoc/
core/sis-feature/src/main/java/org/apache/sis/feature/
core/sis-feature/src/ma...
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ScriptRunner.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -19,10 +19,13 @@ package org.apache.sis.internal.metadata
import java.util.Map;
import java.util.HashMap;
import java.util.Locale;
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
import java.io.EOFException;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.LineNumberReader;
+import java.io.InputStreamReader;
import java.io.StringReader;
import java.sql.Statement;
import java.sql.Connection;
@@ -51,7 +54,7 @@ import org.apache.sis.internal.jdk8.BiFu
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.7
- * @version 0.7
+ * @version 0.8
* @module
*/
public class ScriptRunner implements AutoCloseable {
@@ -103,9 +106,9 @@ public class ScriptRunner implements Aut
/**
* A mapping of words to replace. The replacements are performed only for occurrences outside identifiers or texts.
- * See {@link #replace(String, String)} for more explanation.
+ * See {@link #addReplacement(String, String)} for more explanation.
*
- * @see #replace(String, String)
+ * @see #addReplacement(String, String)
*/
private final Map<String,String> replacements = new HashMap<>();
@@ -125,6 +128,12 @@ public class ScriptRunner implements Aut
/**
* {@code true} if the database supports enums.
+ * Example:
+ *
+ * {@preformat sql
+ * CREATE TYPE metadata."CI_DateTypeCode" AS ENUM ('creation', 'publication');
+ * CREATE CAST (VARCHAR AS metadata."CI_DateTypeCode") WITH INOUT AS ASSIGNMENT;
+ * }
*
* <p>Notes per database product:</p>
* <ul>
@@ -132,6 +141,8 @@ public class ScriptRunner implements Aut
* we require PostgreSQL 8.4 because we need the {@code CAST \u2026 WITH INOUT} feature.</li>
* <li><b>Other databases:</b> assumed not supported.</li>
* </ul>
+ *
+ * @see #statementsToSkip
*/
protected final boolean isEnumTypeSupported;
@@ -148,16 +159,42 @@ public class ScriptRunner implements Aut
/**
* {@code true} if the database supports {@code "GRANT USAGE ON SCHEMA"} statements.
* Read-only permissions are typically granted to {@link #PUBLIC}.
+ * Example:
+ *
+ * {@preformat sql
+ * GRANT USAGE ON SCHEMA metadata TO PUBLIC;
+ * }
+ *
+ * @see #statementsToSkip
*/
protected final boolean isGrantOnSchemaSupported;
/**
* {@code true} if the database supports {@code "GRANT SELECT ON TABLE"} statements.
* Read-only permissions are typically granted to {@link #PUBLIC}.
+ * Example:
+ *
+ * {@preformat sql
+ * GRANT SELECT ON TABLE epsg_coordinatereferencesystem TO PUBLIC;
+ * }
+ *
+ * @see #statementsToSkip
*/
protected final boolean isGrantOnTableSupported;
/**
+ * {@code true} if the database supports the {@code COMMENT} statement.
+ * Example:
+ *
+ * {@preformat sql
+ * COMMENT ON SCHEMA metadata IS 'ISO 19115 metadata';
+ * }
+ *
+ * @see #statementsToSkip
+ */
+ protected final boolean isCommentSupported;
+
+ /**
* {@code true} if the following instruction shall be executed
* (assuming that the PostgreSQL {@code "plpgsql"} language is desired):
*
@@ -190,6 +227,26 @@ public class ScriptRunner implements Aut
private final Statement statement;
/**
+ * If non-null, the SQL statements to skip (typically because not supported by the database).
+ * The matcher is built as an alternation of many regular expressions separated by the pipe symbol.
+ * The list of statements to skip depends on which {@code is*Supported} fields are set to {@code true}:
+ *
+ * <ul>
+ * <li>{@link #isEnumTypeSupported} for {@code "CREATE TYPE \u2026"} or {@code "CREATE CAST \u2026"} statements.</li>
+ * <li>{@link #isGrantOnSchemaSupported} for {@code "GRANT USAGE ON SCHEMA \u2026"} statements.</li>
+ * <li>{@link #isGrantOnTableSupported} for {@code "GRANT SELECT ON TABLE \u2026"} statements.</li>
+ * <li>{@link #isCommentSupported} for {@code "COMMENT ON \u2026"} statements.</li>
+ * </ul>
+ */
+ private Matcher statementsToSkip;
+
+ /**
+ * The regular expression to use for building {@link #statementsToSkip}.
+ * At most one of {@code regexOfStmtToSkip} and {@code statementsToSkip} shall be non-null.
+ */
+ private StringBuilder regexOfStmtToSkip;
+
+ /**
* Name of the SQL script under execution, or {@code null} if unknown.
* This is used only for error reporting.
*/
@@ -222,8 +279,8 @@ public class ScriptRunner implements Aut
* {@code INSERT INTO} statement. Note that this causes {@link StackOverflowError} in some JDBC driver.</li>
* </ul>
*
- * @param connection The connection to the database.
- * @param maxRowsPerInsert Maximum number of rows per {@code "INSERT INTO"} statement.
+ * @param connection the connection to the database.
+ * @param maxRowsPerInsert maximum number of rows per {@code "INSERT INTO"} statement.
* @throws SQLException if an error occurred while creating a SQL statement.
*/
protected ScriptRunner(final Connection connection, int maxRowsPerInsert) throws SQLException {
@@ -242,6 +299,7 @@ public class ScriptRunner implements Aut
isGrantOnSchemaSupported = false;
isGrantOnTableSupported = false;
isCreateLanguageRequired = false;
+ isCommentSupported = false;
break;
}
case POSTGRESQL: {
@@ -250,6 +308,7 @@ public class ScriptRunner implements Aut
isGrantOnSchemaSupported = true;
isGrantOnTableSupported = true;
isCreateLanguageRequired = (version < 9);
+ isCommentSupported = true;
break;
}
case HSQL: {
@@ -257,6 +316,7 @@ public class ScriptRunner implements Aut
isGrantOnSchemaSupported = false;
isGrantOnTableSupported = false;
isCreateLanguageRequired = false;
+ isCommentSupported = false;
if (maxRowsPerInsert != 0) {
maxRowsPerInsert = 1;
}
@@ -274,12 +334,34 @@ public class ScriptRunner implements Aut
}
this.maxRowsPerInsert = maxRowsPerInsert;
statement = connection.createStatement();
+ /*
+ * Now build the list of statements to skip, depending of which features are supported by the database.
+ * WARNING: do not use capturing group here, because some subclasses (e.g. EPSGInstaller) will use their
+ * own capturing groups. A non-capturing group is declared by "(?:A|B)" instead than a plain "(A|B)".
+ */
+ if (!isEnumTypeSupported) {
+ addStatementToSkip("CREATE\\s+(?:TYPE|CAST)\\s+.*");
+ }
+ if (!isGrantOnSchemaSupported || !isGrantOnTableSupported) {
+ addStatementToSkip("GRANT\\s+\\w+\\s+ON\\s+");
+ if (isGrantOnSchemaSupported) {
+ regexOfStmtToSkip.append("TABLE");
+ } else if (isGrantOnTableSupported) {
+ regexOfStmtToSkip.append("SCHEMA");
+ } else {
+ regexOfStmtToSkip.append("(?:TABLE|SCHEMA)");
+ }
+ regexOfStmtToSkip.append("\\s+.*");
+ }
+ if (!isCommentSupported) {
+ addStatementToSkip("COMMENT\\s+ON\\s+.*");
+ }
}
/**
* Returns the connection to the database.
*
- * @return The connection.
+ * @return the connection.
* @throws SQLException if the connection can not be obtained.
*/
protected final Connection getConnection() throws SQLException {
@@ -287,6 +369,31 @@ public class ScriptRunner implements Aut
}
/**
+ * Adds a statement to skip. By default {@code ScriptRunner} ignores the following statements:
+ *
+ * <ul>
+ * <li>{@code "CREATE TYPE \u2026"} or {@code "CREATE CAST \u2026"} if {@link #isEnumTypeSupported} is {@code false}.</li>
+ * <li>{@code "GRANT USAGE ON SCHEMA \u2026"} if {@link #isGrantOnSchemaSupported} is {@code false}.</li>
+ * <li>{@code "GRANT SELECT ON TABLE \u2026"} if {@link #isGrantOnTableSupported} is {@code false}.</li>
+ * <li>{@code "COMMENT ON \u2026"} if {@link #isCommentSupported} is {@code false}.</li>
+ * </ul>
+ *
+ * This method can be invoked for ignoring some additional statements.
+ *
+ * @param regex regular expression of the statement to ignore.
+ */
+ protected final void addStatementToSkip(final String regex) {
+ if (statementsToSkip != null) {
+ throw new IllegalStateException();
+ }
+ if (regexOfStmtToSkip == null) {
+ regexOfStmtToSkip = new StringBuilder(regex);
+ } else {
+ regexOfStmtToSkip.append('|').append(regex);
+ }
+ }
+
+ /**
* Declares that a word in the SQL script needs to be replaced by the given word.
* The replacement is performed only for occurrences outside identifiers or texts.
*
@@ -301,8 +408,8 @@ public class ScriptRunner implements Aut
* words, then in addition to the {@code "CREATE TABLE"} entry this {@code replacements} map shall also contain
* a {@code "CREATE"} entry associated with the {@link #MORE_WORDS} value.
*
- * @param inScript The word in the script which need to be replaced.
- * @param replacement The word to use instead.
+ * @param inScript the word in the script which need to be replaced.
+ * @param replacement the word to use instead.
*/
protected final void addReplacement(final String inScript, final String replacement) {
if (replacements.put(inScript, replacement) != null) {
@@ -314,18 +421,18 @@ public class ScriptRunner implements Aut
* Returns the word to use instead than the given one.
* If there is no replacement, then {@code inScript} is returned.
*
- * @param inScript The word in the script which need to be replaced.
- * @return The word to use instead.
+ * @param inScript the word in the script which need to be replaced.
+ * @return the word to use instead.
*/
protected final String getReplacement(final String inScript) {
return JDK8.getOrDefault(replacements, inScript, inScript);
}
/**
- * For every entries in the replacements map, replace the entry value by the value returned by
+ * For every entries in the replacements map, replaces the entry value by the value returned by
* {@code function(key, value)}.
*
- * @param function The function that modify the replacement mapping.
+ * @param function the function that modify the replacement mapping.
*/
protected final void modifyReplacements(final BiFunction<String,String,String> function) {
JDK8.replaceAll(replacements, function);
@@ -335,8 +442,8 @@ public class ScriptRunner implements Aut
* Runs the given SQL script.
* Lines are read and grouped up to the terminal {@value #END_OF_STATEMENT} character, then sent to the database.
*
- * @param statement The SQL statements to execute.
- * @return The number of rows added or modified as a result of the statement execution.
+ * @param statement the SQL statements to execute.
+ * @return the number of rows added or modified as a result of the statement execution.
* @throws IOException if an error occurred while reading the input (should never happen).
* @throws SQLException if an error occurred while executing a SQL statement.
*/
@@ -345,12 +452,28 @@ public class ScriptRunner implements Aut
}
/**
+ * Runs the SQL script of the given name in the same package than the given class.
+ * The script is presumed encoded in UTF-8.
+ *
+ * @param loader the class to use for loading the SQL script.
+ * @param filename the SQL script filename, relative to the {@code loader} package.
+ * @return the number of rows added or modified as a result of the statement execution.
+ * @throws IOException if an error occurred while reading the input (should never happen).
+ * @throws SQLException if an error occurred while executing a SQL statement.
+ */
+ public final int run(final Class<?> loader, final String filename) throws IOException, SQLException {
+ try (final BufferedReader in = new LineNumberReader(new InputStreamReader(loader.getResourceAsStream(filename), "UTF-8"))) {
+ return run(filename, in);
+ }
+ }
+
+ /**
* Runs the script from the given reader. Lines are read and grouped up to the
* terminal {@value #END_OF_STATEMENT} character, then sent to the database.
*
- * @param filename Name of the SQL script being executed. This is used only for error reporting.
- * @param in The stream to read. It is caller's responsibility to close this reader.
- * @return The number of rows added or modified as a result of the script execution.
+ * @param filename name of the SQL script being executed. This is used only for error reporting.
+ * @param in the stream to read. It is caller's responsibility to close this reader.
+ * @return the number of rows added or modified as a result of the script execution.
* @throws IOException if an error occurred while reading the input.
* @throws SQLException if an error occurred while executing a SQL statement.
*/
@@ -517,18 +640,41 @@ parseLine: while (pos < length) {
* Subclasses can override this method if they wish to modify the text content.
* Modifications are applied directly in the given {@code sql} buffer.
*
- * @param sql The whole SQL statement.
- * @param lower Index of the opening quote character ({@code '}) of the text in {@code sql}.
- * @param upper Index after the closing quote character ({@code '}) of the text in {@code sql}.
+ * @param sql the whole SQL statement.
+ * @param lower index of the opening quote character ({@code '}) of the text in {@code sql}.
+ * @param upper index after the closing quote character ({@code '}) of the text in {@code sql}.
*/
protected void editText(final StringBuilder sql, final int lower, final int upper) {
}
/**
+ * Returns {@code true} if the given SQL statements is supported by the database engine,
+ * or {@code false} if this statement should be ignored. The default implementation checks
+ * if the given query matches the regular expressions given to {@link #addStatementToSkip(String)}.
+ *
+ * <p>This method is only a hint; a value of {@code true} is not a guaranteed that the given
+ * SQL statement is valid.</p>
+ *
+ * @param sql the SQL statement to verify.
+ * @return whether the given SQL statement is supported by the database engine.
+ */
+ protected boolean isSupported(final CharSequence sql) {
+ if (regexOfStmtToSkip == null) {
+ return !statementsToSkip.reset(sql).matches();
+ } else {
+ // We do not use Pattern.CASE_INSENTITIVE for performance reasons.
+ statementsToSkip = Pattern.compile(regexOfStmtToSkip.toString(), Pattern.DOTALL).matcher(sql);
+ regexOfStmtToSkip = null;
+ return !statementsToSkip.matches();
+ }
+ }
+
+ /**
* Executes the given SQL statement.
* This method performs the following choices:
*
* <ul>
+ * <li>If {@link #isSupported(StringBuilder)} returns {@code false}, then this method does nothing.</li>
* <li>If the {@code maxRowsPerInsert} argument given at construction time was zero,
* then this method skips {@code "INSERT INTO"} statements but executes all other.</li>
* <li>Otherwise this method executes the given statement with the following modification:
@@ -540,12 +686,15 @@ parseLine: while (pos < length) {
* Subclasses that override this method can freely edit the {@link StringBuilder} content before
* to invoke this method.
*
- * @param sql The SQL statement to execute.
- * @return The number of rows added or modified as a result of the statement execution.
+ * @param sql the SQL statement to execute.
+ * @return the number of rows added or modified as a result of the statement execution.
* @throws SQLException if an error occurred while executing the SQL statement.
* @throws IOException if an I/O operation was required and failed.
*/
protected int execute(final StringBuilder sql) throws SQLException, IOException {
+ if (!isSupported(sql)) {
+ return 0;
+ }
String subSQL = currentSQL = CharSequences.trimWhitespaces(sql).toString();
int count = 0;
/*
@@ -600,7 +749,7 @@ parseLine: while (pos < length) {
* Closes the statement used by this runner. Note that this method does not close the connection
* given to the constructor; this connection still needs to be closed explicitly by the caller.
*
- * @throws SQLException If an error occurred while closing the statement.
+ * @throws SQLException if an error occurred while closing the statement.
*/
@Override
public void close() throws SQLException {
@@ -636,7 +785,7 @@ parseLine: while (pos < length) {
* current position in the script being executed, and the SQL statement. This method may be invoked after a
* {@link SQLException} occurred in order to determine the line in the SQL script that caused the error.
*
- * @return The current position in the script being executed.
+ * @return the current position in the script being executed.
*/
@Debug
@Override
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Convention.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -294,7 +294,7 @@ public enum Convention {
* <tr><td>GEOTIFF</td> <td>CT_Mercator</td></tr>
* </table></div>
*
- * @return The organization, standard or project to look for when fetching Map Projection parameter names.
+ * @return the organization, standard or project to look for when fetching Map Projection parameter names.
*
* @see WKTFormat#getNameAuthority()
* @see Citations#EPSG
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/io/wkt/Formatter.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -783,7 +783,7 @@ public class Formatter implements Locali
}
if (showIDs) {
Collection<ReferenceIdentifier> identifiers = object.getIdentifiers();
- if (identifiers != null) { // Paranoiac check
+ if (identifiers != null) { // Paranoiac check
if (filterID) {
for (final ReferenceIdentifier id : identifiers) {
if (Citations.identifierMatches(authority, id.getAuthority())) {
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/Cloner.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -146,7 +146,7 @@ final class Cloner extends org.apache.si
* by their unmodifiable variant. The keys are assumed already immutable.
*/
if (object instanceof Map<?,?>) {
- final Map<Object,Object> map = new LinkedHashMap<>((Map<?,?>) object);
+ final Map<Object,Object> map = new LinkedHashMap<Object,Object>((Map<?,?>) object);
for (final Iterator<Map.Entry<Object,Object>> it=map.entrySet().iterator(); it.hasNext();) {
final Map.Entry<Object,Object> entry = it.next();
entry.setValue(clone(entry.getValue()));
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/distribution/DefaultFormat.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -42,6 +42,26 @@ import static org.opengis.annotation.Spe
/**
* Description of the computer language construct that specifies the representation
* of data objects in a record, file, message, storage device or transmission channel.
+ * Each {@code Format} instance should contain a {@linkplain #getFormatSpecificationCitation() reference
+ * to the format specification}, for example <cite>"PNG (Portable Network Graphics) Specification"</cite>.
+ * The specification often has an abbreviation (for example "PNG") which can be stored as an
+ * {@linkplain DefaultCitation#getAlternateTitles() alternate title}.
+ *
+ * <p>Apache SIS provides pre-defined metadata structures for some commonly-used formats.
+ * A pre-defined format can be obtained by a call to
+ * <code>{@linkplain org.apache.sis.metadata.sql.MetadataSource#lookup(Class, String) lookup}(Format.class,
+ * <var>abbreviation</var>)</code> where <var>abbreviation</var> can be one of the values listed below:</p>
+ *
+ * <table class="sis">
+ * <caption>Specification titles for well-known format names</caption>
+ * <tr><th>Abbreviation</th> <th>Specification title</th></tr>
+ * <tr><td>CSV</td> <td>Common Format and MIME Type for Comma-Separated Values (CSV) Files</td></tr>
+ * <tr><td>GeoTIFF</td> <td>GeoTIFF Coverage Encoding Profile</td></tr>
+ * <tr><td>NetCDF</td> <td>NetCDF Classic and 64-bit Offset Format</td></tr>
+ * <tr><td>PNG</td> <td>PNG (Portable Network Graphics) Specification</td></tr>
+ * </table>
+ *
+ * Above list may be expanded in any future SIS version.
*
* <p><b>Limitations:</b></p>
* <ul>
@@ -110,50 +130,21 @@ public class DefaultFormat extends ISOMe
* Creates a format initialized to the given name and version.
* The given name should be a short name or abbreviation, for example "JPEG" or "GeoTIFF".
*
- * <p>This convenience constructor automatically sets a format specification title for some well-known values.
- * The currently recognized list of format names is given below. This list may be expanded in any future SIS
- * version.</p>
- *
- * <table class="sis">
- * <caption>Specification titles for well-known format names</caption>
- * <tr><th>Name</th> <th>Specification title</th></tr>
- * <tr><td>CSV</td> <td>Common Format and MIME Type for Comma-Separated Values (CSV) Files</td></tr>
- * <tr><td>GeoTIFF</td> <td>GeoTIFF Coverage Encoding Profile</td></tr>
- * <tr><td>NetCDF</td> <td>NetCDF Classic and 64-bit Offset Format</td></tr>
- * <tr><td>PNG</td> <td>PNG (Portable Network Graphics) Specification</td></tr>
- * </table>
- *
* @param name the abbreviated name of the data transfer format, or {@code null}.
* @param version the version of the format (date, number, <i>etc.</i>), or {@code null}.
+ *
+ * @deprecated This constructor had a straightforward meaning in ISO 19115:2003, but became confusing
+ * with the ISO 19115:2014 update because of differences in the {@code Format} model.
+ * Consider using {@link org.apache.sis.metadata.sql.MetadataSource#lookup(Class, String)} instead.
*/
+ @Deprecated
public DefaultFormat(CharSequence name, final CharSequence version) {
- if (name != null || version != null) {
- final DefaultCitation citation = new DefaultCitation();
- if (name != null) {
- /*
- * TODO: move the following hard-coded values in a database
- * after we ported the org.apache.sis.metadata.sql package.
- */
- String title = null;
- final String keyword = name.toString();
- if (keyword.equalsIgnoreCase("GeoTIFF")) {
- title = "GeoTIFF Coverage Encoding Profile";
- } else if (keyword.equalsIgnoreCase("NetCDF")) {
- title = "NetCDF Classic and 64-bit Offset Format";
- } else if (keyword.equalsIgnoreCase("PNG")) {
- title = "PNG (Portable Network Graphics) Specification";
- } else if (keyword.equalsIgnoreCase("CSV")) {
- title = "Common Format and MIME Type for Comma-Separated Values (CSV) Files";
- } else if (keyword.equalsIgnoreCase("CSV/MF")) { // Not yet documented format.
- title = "OGC Moving Features Encoding Extension: Simple Comma-Separated Values (CSV)";
- name = "CSV";
- }
- citation.setTitle(Types.toInternationalString(title));
- citation.setAlternateTitles(Collections.singleton(Types.toInternationalString(name)));
- }
- citation.setEdition(Types.toInternationalString(version));
- formatSpecificationCitation = citation;
+ final DefaultCitation citation = new DefaultCitation();
+ if (name != null) {
+ citation.setAlternateTitles(Collections.singleton(Types.toInternationalString(name)));
}
+ citation.setEdition(Types.toInternationalString(version));
+ formatSpecificationCitation = citation;
}
/**
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/identification/DefaultAggregateInformation.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -204,7 +204,7 @@ public class DefaultAggregateInformation
* If there is more than one value, replace only the first one and keep all other ones unchanged.
* The intend is to be consistent with the getter method, which returns the first element.
*/
- final ArrayList<Identifier> identifiers = new ArrayList<>(name.getIdentifiers());
+ final ArrayList<Identifier> identifiers = new ArrayList<Identifier>(name.getIdentifiers());
if (identifiers.isEmpty()) {
identifiers.add(newValue);
} else {
Modified: sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/spatial/DefaultGridSpatialRepresentation.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -32,7 +32,7 @@ import static org.apache.sis.internal.me
/**
- * Basic information required to uniquely identify a resource or resources.
+ * Method used to represent geographic information in the dataset.
*
* <p><b>Limitations:</b></p>
* <ul>
Propchange: sis/trunk/core/sis-metadata/src/main/javadoc/overview.html
------------------------------------------------------------------------------
--- svn:mime-type (original)
+++ svn:mime-type Thu Dec 8 17:42:51 2016
@@ -1 +1 @@
-text/html
+text/html;charset=UTF-8
Modified: sis/trunk/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql?rev=1773274&r1=1773267&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/main/resources/org/apache/sis/metadata/sql/Create.sql [UTF-8] Thu Dec 8 17:42:51 2016
@@ -82,7 +82,8 @@ FOREIGN KEY ("authority") REFERENCES met
CREATE TABLE metadata."MD_Format" (
ID VARCHAR(15) NOT NULL PRIMARY KEY,
- "formatSpecificationCitation" VARCHAR(15) REFERENCES metadata."CI_Citation" (ID) ON UPDATE RESTRICT ON DELETE RESTRICT,
+ "name" VARCHAR(120),
+ "specification" VARCHAR(120),
"amendmentNumber" VARCHAR(120),
"fileDecompressionTechnique" VARCHAR(120));
@@ -120,9 +121,9 @@ INSERT INTO metadata."CI_Citation" (ID,
('CSV', 'CSV', 'Common Format and MIME Type for Comma-Separated Values (CSV) Files'),
('CSV-MF', 'CSV', 'OGC Moving Features Encoding Extension: Simple Comma-Separated Values (CSV)');
-INSERT INTO metadata."MD_Format" (ID, "formatSpecificationCitation") VALUES
- ('GeoTIFF', 'GeoTIFF'),
- ('NetCDF', 'NetCDF'),
- ('PNG', 'PNG'),
- ('CSV', 'CSV'),
- ('CSV-MF', 'CSV-MF');
+INSERT INTO metadata."MD_Format" (ID, "name", "specification") VALUES
+ ('GeoTIFF', 'GeoTIFF', 'GeoTIFF Coverage Encoding Profile'),
+ ('NetCDF', 'NetCDF', 'NetCDF Classic and 64-bit Offset Format'),
+ ('PNG', 'PNG', 'PNG (Portable Network Graphics) Specification'),
+ ('CSV', 'CSV', 'Common Format and MIME Type for Comma-Separated Values (CSV) Files'),
+ ('CSV-MF', 'CSV', 'OGC Moving Features Encoding Extension: Simple Comma-Separated Values (CSV)');
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/sql/TestDatabase.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/sql/TestDatabase.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/sql/TestDatabase.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/internal/metadata/sql/TestDatabase.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -59,8 +59,8 @@ public final strictfp class TestDatabase
* Returns the path to the directory of the given name in {@code $SIS_DATA/Databases}.
* If the directory is not found, then the test will be interrupted by an {@code org.junit.Assume} statement.
*
- * @param name The name of the sub-directory.
- * @return The path to the given sub-directory.
+ * @param name the name of the sub-directory.
+ * @return the path to the given sub-directory.
*/
public static Path directory(final String name) {
Path dir = DataDirectory.DATABASES.getDirectory();
@@ -74,8 +74,8 @@ public final strictfp class TestDatabase
* Creates a Derby database in memory. If no Derby or JavaDB driver is not found,
* then the test will be interrupted by an {@code org.junit.Assume} statement.
*
- * @param name The database name (without {@code "memory:"} prefix).
- * @return The data source.
+ * @param name the database name (without {@code "memory:"} prefix).
+ * @return the data source.
* @throws Exception if an error occurred while creating the database.
*/
public static DataSource create(final String name) throws Exception {
@@ -96,7 +96,7 @@ public final strictfp class TestDatabase
/**
* Drops an in-memory Derby database after usage.
*
- * @param ds The data source created by {@link #create(String)}.
+ * @param ds the data source created by {@link #create(String)}.
* @throws Exception if an error occurred while dropping the database.
*/
public static void drop(final DataSource ds) throws Exception {
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/MetadataSourceTest.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/MetadataSourceTest.java?rev=1773274&r1=1773267&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/MetadataSourceTest.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/MetadataSourceTest.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -18,7 +18,6 @@ package org.apache.sis.metadata.sql;
import java.util.Collections;
import javax.sql.DataSource;
-import org.opengis.metadata.citation.Citation;
import org.opengis.metadata.distribution.Format;
import org.apache.sis.metadata.MetadataStandard;
import org.apache.sis.internal.metadata.sql.TestDatabase;
@@ -31,7 +30,6 @@ import org.apache.sis.test.TestStep;
import org.junit.Test;
import static org.junit.Assert.*;
-import static org.apache.sis.test.TestUtilities.getSingleton;
/**
@@ -56,7 +54,7 @@ public final strictfp class MetadataSour
try (final MetadataSource source = new MetadataSource(MetadataStandard.ISO_19115, ds, "metadata", null, null)) {
source.install();
verifyFormats(source);
- testSearch(source);
+// testSearch(source);
} finally {
TestDatabase.drop(ds);
}
@@ -86,10 +84,8 @@ public final strictfp class MetadataSour
* @param title the expected format title.
*/
private static void verify(final Format format, final String abbreviation, final String title) {
- final Citation spec = format.getFormatSpecificationCitation();
- assertNotNull("formatSpecificationCitation", spec);
- assertEquals("abbreviation", abbreviation, String.valueOf(getSingleton(spec.getAlternateTitles())));
- assertEquals("title", title, String.valueOf(spec.getTitle()));
+ assertEquals("abbreviation", abbreviation, String.valueOf(format.getName()));
+ assertEquals("title", title, String.valueOf(format.getSpecification()));
}
/**
Modified: sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] (original)
+++ sis/trunk/core/sis-metadata/src/test/java/org/apache/sis/test/suite/MetadataTestSuite.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -26,7 +26,7 @@ import org.junit.BeforeClass;
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.3
- * @version 0.7
+ * @version 0.8
* @module
*/
@Suite.SuiteClasses({
@@ -101,7 +101,10 @@ import org.junit.BeforeClass;
org.apache.sis.io.wkt.FormatterTest.class,
org.apache.sis.io.wkt.ElementTest.class,
- org.apache.sis.internal.metadata.sql.SQLUtilitiesTest.class
+ org.apache.sis.internal.metadata.sql.SQLUtilitiesTest.class,
+ org.apache.sis.internal.metadata.sql.TypeMapperTest.class,
+ org.apache.sis.internal.metadata.sql.ScriptRunnerTest.class,
+ org.apache.sis.metadata.sql.MetadataSourceTest.class
})
public final strictfp class MetadataTestSuite extends TestSuite {
/**
Modified: sis/trunk/core/sis-referencing/pom.xml
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/pom.xml?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/pom.xml (original)
+++ sis/trunk/core/sis-referencing/pom.xml Thu Dec 8 17:42:51 2016
@@ -144,6 +144,16 @@ Implementations of Coordinate Reference
<type>test-jar</type>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.hsqldb</groupId>
+ <artifactId>hsqldb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.postgresql</groupId>
+ <artifactId>postgresql</artifactId>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/geometry/GeneralEnvelope.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -575,7 +575,7 @@ public class GeneralEnvelope extends Arr
* <div class="section">Spanning the anti-meridian of a Geographic CRS</div>
* This method supports envelopes spanning the anti-meridian. If one or both envelopes span
* the anti-meridian, then the result of the {@code add} operation may be an envelope expanding
- * to infinities. In such case, the ordinate range will be either [-\u221e\u2026\u221e] or [0\u2026-0] depending on
+ * to infinities. In such case, the ordinate range will be either [\u2212\u221e\u2026\u221e] or [0\u2026\u22120] depending on
* whatever the original range span the anti-meridian or not.
*
* @param envelope the {@code Envelope} to add to this envelope.
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_GeneralOperationParameter.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_GeneralOperationParameter.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_GeneralOperationParameter.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/jaxb/referencing/CC_GeneralOperationParameter.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -259,7 +259,7 @@ public final class CC_GeneralOperationPa
* by the 'complete' descriptor. If the descriptor is a group, then this 'replacement' method will
* be invoked recursively for each parameter in the group.
*/
- final Map<String,Object> merged = new HashMap<>(expected);
+ final Map<String,Object> merged = new HashMap<String,Object>(expected);
merged.putAll(actual); // May overwrite pre-defined properties.
mergeArrays(GeneralParameterDescriptor.ALIAS_KEY, GenericName.class, provided.getAlias(), merged, complete.getName());
mergeArrays(GeneralParameterDescriptor.IDENTIFIERS_KEY, ReferenceIdentifier.class, provided.getIdentifiers(), merged, null);
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/CoordinateOperations.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -63,7 +63,7 @@ public final class CoordinateOperations
/**
* Returns the factory.
*
- * @return The system-wide factory.
+ * @return the system-wide factory.
*/
public static DefaultCoordinateOperationFactory factory() {
DefaultCoordinateOperationFactory c = factory;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/MergedProperties.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/MergedProperties.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/MergedProperties.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/MergedProperties.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -69,7 +69,7 @@ public class MergedProperties extends Ab
@Override
protected EntryIterator<String,Object> entryIterator() {
if (merge == null) {
- merge = new HashMap<>(defaultProperties);
+ merge = new HashMap<String,Object>(defaultProperties);
merge.putAll(properties);
merge.remove(null);
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ReferencingUtilities.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -295,7 +295,7 @@ public final class ReferencingUtilities
}
name = CharSequences.trimWhitespaces(name, 0, i).toString();
if (!name.isEmpty()) {
- final Map<String,Object> copy = new HashMap<>(properties);
+ final Map<String,Object> copy = new HashMap<String,Object>(properties);
copy.put(IdentifiedObject.NAME_KEY, name);
return copy;
}
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/ServicesForMetadata.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -728,7 +728,7 @@ public final class ServicesForMetadata e
}
properties = Collections.emptyMap();
}
- final HashMap<String,Object> p = new HashMap<>(properties);
+ final HashMap<String,Object> p = new HashMap<String,Object>(properties);
JDK8.putIfAbsent(p, CRS_FACTORY, crsFactory);
JDK8.putIfAbsent(p, CS_FACTORY, csFactory);
properties = p;
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Equirectangular.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -66,7 +66,7 @@ import static java.lang.Math.*;
* @author John Grange
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.6
+ * @version 0.8
* @module
*
* @see <a href="http://www.remotesensing.org/geotiff/proj_list/equirectangular.html">Equirectangular on RemoteSensing.org</a>
@@ -125,24 +125,27 @@ public final class Equirectangular exten
STANDARD_PARALLEL = createLatitude(builder
.addIdentifier("8823")
+ .addIdentifier(Citations.GEOTIFF, "3078")
.addName("Latitude of 1st standard parallel")
.addName(Citations.OGC, Constants.STANDARD_PARALLEL_1)
.addName(Citations.ESRI, "Standard_Parallel_1")
.addName(Citations.NETCDF, Constants.STANDARD_PARALLEL)
- .addName(Citations.GEOTIFF, "ProjStdParallel1")
+ .addName(Citations.GEOTIFF, "StdParallel1")
.addName(Citations.PROJ4, "lat_ts"), false);
LONGITUDE_OF_ORIGIN = createLongitude(builder
.addIdentifier("8802")
+ .addIdentifier(Citations.GEOTIFF, "3088")
.addName("Longitude of natural origin")
.addName(Citations.OGC, Constants.CENTRAL_MERIDIAN)
.addName(Citations.ESRI, "Central_Meridian")
.addName(Citations.NETCDF, "longitude_of_projection_origin")
- .addName(Citations.GEOTIFF, "ProjCenterLong")
+ .addName(Citations.GEOTIFF, "CenterLong")
.addName(Citations.PROJ4, "lon_0"));
FALSE_EASTING = createShift(builder
.addIdentifier("8806")
+ .addIdentifier(Citations.GEOTIFF, "3082")
.addName("False easting")
.addName(Citations.OGC, Constants.FALSE_EASTING)
.addName(Citations.ESRI, "False_Easting")
@@ -152,6 +155,7 @@ public final class Equirectangular exten
FALSE_NORTHING = createShift(builder
.addIdentifier("8807")
+ .addIdentifier(Citations.GEOTIFF, "3083")
.addName("False northing")
.addName(Citations.OGC, Constants.FALSE_NORTHING)
.addName(Citations.ESRI, "False_Northing")
@@ -167,11 +171,12 @@ public final class Equirectangular exten
*/
LATITUDE_OF_ORIGIN = createZeroConstant(builder // Was used by EPSG:9823 (also EPSG:9842).
.addIdentifier("8801")
+ .addIdentifier(Citations.GEOTIFF, "3089")
.addName("Latitude of natural origin")
.addName(Citations.OGC, Constants.LATITUDE_OF_ORIGIN)
.addName(Citations.ESRI, "Latitude_Of_Origin")
.addName(Citations.NETCDF, "latitude_of_projection_origin")
- .addName(Citations.GEOTIFF, "ProjCenterLat")
+ .addName(Citations.GEOTIFF, "CenterLat")
.addName(Citations.PROJ4, "lat_0")
.setRemarks(Resources.formatInternational(Resources.Keys.ConstantProjParameterValue_1, 0))
.setRequired(false));
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=1773274&r1=1773273&r2=1773274&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] Thu Dec 8 17:42:51 2016
@@ -30,7 +30,7 @@ import org.apache.sis.metadata.iso.citat
* @author Martin Desruisseaux (IRD, Geomatys)
* @author Rueben Schulz (UBC)
* @since 0.6
- * @version 0.6
+ * @version 0.8
* @module
*
* @see <a href="http://www.remotesensing.org/geotiff/proj_list/lambert_conic_conformal_2sp.html">Lambert Conic Conformal 2SP on RemoteSensing.org</a>
@@ -107,10 +107,13 @@ public final class LambertConformal2SP e
* NetCDF: longitude_of_central_meridian
* GeoTIFF: FalseOriginLong
*/
- LONGITUDE_OF_FALSE_ORIGIN = createLongitude(
- rename(LambertConformal1SP.LONGITUDE_OF_ORIGIN, "8822", "Longitude of false origin", builder)
+ LONGITUDE_OF_FALSE_ORIGIN = createLongitude(builder
+ .addNamesAndIdentifiers(LambertConformal1SP.LONGITUDE_OF_ORIGIN)
+ .rename(Citations.EPSG, "Longitude of false origin")
.rename(Citations.NETCDF, "longitude_of_central_meridian")
- .rename(Citations.GEOTIFF, "FalseOriginLong"));
+ .rename(Citations.GEOTIFF, "FalseOriginLong")
+ .reidentify(Citations.EPSG, "8822")
+ .reidentify(Citations.GEOTIFF, "3084"));
/*
* EPSG: Latitude of 1st standard parallel
* OGC: standard_parallel_1
@@ -133,6 +136,7 @@ public final class LambertConformal2SP e
*/
STANDARD_PARALLEL_2 = createMandatoryLatitude(builder
.addIdentifier("8824")
+ .addIdentifier(Citations.GEOTIFF, "3079")
.addName("Latitude of 2nd standard parallel")
.addName(Citations.OGC, Constants.STANDARD_PARALLEL_2)
.addName(Citations.ESRI, "Standard_Parallel_2")
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=1773274&r1=1773273&r2=1773274&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] Thu Dec 8 17:42:51 2016
@@ -40,7 +40,9 @@ import org.apache.sis.internal.util.Cons
import org.apache.sis.measure.MeasurementRange;
import org.apache.sis.measure.Units;
import org.apache.sis.referencing.NamedIdentifier;
+import org.apache.sis.referencing.IdentifiedObjects;
import org.apache.sis.referencing.operation.projection.NormalizedProjection;
+import org.apache.sis.metadata.iso.ImmutableIdentifier;
import org.apache.sis.metadata.iso.citation.Citations;
import org.apache.sis.parameter.DefaultParameterDescriptor;
import org.apache.sis.parameter.ParameterBuilder;
@@ -72,7 +74,7 @@ public abstract class MapProjection exte
* All names known to Apache SIS for the <cite>semi-major</cite> parameter.
* This parameter is mandatory and has no default value. The range of valid values is (0 \u2026 \u221e).
*
- * <p>Some names for this parameter are {@code "semi_major"}, {@code "SemiMajor"} and {@code "a"}.</p>
+ * <p>Some names for this parameter are {@code "semi_major"}, {@code "SemiMajorAxis"} and {@code "a"}.</p>
*/
public static final DefaultParameterDescriptor<Double> SEMI_MAJOR;
@@ -80,7 +82,7 @@ public abstract class MapProjection exte
* All names known to Apache SIS for the <cite>semi-minor</cite> parameter.
* This parameter is mandatory and has no default value. The range of valid values is (0 \u2026 \u221e).
*
- * <p>Some names for this parameter are {@code "semi_minor"}, {@code "SemiMinor"} and {@code "b"}.</p>
+ * <p>Some names for this parameter are {@code "semi_minor"}, {@code "SemiMinorAxis"} and {@code "b"}.</p>
*/
public static final DefaultParameterDescriptor<Double> SEMI_MINOR;
@@ -95,13 +97,14 @@ public abstract class MapProjection exte
final GenericName[] aliases = {
new NamedIdentifier(Citations.ESRI, "Semi_Major"),
new NamedIdentifier(Citations.NETCDF, "semi_major_axis"),
- new NamedIdentifier(Citations.GEOTIFF, "SemiMajor"),
+ new NamedIdentifier(Citations.GEOTIFF, "SemiMajorAxis"),
new NamedIdentifier(Citations.PROJ4, "a")
};
final Map<String,Object> properties = new HashMap<>(4);
- properties.put(AUTHORITY_KEY, Citations.OGC);
- properties.put(NAME_KEY, Constants.SEMI_MAJOR);
- properties.put(ALIAS_KEY, aliases);
+ properties.put(AUTHORITY_KEY, Citations.OGC);
+ properties.put(NAME_KEY, Constants.SEMI_MAJOR);
+ properties.put(ALIAS_KEY, aliases);
+ properties.put(IDENTIFIERS_KEY, new ImmutableIdentifier(Citations.GEOTIFF, null, "2057"));
SEMI_MAJOR = new DefaultParameterDescriptor<>(properties, 1, 1, Double.class, valueDomain, null, null);
/*
* Change in-place the name and aliases (we do not need to create new objects)
@@ -110,8 +113,9 @@ public abstract class MapProjection exte
properties.put(NAME_KEY, Constants.SEMI_MINOR);
aliases[0] = new NamedIdentifier(Citations.ESRI, "Semi_Minor");
aliases[1] = new NamedIdentifier(Citations.NETCDF, "semi_minor_axis");
- aliases[2] = new NamedIdentifier(Citations.GEOTIFF, "SemiMinor");
+ aliases[2] = new NamedIdentifier(Citations.GEOTIFF, "SemiMinorAxis");
aliases[3] = new NamedIdentifier(Citations.PROJ4, "b");
+ properties.put(IDENTIFIERS_KEY, new ImmutableIdentifier(Citations.GEOTIFF, null, "2058"));
SEMI_MINOR = new DefaultParameterDescriptor<>(properties, 1, 1, Double.class, valueDomain, null, null);
/*
* SIS-specific parameter for debugging purpose only.
@@ -245,25 +249,8 @@ public abstract class MapProjection exte
}
/**
- * Rename the primary name and identifier of the given descriptor. Aliases are copied as-is.
- *
- * @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}.
+ * Copies name, aliases and identifiers of the given {@code template}, except the alias and identifiers of the
+ * given authority which are replaced by the alias and identifiers of the same authority in {@code replacement}.
*
* @param template the parameter from which to copy names and identifiers.
* @param toRename authority of the alias to rename.
@@ -276,11 +263,9 @@ public abstract class MapProjection exte
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;
+ return copyAliases(template, toRename, sameNameAs(toRename, replacement),
+ (ReferenceIdentifier) IdentifiedObjects.getIdentifier(replacement, toRename),
+ builder.addName(template.getName()));
}
/**
@@ -292,11 +277,12 @@ public abstract class MapProjection exte
* @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 newCode the identifier 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)
+ GenericName replacement, ReferenceIdentifier newCode, final ParameterBuilder builder)
{
for (GenericName alias : template.getAlias()) {
if (((Identifier) alias).getAuthority() == exclude) {
@@ -306,17 +292,23 @@ public abstract class MapProjection exte
}
builder.addName(alias);
}
+ for (ReferenceIdentifier id : template.getIdentifiers()) {
+ if (id.getAuthority() == exclude) {
+ if (newCode == null) continue;
+ id = newCode;
+ newCode = null;
+ }
+ 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).
+ * Copies all aliases and all identifiers except EPSG, but using the alias specified by the given authority
+ * as the primary name. The old primary name (usually the EPSG name) is discarded.
*
* <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>
+ * projection using the EPSG parameters as template.</p>
*
* @param template the parameter from which to copy the names.
* @param authority the authority to use for the primary name.
@@ -328,25 +320,7 @@ public abstract class MapProjection exte
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 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 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<?> template, final ParameterBuilder builder) {
- for (final GenericName alias : template.getAlias()) {
- builder.addName(alias);
- }
- return builder;
+ return copyAliases(template, authority, null, null, builder.addName(sameNameAs(authority, template)));
}
/**
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Mercator1SP.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -69,14 +69,17 @@ public final class Mercator1SP extends A
static {
final ParameterBuilder builder = builder();
LATITUDE_OF_ORIGIN = createZeroConstant(builder.addNamesAndIdentifiers(Equirectangular.LATITUDE_OF_ORIGIN)
+ .reidentify(Citations.GEOTIFF, "3081")
.rename(Citations.GEOTIFF, "NatOriginLat")
.setRemarks(Equirectangular.LATITUDE_OF_ORIGIN.getRemarks()));
LONGITUDE_OF_ORIGIN = createLongitude(builder.addNamesAndIdentifiers(Equirectangular.LONGITUDE_OF_ORIGIN)
+ .reidentify(Citations.GEOTIFF, "3080")
.rename(Citations.GEOTIFF, "NatOriginLong"));
SCALE_FACTOR = createScale(builder
.addIdentifier("8805")
+ .addIdentifier(Citations.GEOTIFF, "3092")
.addName("Scale factor at natural origin")
.addName(Citations.OGC, Constants.SCALE_FACTOR)
.addName(Citations.ESRI, "Scale_Factor")
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=1773274&r1=1773273&r2=1773274&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] Thu Dec 8 17:42:51 2016
@@ -88,7 +88,11 @@ public final class Mercator2SP extends A
* here would rather be at the standard parallel. We keep the OGC, ESRI and Proj.4 names because they are just
* "scale_factor" or "k", which is vague enough for the purpose of this non-standard parameter.
*/
- SCALE_FACTOR = createScale(exceptEPSG(Mercator1SP.SCALE_FACTOR, builder)
+ SCALE_FACTOR = createScale(builder
+ .addNamesAndIdentifiers(Mercator1SP.SCALE_FACTOR)
+ .reidentify(Citations.EPSG, (String[]) null)
+ .reidentify(Citations.GEOTIFF, (String[]) null)
+ .rename(Citations.EPSG, (String[]) null)
.rename(Citations.NETCDF, (String[]) null) // "scale_factor_at_projection_origin" is too specific.
.rename(Citations.GEOTIFF, (String[]) null) // "ScaleAtNatOrigin" is too specific.
.setRemarks(remarks).setDeprecated(true));
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=1773274&r1=1773273&r2=1773274&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] Thu Dec 8 17:42:51 2016
@@ -77,6 +77,7 @@ public final class PolarStereographicA e
final ParameterBuilder builder = builder();
LONGITUDE_OF_ORIGIN = createLongitude(builder
.addNamesAndIdentifiers(ObliqueStereographic.LONGITUDE_OF_ORIGIN)
+ .reidentify(Citations.GEOTIFF, "3095")
.rename(Citations.GEOTIFF, "StraightVertPoleLong"));
PARAMETERS = builder
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=1773274&r1=1773273&r2=1773274&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] Thu Dec 8 17:42:51 2016
@@ -75,8 +75,10 @@ public final class PolarStereographicB e
private static final ParameterDescriptorGroup PARAMETERS;
static {
final ParameterBuilder builder = builder();
- LONGITUDE_OF_ORIGIN = createLongitude(
- rename(PolarStereographicA.LONGITUDE_OF_ORIGIN, "8833", "Longitude of origin", builder));
+ LONGITUDE_OF_ORIGIN = createLongitude(builder
+ .addNamesAndIdentifiers(PolarStereographicA.LONGITUDE_OF_ORIGIN)
+ .rename(Citations.EPSG, "Longitude of origin")
+ .reidentify(Citations.EPSG, "8833"));
STANDARD_PARALLEL = createMandatoryLatitude(builder
.addIdentifier("8832").addName("Latitude of standard parallel")
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Providers.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Providers.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Providers.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/internal/referencing/provider/Providers.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -43,7 +43,7 @@ public final class Providers extends Laz
/**
* Caches a new element, possibly substituting the created instance by a previously created instance.
*
- * @param element The element to add to the cache.
+ * @param element the element to add to the cache.
*/
@Override
protected void cache(OperationMethod element) {
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=1773274&r1=1773273&r2=1773274&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] Thu Dec 8 17:42:51 2016
@@ -34,7 +34,7 @@ import org.apache.sis.parameter.Paramete
*
* @author Martin Desruisseaux (Geomatys)
* @since 0.6
- * @version 0.6
+ * @version 0.8
* @module
*/
@XmlTransient
@@ -74,17 +74,26 @@ public class RegionalMercator extends Ab
static {
final ParameterBuilder builder = builder();
- 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(
- rename(FALSE_EASTING, "8826", "Easting at false origin", builder)
- .rename(Citations.GEOTIFF, "FalseOriginEasting"));
-
- NORTHING_AT_FALSE_ORIGIN = createShift(
- rename(FALSE_NORTHING, "8827", "Northing at false origin", builder)
- .rename(Citations.GEOTIFF, "FalseOriginNorthing"));
+ LATITUDE_OF_FALSE_ORIGIN = createLatitude(builder
+ .addNamesAndIdentifiers(Mercator1SP.LATITUDE_OF_ORIGIN)
+ .rename(Citations.EPSG, "Latitude of false origin")
+ .rename(Citations.GEOTIFF, "FalseOriginLat")
+ .reidentify(Citations.EPSG, "8821")
+ .reidentify(Citations.GEOTIFF, "3085"), false);
+
+ EASTING_AT_FALSE_ORIGIN = createShift(builder
+ .addNamesAndIdentifiers(FALSE_EASTING)
+ .rename(Citations.EPSG, "Easting at false origin")
+ .rename(Citations.GEOTIFF, "FalseOriginEasting")
+ .reidentify(Citations.EPSG, "8826")
+ .reidentify(Citations.GEOTIFF, "3086"));
+
+ NORTHING_AT_FALSE_ORIGIN = createShift(builder
+ .addNamesAndIdentifiers(FALSE_NORTHING)
+ .rename(Citations.EPSG, "Northing at false origin")
+ .rename(Citations.GEOTIFF, "FalseOriginNorthing")
+ .reidentify(Citations.EPSG, "8827")
+ .reidentify(Citations.GEOTIFF, "3087"));
PARAMETERS = builder
.addIdentifier(IDENTIFIER)
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/ParameterFormat.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -82,8 +82,8 @@ import static org.apache.sis.util.collec
* \u2502 Latitude of natural origin \u2502 Double \u2502 Mandatory \u2502 [-80 \u2026 84]� \u2502 0.0� \u2502
* \u2502 Longitude of natural origin \u2502 Double \u2502 Mandatory \u2502 [-180 \u2026 180]� \u2502 0.0� \u2502
* \u2502 Scale factor at natural origin \u2502 Double \u2502 Mandatory \u2502 (0 \u2026 \u221e) \u2502 1.0 \u2502
- * \u2502 False easting \u2502 Double \u2502 Mandatory \u2502 (-\u221e \u2026 \u221e) m \u2502 0.0 m \u2502
- * \u2502 False northing \u2502 Double \u2502 Mandatory \u2502 (-\u221e \u2026 \u221e) m \u2502 0.0 m \u2502
+ * \u2502 False easting \u2502 Double \u2502 Mandatory \u2502 (\u2212\u221e \u2026 \u221e) m \u2502 0.0 m \u2502
+ * \u2502 False northing \u2502 Double \u2502 Mandatory \u2502 (\u2212\u221e \u2026 \u221e) m \u2502 0.0 m \u2502
* \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
* }
* </div>
@@ -162,10 +162,10 @@ public class ParameterFormat extends Tab
* \u2551 EPSG: Scale factor at natural origin \u2502 Double \u2502 Mandatory \u2502 (0 \u2026 \u221e) \u2502 1.0 \u2551
* \u2551 OGC: scale_factor \u2502 \u2502 \u2502 \u2502 \u2551
* \u255f\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2562
- * \u2551 EPSG: False easting \u2502 Double \u2502 Mandatory \u2502 (-\u221e \u2026 \u221e) m \u2502 0.0 m \u2551
+ * \u2551 EPSG: False easting \u2502 Double \u2502 Mandatory \u2502 (\u2212\u221e \u2026 \u221e) m \u2502 0.0 m \u2551
* \u2551 OGC: false_easting \u2502 \u2502 \u2502 \u2502 \u2551
* \u255f\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2562
- * \u2551 EPSG: False northing \u2502 Double \u2502 Mandatory \u2502 (-\u221e \u2026 \u221e) m \u2502 0.0 m \u2551
+ * \u2551 EPSG: False northing \u2502 Double \u2502 Mandatory \u2502 (\u2212\u221e \u2026 \u221e) m \u2502 0.0 m \u2551
* \u2551 OGC: false_northing \u2502 \u2502 \u2502 \u2502 \u2551
* \u255a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2567\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255d
* }
@@ -191,8 +191,8 @@ public class ParameterFormat extends Tab
* \u2502 Latitude of natural origin \u2502 Double \u2502 Mandatory \u2502 [-80 \u2026 84]� \u2502 0.0� \u2502
* \u2502 Longitude of natural origin \u2502 Double \u2502 Mandatory \u2502 [-180 \u2026 180]� \u2502 0.0� \u2502
* \u2502 Scale factor at natural origin \u2502 Double \u2502 Mandatory \u2502 (0 \u2026 \u221e) \u2502 1.0 \u2502
- * \u2502 False easting \u2502 Double \u2502 Mandatory \u2502 (-\u221e \u2026 \u221e) m \u2502 0.0 m \u2502
- * \u2502 False northing \u2502 Double \u2502 Mandatory \u2502 (-\u221e \u2026 \u221e) m \u2502 0.0 m \u2502
+ * \u2502 False easting \u2502 Double \u2502 Mandatory \u2502 (\u2212\u221e \u2026 \u221e) m \u2502 0.0 m \u2502
+ * \u2502 False northing \u2502 Double \u2502 Mandatory \u2502 (\u2212\u221e \u2026 \u221e) m \u2502 0.0 m \u2502
* \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518
* }
* </div>
Modified: sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java
URL: http://svn.apache.org/viewvc/sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java?rev=1773274&r1=1773273&r2=1773274&view=diff
==============================================================================
--- sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java [UTF-8] (original)
+++ sis/trunk/core/sis-referencing/src/main/java/org/apache/sis/parameter/Verifier.java [UTF-8] Thu Dec 8 17:42:51 2016
@@ -101,10 +101,10 @@ final class Verifier {
* @param <T> The type of parameter value. The given {@code value} should typically be an instance of this class.
* This is not required by this method signature but is checked by this method implementation.
*
- * @param descriptor The parameter descriptor to check against.
- * @param value The value to check, or {@code null}.
- * @param unit The unit of the value to check, or {@code null}.
- * @return The given value converted to the descriptor unit if any,
+ * @param descriptor the parameter descriptor to check against.
+ * @param value the value to check, or {@code null}.
+ * @param unit the unit of the value to check, or {@code null}.
+ * @return the given value converted to the descriptor unit if any,
* then casted to the descriptor parameterized type.
* @throws InvalidParameterValueException if the parameter value is invalid.
*/
@@ -232,7 +232,7 @@ final class Verifier {
* Compares the given value against the given descriptor properties. If the value is valid, returns {@code null}.
* Otherwise returns an object that can be used for formatting the error message.
*
- * @param convertedValue The value <em>converted to the units specified by the descriptor</em>.
+ * @param convertedValue the value <em>converted to the units specified by the descriptor</em>.
* This is not necessarily the user-provided value.
*/
@SuppressWarnings("unchecked")
@@ -279,7 +279,7 @@ final class Verifier {
* because the type returned by {@link ParameterDescriptor#getMinimumValue()} and {@code getMaximumValue()}
* methods (namely {@code Comparable<T>}) does not allow usage with arrays.</div>
*
- * @param convertedValue The value <em>converted to the units specified by the descriptor</em>.
+ * @param convertedValue the value <em>converted to the units specified by the descriptor</em>.
* This is not necessarily the user-provided value.
*/
@SuppressWarnings("unchecked")
@@ -305,15 +305,15 @@ final class Verifier {
* Converts the information about an "value out of range" error. The range in the error message will be formatted
* in the unit given by the user, which is not necessarily the same than the unit of the parameter descriptor.
*
- * @param converter The conversion from user unit to descriptor unit, or {@code null} if none. This method
- * uses the inverse of that conversion for converting the given minimum and maximum values.
+ * @param converter the conversion from user unit to descriptor unit, or {@code null} if none.
+ * This method uses the inverse of that conversion for converting the given minimum and maximum values.
*/
private void convertRange(UnitConverter converter) {
if (converter != null && !internal && errorKey == Errors.Keys.ValueOutOfRange_4) {
converter = converter.inverse();
Object minimumValue = arguments[1];
Object maximumValue = arguments[2];
- minimumValue = (minimumValue != null) ? converter.convert(((Number) minimumValue).doubleValue()) : "-\u221e";
+ minimumValue = (minimumValue != null) ? converter.convert(((Number) minimumValue).doubleValue()) : "\u2212\u221e";
maximumValue = (maximumValue != null) ? converter.convert(((Number) maximumValue).doubleValue()) : "\u221e";
arguments[1] = minimumValue;
arguments[2] = maximumValue;
@@ -340,8 +340,8 @@ final class Verifier {
* Returns an error message for the error detected by
* {@link #ensureValidValue(Class, Set, Range, Object)}.
*
- * @param name The parameter name.
- * @param value The user-supplied value (not necessarily equals to the converted value).
+ * @param name the parameter name.
+ * @param value the user-supplied value (not necessarily equals to the converted value).
*/
String message(final Map<?,?> properties, String name, Object value) {
final Object index = arguments[0];