Skip to content

Commit 4b998b7

Browse files
committed
Merge branch 'master' into 3.1.x
2 parents ec781af + 8cc86e4 commit 4b998b7

5 files changed

Lines changed: 51 additions & 34 deletions

File tree

geoapi-conformance/src/main/java/org/opengis/test/report/Report.java

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public abstract class Report {
116116
*/
117117
private static final String NOW;
118118
static {
119-
final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd", Locale.CANADA);
119+
final var format = new SimpleDateFormat("yyyy-MM-dd", Locale.CANADA);
120120
NOW = format.format(new Date());
121121
}
122122

@@ -226,26 +226,6 @@ final void setVendor(final String prefix, final Citation vendor) {
226226
}
227227
}
228228

229-
/**
230-
* Returns the value associated to the given key in the {@linkplain #properties} map.
231-
* If the value for the given key contains other keys, then this method will resolve
232-
* those values recursively.
233-
*
234-
* @param key the property key for which to get the value.
235-
* @return the value for the given key.
236-
* @throws NoSuchElementException if no value has been found for the given key.
237-
*/
238-
final String getProperty(final String key) throws NoSuchElementException {
239-
final StringBuilder buffer = new StringBuilder();
240-
try {
241-
writeProperty(buffer, key);
242-
} catch (IOException e) {
243-
// Should never happen, since we are appending to a StringBuilder.
244-
throw new AssertionError(e);
245-
}
246-
return buffer.toString();
247-
}
248-
249229
/**
250230
* Returns the locale to use for producing messages in the reports. The locale may be
251231
* used for fetching the character sequences from {@link InternationalString} objects,
@@ -319,7 +299,7 @@ final File toFile(File destination) {
319299
* @throws IOException if an error occurred during the copy.
320300
*/
321301
private static void copy(final String source, final File directory) throws IOException {
322-
final File file = new File(directory, source);
302+
final var file = new File(directory, source);
323303
if (file.isFile() && file.length() != 0) {
324304
return;
325305
}
@@ -353,8 +333,8 @@ final void filter(final String source, final File destination) throws IOExceptio
353333
if (in == null) {
354334
throw new FileNotFoundException("Resource not found: " + source);
355335
}
356-
final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(destination), ENCODING));
357-
final LineNumberReader reader = new LineNumberReader(new InputStreamReader(in, ENCODING));
336+
final var writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(destination), ENCODING));
337+
final var reader = new LineNumberReader(new InputStreamReader(in, ENCODING));
358338
reader.setLineNumber(1);
359339
try {
360340
String line;

geoapi-conformance/src/main/resources/org/opengis/test/report/AuthorityCodes.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
<body>
99
<div>
1010
<h1>${TITLE}</h1>
11-
<p>This list is generated from the ${FACTORY.NAME} dataset version ${FACTORY.VERSION}${FACTORY.VERSION.SUFFIX}.
12-
All those <i>${OBJECTS.KIND}</i> are supported by the <a href="${PRODUCT.URL}">${PRODUCT.NAME}</a>
11+
<p>This list is generated from the ${FACTORY.NAME} geodetic dataset version ${FACTORY.VERSION}${FACTORY.VERSION.SUFFIX}.
12+
Those <i>${OBJECTS.KIND}</i> are supported by the <a href="${PRODUCT.URL}">${PRODUCT.NAME}</a>
1313
library version ${PRODUCT.VERSION}${PRODUCT.VERSION.SUFFIX},
1414
except those with a red text in the last column.
15-
There is ${COUNT.OBJECTS} codes, ${PERCENT.VALIDS} of them being supported.</p>
15+
There are ${COUNT.OBJECTS} codes, ${PERCENT.VALIDS} of them being supported.</p>
1616

1717
${DESCRIPTION}
1818

geoapi-examples/src/main/java/org/opengis/example/metadata/MetadataHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ public Object invoke(final Object proxy, final Method method, final Object[] arg
8787
} else {
8888
// While it is technically possible to return null collection,
8989
// the common practice is to return an empty one instead.
90-
if (rt.isAssignableFrom(List.class)) value = List.of(); else
91-
if (rt.isAssignableFrom(Set .class)) value = Set.of(); else
92-
if (rt.isAssignableFrom(Map .class)) value = Map.of();
90+
if (rt.isAssignableFrom(List.class)) return List.of();
91+
if (rt.isAssignableFrom(Set .class)) return Set.of();
92+
if (rt.isAssignableFrom(Map .class)) return Map.of();
9393
}
9494
}
9595
return value;

geoapi/src/main/java/org/opengis/parameter/ParameterDescriptor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ default T getDefaultValue() {
156156

157157
/**
158158
* Returns the unit of measurement for the minimum, maximum and default values.
159-
* This attribute applies only if the value is of numeric type
160-
* (usually an instance of {@link Double}).
159+
* If units of measurement are not applicable to values of type {@code <T>},
160+
* or if the units are unknown, then this method returns {@code null}.
161161
*
162-
* @return the unit for numeric value, or {@code null} if it does not apply to the value type.
162+
* @return the unit of minimum, maximum and default values, or {@code null} if not applicable.
163163
*
164164
* @departure extension
165165
* This method is not part of ISO specification. It is provided as a complement of information.

geoapi/src/main/java/org/opengis/referencing/operation/CoordinateOperationFactory.java

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ default CoordinateOperation createOperation(CoordinateReferenceSystem sourceCRS,
189189
* The source coordinate reference system of the first step and the target coordinate reference system of the
190190
* last step are the source and target coordinate reference system associated with the concatenated operation.
191191
*
192+
* @deprecated Replaced by {@linkplain #createConcatenatedOperation(Map, CoordinateReferenceSystem,
193+
* CoordinateReferenceSystem, CoordinateOperation...) a method with explicit CRS arguments} because
194+
* of potential swapping of source/target <abbr>CRS</abbr>.
195+
*
192196
* @param properties name and other properties to give to the new object.
193197
* Available properties are {@linkplain ObjectFactory listed there}.
194198
* @param operations the sequence of operations.
@@ -199,10 +203,11 @@ default CoordinateOperation createOperation(CoordinateReferenceSystem sourceCRS,
199203
* This method has been added because OGC 01-009 does not define a factory
200204
* method for creating concatenated operations.
201205
*/
206+
@Deprecated(since = "3.1")
202207
default CoordinateOperation createConcatenatedOperation(Map<String, ?> properties,
203208
CoordinateOperation... operations) throws FactoryException
204209
{
205-
throw new UnimplementedServiceException(this, ConcatenatedOperation.class);
210+
return createConcatenatedOperation(properties, null, null, operations);
206211
}
207212

208213
/**
@@ -273,4 +278,36 @@ default OperationMethod createOperationMethod(Map<String,?> properties,
273278
{
274279
throw new UnimplementedServiceException(this, OperationMethod.class);
275280
}
281+
282+
/**
283+
* Creates an ordered sequence of two or more single coordinate operations.
284+
* The sequence of operations is constrained by the requirement that the source coordinate reference system
285+
* of step (<var>n</var>+1) must be the same as the target coordinate reference system of step (<var>n</var>).
286+
* The source coordinate reference system of the first step and the target coordinate reference system of the
287+
* last step are the source and target coordinate reference system associated with the concatenated operation.
288+
*
289+
* <p>As an exception to the above-cited constraint, a step can swap its source and target <abbr>CRS</abbr>.
290+
* In such case, the effectively executed operation will be the inverse of that step. The {@code sourceCRS}
291+
* and {@code targetCRS} arguments of this method are needed for detecting whether such swapping occurred
292+
* in the first step or in the last step. Those optional arguments can be {@code null} if the caller did
293+
* not swapped any <abbr>CRS</abbr>.</p>
294+
*
295+
* @param properties name and other properties to give to the new object.
296+
* Available properties are {@linkplain ObjectFactory listed there}.
297+
* @param sourceCRS the source <abbr>CRS</abbr>, or {@code null} for the source of the first step.
298+
* @param targetCRS the target <abbr>CRS</abbr>, or {@code null} for the target of the last effective step.
299+
* @param operations the sequence of operations. Should contain at least two operations.
300+
* @return the concatenated operation created from the given arguments.
301+
* @throws FactoryException if the object creation failed.
302+
*
303+
* @since 3.1
304+
*/
305+
default CoordinateOperation createConcatenatedOperation(
306+
Map<String,?> properties,
307+
CoordinateReferenceSystem sourceCRS,
308+
CoordinateReferenceSystem targetCRS,
309+
CoordinateOperation... operations) throws FactoryException
310+
{
311+
throw new UnimplementedServiceException(this, ConcatenatedOperation.class);
312+
}
276313
}

0 commit comments

Comments
 (0)