sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 04/04: Add an example about the use of GridDerivation.sliceByRatio since its method signature is not intuitive.
Date Tue, 04 Jun 2019 16:21:30 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git

commit 41fcbd8c89df436bc0a2f03e992e542efd795a3b
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Tue Jun 4 18:20:36 2019 +0200

    Add an example about the use of GridDerivation.sliceByRatio since its method signature
is not intuitive.
---
 .../java/org/apache/sis/coverage/grid/GridDerivation.java    | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridDerivation.java
b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridDerivation.java
index 083d37d..f4af7d6 100644
--- a/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridDerivation.java
+++ b/core/sis-feature/src/main/java/org/apache/sis/coverage/grid/GridDerivation.java
@@ -823,9 +823,19 @@ public class GridDerivation {
     /**
      * Requests a grid geometry for a slice at the given relative position.
      * The relative position is specified by a ratio between 0 and 1 where 0 maps to {@linkplain
GridExtent#getLow(int) low}
-     * grid coordinates, 1 maps to {@linkplain GridExtent#getHigh(int) high grid coordinates}
and 0.5 maps the median point.
+     * grid coordinates, 1 maps to {@linkplain GridExtent#getHigh(int) high grid coordinates}
and 0.5 maps to the median position.
      * The slicing is applied on all dimensions except the specified dimensions to keep.
      *
+     * <div class="note"><b>Example:</b>
+     * given a <var>n</var>-dimensional cube, the following call creates a slice
of the two first dimensions
+     * (numbered 0 and 1, typically the dimensions of <var>x</var> and <var>y</var>
axes)
+     * located at the center (ratio 0.5) of all other dimensions (typically <var>z</var>
and/or <var>t</var> axes):
+     *
+     * {@preformat java
+     *     gridGeometry.derive().sliceByRatio(0.5, 0, 1).build();
+     * }
+     * </div>
+     *
      * @param  sliceRatio        the ratio to apply on all grid dimensions except the ones
to keep.
      * @param  dimensionsToKeep  the grid dimension to keep unchanged.
      * @return {@code this} for method call chaining.


Mime
View raw message