| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (19) --> |
| <title>DatumShiftGrid (Apache SIS 1.3 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: org.apache.sis.referencing.datum, class: DatumShiftGrid"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.referencing.datum.DatumShiftGrid class"> |
| <meta name="keywords" content="INTERPOLATED_DIMENSIONS"> |
| <meta name="keywords" content="getGridSize()"> |
| <meta name="keywords" content="getDomainOfValidity()"> |
| <meta name="keywords" content="getCoordinateUnit()"> |
| <meta name="keywords" content="getCoordinateToGrid()"> |
| <meta name="keywords" content="getTranslationDimensions()"> |
| <meta name="keywords" content="getTranslationUnit()"> |
| <meta name="keywords" content="interpolateAt()"> |
| <meta name="keywords" content="interpolateInCell()"> |
| <meta name="keywords" content="derivativeInCell()"> |
| <meta name="keywords" content="getCellValue()"> |
| <meta name="keywords" content="getCellMean()"> |
| <meta name="keywords" content="getCellPrecision()"> |
| <meta name="keywords" content="isCellValueRatio()"> |
| <meta name="keywords" content="isCellInGrid()"> |
| <meta name="keywords" content="replaceOutsideGridCoordinates()"> |
| <meta name="keywords" content="getParameterDescriptors()"> |
| <meta name="keywords" content="getParameterValues()"> |
| <meta name="keywords" content="toString()"> |
| <meta name="keywords" content="equals()"> |
| <meta name="keywords" content="hashCode()"> |
| <link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../sis.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-3.6.0.min.js"></script> |
| <script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var pathtoroot = "../../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="class-use/DatumShiftGrid.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| <ul class="sub-nav-list-small"> |
| <li> |
| <p>Summary:</p> |
| <ul> |
| <li>Nested</li> |
| <li><a href="#field-summary">Field</a></li> |
| <li><a href="#constructor-summary">Constr</a></li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| </li> |
| <li> |
| <p>Detail:</p> |
| <ul> |
| <li><a href="#field-detail">Field</a></li> |
| <li><a href="#constructor-detail">Constr</a></li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div id="navbar-sub-list"> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field-summary">Field</a> | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li><a href="#field-detail">Field</a> | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><a href="../../../../../search.html">SEARCH</a> |
| <input type="text" id="search-input" disabled placeholder="Search"> |
| <input type="reset" id="reset-button" disabled value="reset"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.sis.referencing.datum</a></div> |
| <h1 title="Class DatumShiftGrid" class="title">Class DatumShiftGrid<C extends <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a><C>,<wbr>T extends <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a><T>></h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| <div class="inheritance">DatumShiftGrid<C,<wbr>T></div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>Type Parameters:</dt> |
| <dd><code>C</code> - dimension of the coordinate unit (usually <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/quantity/Angle.html" title="class or interface in javax.measure.quantity" class="external-link"><code>Angle</code></a>).</dd> |
| <dd><code>T</code> - dimension of the translation unit (usually <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/quantity/Angle.html" title="class or interface in javax.measure.quantity" class="external-link"><code>Angle</code></a> |
| or <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/quantity/Length.html" title="class or interface in javax.measure.quantity" class="external-link"><code>Length</code></a>).</dd> |
| </dl> |
| <dl class="notes"> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public abstract class </span><span class="element-name type-name-label">DatumShiftGrid<C extends <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a><C>,<wbr>T extends <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a><T>></span> |
| <span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> |
| implements <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></span></div> |
| <div class="block">Small but non-constant translations to apply on coordinates for datum shifts or other transformation process. |
| The main purpose of this class is to encapsulate the data provided by <cite>datum shift grid files</cite> |
| like NTv2, NADCON or RGF93. But this class could also be used for other kind of transformations, |
| provided that the shifts are relatively small (otherwise algorithms may not converge). |
| |
| <p><a href="DefaultGeodeticDatum.html" title="class in org.apache.sis.referencing.datum">Geodetic datum</a> changes can be implemented by translations in geographic |
| or geocentric coordinates. Translations given by <code>DatumShiftGrid</code> instances are often, but not always, |
| applied directly on geographic coordinates (<var>λ</var>,<var>φ</var>). But some algorithms rather apply the |
| translations in geocentric coordinates (<var>X</var>,<var>Y</var>,<var>Z</var>). This <code>DatumShiftGrid</code> |
| class can describe both cases, but will be used with different <code>MathTransform</code> implementations.</p> |
| |
| <p>Steps for calculation of a translation vector:</p> |
| <ol> |
| <li>Coordinates are given in some "real world" unit. |
| The expected unit is given by <a href="#getCoordinateUnit()"><code>getCoordinateUnit()</code></a>.</li> |
| <li>Above coordinates are converted to grid indices including fractional parts. |
| That conversion is given by <a href="#getCoordinateToGrid()"><code>getCoordinateToGrid()</code></a>.</li> |
| <li>Translation vectors are interpolated at the position of above grid indices. |
| That interpolation is done by <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(…)</code></a>.</li> |
| <li>If the above translations were given as a ratio of the real translation divided by the size of grid cells, apply |
| the inverse of the conversion given at step 2. This information is given by <a href="#isCellValueRatio()"><code>isCellValueRatio()</code></a>.</li> |
| <li>The resulting translation vectors are in the unit given by <a href="#getTranslationUnit()"><code>getTranslationUnit()</code></a>.</li> |
| </ol> |
| |
| The <a href="#interpolateAt(double...)"><code>interpolateAt(…)</code></a> method performs all those steps. |
| But that method is provided only for convenience; it is not used by Apache SIS. |
| For performance reasons SIS <code>MathTransform</code> implementations perform all the above-cited steps themselves, |
| and apply the interpolated translations on coordinate values in their own step between above steps 3 and 4. |
| |
| <div class="note"><b>Use cases:</b> |
| <ul class="verbose"> |
| <li><b>Datum shift by geographic translations</b><br> |
| NADCON and NTv2 grids are defined with longitude (<var>λ</var>) and latitude (<var>φ</var>) inputs in angular |
| <em>degrees</em> and give (<var>Δλ</var>, <var>Δφ</var>) translations in angular <em>seconds</em>. |
| However, SIS stores the translation values in units of grid cell rather than angular seconds. |
| The translations will be applied by <a href="../operation/transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>InterpolatedTransform</code></a> |
| directly on the given (<var>λ</var>,<var>φ</var>) coordinates. |
| </li> |
| |
| <li><b>Datum shift by geocentric translations</b><br> |
| France interpolation grid is defined with longitude (<var>λ</var>) and latitude (<var>φ</var>) inputs in angular |
| <em>degrees</em> and gives (<var>ΔX</var>, <var>ΔY</var>, <var>ΔZ</var>) geocentric translations in <em>metres</em>. |
| Those translations will not be added directly to the given (<var>λ</var>,<var>φ</var>) coordinates since there is |
| a geographic/geocentric conversion in the middle |
| (see <a href="../operation/transform/InterpolatedGeocentricTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>InterpolatedGeocentricTransform</code></a>). |
| </li> |
| |
| <li><b>Localization grid of raster data</b><br> |
| Some remote sensing raster data are provided with a <cite>localization grid</cite> giving pixel coordinates |
| (e.g. latitude and longitude). This can be seen as a change from <a href="DefaultEngineeringDatum.html" title="class in org.apache.sis.referencing.datum">image datum</a> to <a href="DefaultGeodeticDatum.html" title="class in org.apache.sis.referencing.datum">geodetic datum</a>. The coordinate transformation process |
| can sometimes be performed by a mathematical conversion (for example an affine transform) applied as a |
| <a href="../operation/builder/LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder">first approximation</a>, |
| followed by small corrections for the residual part. |
| <code>DatumShiftGrid</code> can describe the small corrections part. |
| </li> |
| </ul></div> |
| |
| Implementations of this class shall be immutable and thread-safe. |
| |
| <h2>Number of dimensions</h2> |
| Input coordinates and translation vectors can have any number of dimensions. However, in the current implementation, |
| only the two first dimensions are used for interpolating the translation vectors. This restriction appears in the |
| following field and method signatures: |
| |
| <ul> |
| <li><a href="#INTERPOLATED_DIMENSIONS"><code>INTERPOLATED_DIMENSIONS</code></a>.</li> |
| <li><a href="#getCellValue(int,int,int)"><code>getCellValue(int, int, int)</code></a> |
| where the two last <code>int</code> values are (<var>x</var>,<var>y</var>) grid indices.</li> |
| <li><a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(double, double, double[])</code></a> |
| where the two first <code>double</code> values are (<var>x</var>,<var>y</var>) grid indices.</li> |
| <li><a href="#derivativeInCell(double,double)"><code>derivativeInCell(double, double)</code></a> |
| where the values are (<var>x</var>,<var>y</var>) grid indices.</li> |
| </ul> |
| |
| Note that the above restriction does not prevent <code>DatumShiftGrid</code> to interpolate translation vectors |
| in more than two dimensions. See the above <cite>datum shift by geocentric translations</cite> use case for |
| an example. |
| |
| <h2>Longitude wraparound</h2> |
| Some grids are defined over an area beyond the [−180° … +180°] range of longitudes. |
| For example, NADCON grid for Alaska is defined in a [−194° … −127.875°] range, |
| in which case a longitude of 170° needs to be replaced by −190° before it can be processed by the grid. |
| The default <code>DatumShiftGrid</code> class does not apply longitude wraparound automatically |
| (it does not even know which axis, if any, is longitude), |
| but subclasses can add this support by overriding the <a href="#replaceOutsideGridCoordinates(double%5B%5D)"><code>replaceOutsideGridCoordinates(double[])</code></a> method. |
| |
| <h2>Sub-grids</h2> |
| Some datum shift grid files provide a grid valid on a wide region, refined with denser sub-grids in smaller regions. |
| For each point to transform, the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>MathTransform</code></a> should search and use the |
| densest sub-grid containing the point. This functionality is not supported directly by <code>DatumShiftGrid</code>, |
| but can be achieved by organizing many transforms in a tree. The first step is to create an instance of |
| <a href="../operation/transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>InterpolatedTransform</code></a> for each <code>DatumShiftGrid</code>. |
| Then, those transforms with their domain of validity can be given to |
| <a href="../operation/transform/MathTransforms.html#specialize(org.opengis.referencing.operation.MathTransform,java.util.Map)"><code>MathTransforms.specialize(…)</code></a>. |
| |
| <h2>Serialization</h2> |
| Serialized objects of this class are not guaranteed to be compatible with future Apache SIS releases. |
| Serialization support is appropriate for short term storage or RMI between applications running the |
| same version of Apache SIS. But for long term storage, an established datum shift grid format like |
| NTv2 should be preferred.</div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>0.7</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../operation/transform/DatumShiftTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>DatumShiftTransform</code></a></li> |
| <li><a href="../../../../../serialized-form.html#org.apache.sis.referencing.datum.DatumShiftGrid">Serialized Form</a></li> |
| </ul> |
| </dd> |
| |
| <p><font size="-1">Defined in the <code>sis-referencing</code> module</font></p> |
| </dl> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li> |
| <section class="field-summary" id="field-summary"> |
| <h2>Field Summary</h2> |
| <div class="caption"><span>Fields</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Field</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>protected static final int</code></div> |
| <div class="col-second even-row-color"><code><a href="#INTERPOLATED_DIMENSIONS" class="member-name-link">INTERPOLATED_DIMENSIONS</a></code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Number of source dimensions in which interpolations are applied.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier</div> |
| <div class="table-header col-second">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>protected </code></div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(javax.measure.Unit,org.apache.sis.referencing.operation.transform.LinearTransform,int%5B%5D,boolean,javax.measure.Unit)" class="member-name-link">DatumShiftGrid</a><wbr>(<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>> coordinateUnit, |
| <a href="../operation/transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a> coordinateToGrid, |
| int[] gridSize, |
| boolean isCellValueRatio, |
| <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>> translationUnit)</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Creates a new datum shift grid for the given size and units.</div> |
| </div> |
| <div class="col-first odd-row-color"><code>protected </code></div> |
| <div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.referencing.datum.DatumShiftGrid)" class="member-name-link">DatumShiftGrid</a><wbr>(<a href="DatumShiftGrid.html" title="class in org.apache.sis.referencing.datum">DatumShiftGrid</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>,<wbr><a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>> other)</code></div> |
| <div class="col-last odd-row-color"> |
| <div class="block">Creates a new datum shift grid with the same grid geometry (size and units) than the given grid.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="table-tab">Abstract Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel"> |
| <div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#derivativeInCell(double,double)" class="member-name-link">derivativeInCell</a><wbr>(double gridX, |
| double gridY)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Estimates the derivative at the given grid indices.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#equals(java.lang.Object)" class="member-name-link">equals</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> other)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns <code>true</code> if the given object is a grid containing the same data than this grid.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCellMean(int)" class="member-name-link">getCellMean</a><wbr>(int dim)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns an average translation value for the given dimension.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract double</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getCellPrecision()" class="member-name-link">getCellPrecision</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns an estimation of cell value precision (not to be confused with accuracy).</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract double</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getCellValue(int,int,int)" class="member-name-link">getCellValue</a><wbr>(int dim, |
| int gridX, |
| int gridY)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns the translation stored at the given two-dimensional grid indices for the given dimension.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../operation/transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCoordinateToGrid()" class="member-name-link">getCoordinateToGrid</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the conversion from the source coordinates (in "real world" units) to grid indices.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCoordinateUnit()" class="member-name-link">getCoordinateUnit</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the unit of measurement of input values, before conversion to grid indices.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDomainOfValidity()" class="member-name-link">getDomainOfValidity</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the domain of validity of input coordinates that can be specified to the |
| <a href="#interpolateAt(double...)"><code>interpolateAt(…)</code></a> method.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDomainOfValidity(javax.measure.Unit)" class="member-name-link">getDomainOfValidity</a><wbr>(<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>> unit)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the domain of validity converted to the specified unit of measurement.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int[]</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getGridSize()" class="member-name-link">getGridSize</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the number of cells along each axis in the grid.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getGridSize(int)" class="member-name-link">getGridSize</a><wbr>(int dimension)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the number of cells in the specified dimension.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/parameter/ParameterDescriptorGroup.html" title="class or interface in org.opengis.parameter" class="external-link">ParameterDescriptorGroup</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getParameterDescriptors()" class="member-name-link">getParameterDescriptors</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns a description of the values in this grid.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getParameterValues(org.apache.sis.parameter.Parameters)" class="member-name-link">getParameterValues</a><wbr>(<a href="../../parameter/Parameters.html" title="class in org.apache.sis.parameter">Parameters</a> parameters)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Gets the parameter values for the grids and stores them in the provided <code>parameters</code> group.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code>abstract int</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"><code><a href="#getTranslationDimensions()" class="member-name-link">getTranslationDimensions</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab3"> |
| <div class="block">Returns the number of dimensions of the translation vectors interpolated by this datum shift grid.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getTranslationUnit()" class="member-name-link">getTranslationUnit</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the unit of measurement of output values, as interpolated by the <code>interpolateAt(…)</code> method.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hashCode()" class="member-name-link">hashCode</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns a hash code value for this datum shift grid.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double[]</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#interpolateAt(double...)" class="member-name-link">interpolateAt</a><wbr>(double... coordinates)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Interpolates the translation to apply for the given coordinates.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#interpolateInCell(double,double,double%5B%5D)" class="member-name-link">interpolateInCell</a><wbr>(double gridX, |
| double gridY, |
| double[] vector)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Interpolates the translation to apply for the given two-dimensional grid indices.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isCellInGrid(double,double)" class="member-name-link">isCellInGrid</a><wbr>(double gridX, |
| double gridY)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns <code>true</code> if the given grid coordinates is inside this grid.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isCellValueRatio()" class="member-name-link">isCellValueRatio</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns <code>true</code> if the translation values in the cells are divided by the cell size.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#replaceOutsideGridCoordinates(double%5B%5D)" class="member-name-link">replaceOutsideGridCoordinates</a><wbr>(double[] gridCoordinates)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Invoked when a <code>gridX</code> or <code>gridY</code> coordinate is outside the range of valid grid coordinates.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">toString</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns a string representation of this <code>DatumShiftGrid</code> for debugging purposes.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-Object">Methods inherited from class <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <li> |
| <section class="field-details" id="field-detail"> |
| <h2>Field Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="INTERPOLATED_DIMENSIONS"> |
| <h3>INTERPOLATED_DIMENSIONS</h3> |
| <div class="member-signature"><span class="modifiers">protected static final</span> <span class="return-type">int</span> <span class="element-name">INTERPOLATED_DIMENSIONS</span></div> |
| <div class="block">Number of source dimensions in which interpolations are applied. The grids may have more dimensions, |
| but only this number of dimensions will be used in interpolations. The value of this field is set to |
| 2. That value is hard-coded not only in this field, but also in signature of various methods |
| expecting a two-dimensional (<var>x</var>, <var>y</var>) position: |
| <code><a href="#getCellValue(int,int,int)">getCellValue</a>(…, x, y)</code>, |
| <code><a href="#interpolateInCell(double,double,double%5B%5D)">interpolateInCell</a>(x, y, …)</code>, |
| <code><a href="#derivativeInCell(double,double)">derivativeInCell</a>(x, y)</code>. |
| |
| <div class="note"><b>Future evolution:</b> |
| if this class is generalized to more source dimensions in a future Apache SIS version, then this field |
| may be deprecated or its value changed. That change would be accompanied by new methods with different |
| signature. This field can be used as a way to detect that such change occurred.</div></div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../../../../../constant-values.html#org.apache.sis.referencing.datum.DatumShiftGrid.INTERPOLATED_DIMENSIONS">Constant Field Values</a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>(javax.measure.Unit,org.apache.sis.referencing.operation.transform.LinearTransform,int[],boolean,javax.measure.Unit)"> |
| <h3>DatumShiftGrid</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="element-name">DatumShiftGrid</span><wbr><span class="parameters">(<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>> coordinateUnit, |
| <a href="../operation/transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a> coordinateToGrid, |
| int[] gridSize, |
| boolean isCellValueRatio, |
| <a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>> translationUnit)</span></div> |
| <div class="block">Creates a new datum shift grid for the given size and units. |
| The actual cell values need to be provided by subclasses. |
| |
| <p>Meaning of argument values is documented more extensively in <a href="#getCoordinateUnit()"><code>getCoordinateUnit()</code></a>, |
| <a href="#getCoordinateToGrid()"><code>getCoordinateToGrid()</code></a>, <a href="#isCellValueRatio()"><code>isCellValueRatio()</code></a> and <a href="#getTranslationUnit()"><code>getTranslationUnit()</code></a> |
| methods. The argument order is roughly the order in which they are used in the process of |
| interpolating translation vectors.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>coordinateUnit</code> - the unit of measurement of input values, before conversion to grid indices by <code>coordinateToGrid</code>.</dd> |
| <dd><code>coordinateToGrid</code> - conversion from the "real world" coordinates to grid indices including fractional parts.</dd> |
| <dd><code>gridSize</code> - number of cells along each axis in the grid. The length of this array shall be equal to <code>coordinateToGrid</code> target dimensions.</dd> |
| <dd><code>isCellValueRatio</code> - <code>true</code> if results of <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(…)</code></a> are divided by grid cell size.</dd> |
| <dd><code>translationUnit</code> - the unit of measurement of output values.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="<init>(org.apache.sis.referencing.datum.DatumShiftGrid)"> |
| <h3>DatumShiftGrid</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="element-name">DatumShiftGrid</span><wbr><span class="parameters">(<a href="DatumShiftGrid.html" title="class in org.apache.sis.referencing.datum">DatumShiftGrid</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>,<wbr><a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>> other)</span></div> |
| <div class="block">Creates a new datum shift grid with the same grid geometry (size and units) than the given grid.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>other</code> - the other datum shift grid from which to copy the grid geometry.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="getGridSize()"> |
| <h3>getGridSize</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int[]</span> <span class="element-name">getGridSize</span>()</div> |
| <div class="block">Returns the number of cells along each axis in the grid. |
| The length of this array is the number of grid dimensions, which is typically <a href="#INTERPOLATED_DIMENSIONS">2</a>. |
| The grid dimensions shall be equal to <a href="#getCoordinateToGrid()"><code>coordinateToGrid</code></a> target dimensions. |
| |
| <div class="note"><b>Note:</b> the number of grid dimensions is not necessarily equal to the |
| <a href="#getTranslationDimensions()">number of dimension of the translation vectors</a>.</div></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the number of cells along each axis in the grid.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getGridSize(int)"> |
| <h3>getGridSize</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getGridSize</span><wbr><span class="parameters">(int dimension)</span></div> |
| <div class="block">Returns the number of cells in the specified dimension. |
| Invoking this method is equivalent to <code>getGridSize()[dimension]</code>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>dimension</code> - the dimension for which to get the grid size.</dd> |
| <dt>Returns:</dt> |
| <dd>the number of grid cells in the specified dimension.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is out of bounds.</dd> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getDomainOfValidity()"> |
| <h3>getDomainOfValidity</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a></span> <span class="element-name">getDomainOfValidity</span>() |
| throws <span class="exceptions"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">TransformException</a></span></div> |
| <div class="block">Returns the domain of validity of input coordinates that can be specified to the |
| <a href="#interpolateAt(double...)"><code>interpolateAt(…)</code></a> method. Coordinates outside that domain |
| will still be accepted, but results may be extrapolations far from reality. |
| This method does not take in account longitude wraparound |
| (i.e. the returned envelope may cross the ±180° meridian). |
| |
| <p>The envelope coordinates are computed at cell centers; the envelope does not contain |
| the margin of 0.5 cell between cell center and cell border at the edges of the envelope. |
| The unit of measurement for the coordinate values in the returned envelope is given by |
| <a href="#getCoordinateUnit()"><code>getCoordinateUnit()</code></a>. The envelope CRS is not set, but its value is implicitly |
| the CRS of grid input coordinates.</p></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the domain covered by this grid.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">TransformException</a></code> - if an error occurred while computing the envelope.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getDomainOfValidity(javax.measure.Unit)"> |
| <h3>getDomainOfValidity</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a></span> <span class="element-name">getDomainOfValidity</span><wbr><span class="parameters">(<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>> unit)</span> |
| throws <span class="exceptions"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">TransformException</a></span></div> |
| <div class="block">Returns the domain of validity converted to the specified unit of measurement. |
| A common use case for this method is for converting the domain of a NADCON or |
| NTv2 datum shift grid file, which are expressed in <a href="../../measure/Units.html#ARC_SECOND"><code>Units.ARC_SECOND</code></a>, |
| to <a href="../../measure/Units.html#DEGREE"><code>Units.DEGREE</code></a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>unit</code> - the desired unit of measurement.</dd> |
| <dt>Returns:</dt> |
| <dd>the domain covered by this grid, converted to the given unit of measurement.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">TransformException</a></code> - if an error occurred while computing the envelope.</dd> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCoordinateUnit()"> |
| <h3>getCoordinateUnit</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>></span> <span class="element-name">getCoordinateUnit</span>()</div> |
| <div class="block">Returns the unit of measurement of input values, before conversion to grid indices. |
| The coordinate unit is usually <a href="../../measure/Units.html#DEGREE"><code>Units.DEGREE</code></a>, but other units are allowed.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the unit of measurement of input values before conversion to grid indices.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#getTranslationUnit()"><code>getTranslationUnit()</code></a></li> |
| <li><a href="../operation/AbstractCoordinateOperation.html#getInterpolationCRS()"><code>AbstractCoordinateOperation.getInterpolationCRS()</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCoordinateToGrid()"> |
| <h3>getCoordinateToGrid</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../operation/transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a></span> <span class="element-name">getCoordinateToGrid</span>()</div> |
| <div class="block">Returns the conversion from the source coordinates (in "real world" units) to grid indices. |
| The input coordinates given to the <a href="../operation/transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform"><code>LinearTransform</code></a> shall be in the unit of measurement |
| given by <a href="#getCoordinateUnit()"><code>getCoordinateUnit()</code></a>. The output coordinates are grid indices as real numbers |
| (i.e. can have a fractional part). Integer grid indices are located in the center of grid cells, |
| i.e. the transform uses <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html#CELL_CENTER" title="class or interface in org.opengis.referencing.datum" class="external-link"><code>PixelInCell.CELL_CENTER</code></a> convention. |
| |
| <p>This transform is usually two-dimensional, in which case conversions from (<var>x</var>,<var>y</var>) |
| coordinates to (<code>gridX</code>, <code>gridY</code>) indices can be done with the following formulas:</p> |
| <ul> |
| <li><var>gridX</var> = (<var>x</var> - <var>x₀</var>) / <var>Δx</var></li> |
| <li><var>gridY</var> = (<var>y</var> - <var>y₀</var>) / <var>Δy</var></li> |
| </ul> |
| |
| where: |
| <ul> |
| <li>(<var>x₀</var>, <var>y₀</var>) is the coordinate of the center of the cell at grid index (0,0).</li> |
| <li><var>Δx</var> and <var>Δy</var> are the distances between two cells on the <var>x</var> and <var>y</var> |
| axes respectively, in the unit of measurement given by <a href="#getCoordinateUnit()"><code>getCoordinateUnit()</code></a>.</li> |
| </ul> |
| |
| The <code>coordinateToGrid</code> transform for the above formulas can be represented by the following matrix: |
| |
| <blockquote><pre>┌ ┐ |
| │ 1/Δx 0 -<var>x</var>₀/Δx │ |
| │ 0 1/Δy -<var>y</var>₀/Δy │ |
| │ 0 0 1 │ |
| └ ┘</pre></blockquote></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>conversion from the "real world" coordinates to grid indices including fractional parts.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getTranslationDimensions()"> |
| <h3>getTranslationDimensions</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type">int</span> <span class="element-name">getTranslationDimensions</span>()</div> |
| <div class="block">Returns the number of dimensions of the translation vectors interpolated by this datum shift grid. |
| This number of dimensions is not necessarily equals to the number of source or target dimensions |
| of the "<a href="#getCoordinateToGrid()">coordinate to grid</a>" transform. |
| The number of translation dimensions is usually 2 or 3, but other values are allowed.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>number of dimensions of translation vectors.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getTranslationUnit()"> |
| <h3>getTranslationUnit</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Unit.html" title="class or interface in javax.measure" class="external-link">Unit</a><<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>></span> <span class="element-name">getTranslationUnit</span>()</div> |
| <div class="block">Returns the unit of measurement of output values, as interpolated by the <code>interpolateAt(…)</code> method. |
| Apache SIS <code>MathTransform</code> implementations restrict the translation units to the following values: |
| |
| <ul> |
| <li>For <a href="../operation/transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>InterpolatedTransform</code></a>, the translation |
| unit shall be the same than the <a href="#getCoordinateUnit()">coordinate unit</a>.</li> |
| <li>For <a href="../operation/transform/InterpolatedGeocentricTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>InterpolatedGeocentricTransform</code></a>, |
| the translation unit shall be the same than the unit of source ellipsoid axis lengths.</li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the unit of measurement of output values interpolated by <code>interpolateAt(…)</code>.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="#getCoordinateUnit()"><code>getCoordinateUnit()</code></a></li> |
| <li><a href="#interpolateAt(double...)"><code>interpolateAt(double...)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="interpolateAt(double...)"> |
| <h3>interpolateAt</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">double[]</span> <span class="element-name">interpolateAt</span><wbr><span class="parameters">(double... coordinates)</span> |
| throws <span class="exceptions"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">TransformException</a></span></div> |
| <div class="block">Interpolates the translation to apply for the given coordinates. |
| The input values are in the unit given by <a href="#getCoordinateUnit()"><code>getCoordinateUnit()</code></a>. |
| The output values are in the unit given by <a href="#getTranslationUnit()"><code>getTranslationUnit()</code></a>. |
| The length of the returned array is given by <a href="#getTranslationDimensions()"><code>getTranslationDimensions()</code></a>. |
| |
| <h4>Default implementation</h4> |
| The default implementation performs the following steps: |
| <ol> |
| <li>Convert the given coordinate into grid indices using the transform given by <a href="#getCoordinateToGrid()"><code>getCoordinateToGrid()</code></a>.</li> |
| <li>Interpolate the translation vector at the above grid indices with a call to <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(double, double, double[])</code></a>.</li> |
| <li>If <a href="#isCellValueRatio()"><code>isCellValueRatio()</code></a> returns <code>true</code>, <a href="../operation/transform/LinearTransform.html#deltaTransform(double%5B%5D,int,double%5B%5D,int,int)">delta transform</a> |
| the translation vector by the inverse of the conversion given at step 1.</li> |
| </ol> |
| |
| If the give point is outside this grid, then this method returns the vector at the closest position in the grid |
| as documented in <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(double, double, double[])</code></a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>coordinates</code> - the "real world" coordinate (often longitude and latitude, but not necessarily) |
| of the point for which to get the translation.</dd> |
| <dt>Returns:</dt> |
| <dd>the translation vector at the given position.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">TransformException</a></code> - if an error occurred while computing the translation vector.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="interpolateInCell(double,double,double[])"> |
| <h3>interpolateInCell</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">interpolateInCell</span><wbr><span class="parameters">(double gridX, |
| double gridY, |
| double[] vector)</span></div> |
| <div class="block">Interpolates the translation to apply for the given two-dimensional grid indices. The result is stored in |
| the given <code>vector</code> array, which shall have a length of at least <a href="#getTranslationDimensions()"><code>getTranslationDimensions()</code></a>. |
| The output unit of measurement is the same than the one documented in <a href="#getCellValue(int,int,int)"><code>getCellValue(int, int, int)</code></a>. |
| |
| <h4>Extrapolations</h4> |
| If the given coordinates are outside this grid, then this method computes the translation vector at the |
| closest position in the grid. Applying translations on points outside the grid is a kind of extrapolation, |
| but some amount of extrapolations are necessary for operations like transforming an envelope before to compute |
| its intersection with another envelope. |
| |
| <h4>Derivative (Jacobian matrix)</h4> |
| If the length of the given array is at least <var>n</var> + 4 where <var>n</var> = <a href="#getTranslationDimensions()"><code>getTranslationDimensions()</code></a>, |
| then this method appends the derivative (approximated) at the given grid indices. This is the same derivative than the |
| one computed by <a href="#derivativeInCell(double,double)"><code>derivativeInCell(double, double)</code></a>, opportunistically computed here for performance reasons. |
| The matrix layout is as below, where <var>t₀</var> and <var>t₁</var> are the coordinates after translation. |
| |
| <blockquote><pre>┌ ┐ ┌ ┐ |
| │ ∂<var>t</var>₀/∂<var>x</var> ∂<var>t</var>₀/∂<var>y</var> │ = │ vector[<var>n</var>+0] vector[<var>n</var>+1] │ |
| │ ∂<var>t</var>₁/∂<var>x</var> ∂<var>t</var>₁/∂<var>y</var> │ │ vector[<var>n</var>+2] vector[<var>n</var>+3] │ |
| └ ┘ └ ┘</pre></blockquote> |
| |
| <h4>Default implementation</h4> |
| The default implementation performs the following steps for each dimension <var>dim</var>, |
| where the number of dimension is determined by <a href="#getTranslationDimensions()"><code>getTranslationDimensions()</code></a>. |
| |
| <ol> |
| <li>Clamp the <code>gridX</code> index into the [0 … <code>gridSize[0]</code> - 1] range, inclusive.</li> |
| <li>Clamp the <code>gridY</code> index into the [0 … <code>gridSize[1]</code> - 1] range, inclusive.</li> |
| <li>Using <a href="#getCellValue(int,int,int)"><code>getCellValue(int, int, int)</code></a>, get the cell values around the given indices.</li> |
| <li>Apply a bilinear interpolation and store the result in <code>vector[dim]</code>.</li> |
| <li>Appends Jacobian matrix coefficients if the <code>vector</code> length is sufficient.</li> |
| </ol></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>gridX</code> - first grid coordinate of the point for which to get the translation.</dd> |
| <dd><code>gridY</code> - second grid coordinate of the point for which to get the translation.</dd> |
| <dd><code>vector</code> - a pre-allocated array where to write the translation vector.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#isCellInGrid(double,double)"><code>isCellInGrid(double, double)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="derivativeInCell(double,double)"> |
| <h3>derivativeInCell</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Matrix</a></span> <span class="element-name">derivativeInCell</span><wbr><span class="parameters">(double gridX, |
| double gridY)</span></div> |
| <div class="block">Estimates the derivative at the given grid indices. Derivatives must be consistent with values given by |
| <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(double, double, double[])</code></a> at adjacent positions. For a two-dimensional grid, |
| <code>tₐ(x,y)</code> an abbreviation for <code>interpolateInCell(gridX, gridY, …)[a]</code> and for <var>x</var> |
| and <var>y</var> integers, the derivative is: |
| |
| <blockquote><pre>┌ ┐ ┌ ┐ |
| │ ∂<var>t</var>₀/∂<var>x</var> ∂<var>t</var>₀/∂<var>y</var> │ = │ <var>t</var>₀(<var>x</var>+1,<var>y</var>) - <var>t</var>₀(<var>x</var>,<var>y</var>) + 1 <var>t</var>₀(<var>x</var>,<var>y</var>+1) - <var>t</var>₀(<var>x</var>,<var>y</var>) │ |
| │ ∂<var>t</var>₁/∂<var>x</var> ∂<var>t</var>₁/∂<var>y</var> │ │ <var>t</var>₁(<var>x</var>+1,<var>y</var>) - <var>t</var>₁(<var>x</var>,<var>y</var>) <var>t</var>₁(<var>x</var>,<var>y</var>+1) - <var>t</var>₁(<var>x</var>,<var>y</var>) + 1 │ |
| └ ┘ └ ┘</pre></blockquote> |
| |
| <h4>Extrapolations</h4> |
| Derivatives must be consistent with <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(double, double, double[])</code></a> even when the |
| given coordinates are outside the grid. The <code>interpolateInCell(…)</code> contract in such cases is to |
| compute the translation vector at the closest position in the grid. A consequence of this contract is |
| that translation vectors stay constant when moving along at least one direction outside the grid. |
| Consequences on the derivative matrix are as below: |
| |
| <ul> |
| <li>If both <code>gridX</code> and <code>gridY</code> are outside the grid, then the derivative is the identity matrix.</li> |
| <li>If only <code>gridX</code> is outside the grid, then only the first column is set to [1, 0, …]. |
| The second column is set to the derivative of the closest cell at <code>gridY</code> position.</li> |
| <li>If only <code>gridY</code> is outside the grid, then only the second column is set to [0, 1, …]. |
| The first column is set to the derivative of the closest cell at <code>gridX</code> position.</li> |
| </ul></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>gridX</code> - first grid coordinate of the point for which to get the translation.</dd> |
| <dd><code>gridY</code> - second grid coordinate of the point for which to get the translation.</dd> |
| <dt>Returns:</dt> |
| <dd>the derivative at the given location.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#isCellInGrid(double,double)"><code>isCellInGrid(double, double)</code></a></li> |
| <li><a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(double, double, double[])</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCellValue(int,int,int)"> |
| <h3>getCellValue</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type">double</span> <span class="element-name">getCellValue</span><wbr><span class="parameters">(int dim, |
| int gridX, |
| int gridY)</span></div> |
| <div class="block">Returns the translation stored at the given two-dimensional grid indices for the given dimension. |
| The returned value is considered representative of the value in the center of the grid cell. |
| The output unit of measurement depends on the <a href="#isCellValueRatio()"><code>isCellValueRatio()</code></a> boolean: |
| |
| <ul> |
| <li>If <code>false</code>, the value returned by this method shall be in the unit of measurement |
| given by <a href="#getTranslationUnit()"><code>getTranslationUnit()</code></a>.</li> |
| <li>If <code>true</code>, the value returned by this method is the ratio of the translation divided by the |
| distance between grid cells in the <var>dim</var> dimension (<var>Δx</var> or <var>Δy</var> in the |
| <a href="#%3Cinit%3E(javax.measure.Unit,org.apache.sis.referencing.operation.transform.LinearTransform,int%5B%5D,boolean,javax.measure.Unit)">constructor javadoc</a>).</li> |
| </ul> |
| |
| Caller must ensure that all arguments given to this method are in their expected ranges. |
| The behavior of this method is undefined if any argument value is out-of-range. |
| (this method is not required to validate arguments, for performance reasons).</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>dim</code> - the dimension of the translation vector component to get, |
| from 0 inclusive to <a href="#getTranslationDimensions()"><code>getTranslationDimensions()</code></a> exclusive.</dd> |
| <dd><code>gridX</code> - the grid index on the <var>x</var> axis, from 0 inclusive to <code>gridSize[0]</code> exclusive.</dd> |
| <dd><code>gridY</code> - the grid index on the <var>y</var> axis, from 0 inclusive to <code>gridSize[1]</code> exclusive.</dd> |
| <dt>Returns:</dt> |
| <dd>the translation for the given dimension in the grid cell at the given index.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - may be thrown (but is not guaranteed to be throw) if an argument is out of range.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCellMean(int)"> |
| <h3>getCellMean</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">double</span> <span class="element-name">getCellMean</span><wbr><span class="parameters">(int dim)</span></div> |
| <div class="block">Returns an average translation value for the given dimension. |
| Those average values shall provide a good "first guess" before to interpolate the actual translation value |
| at the (<var>x</var>,<var>y</var>) coordinate. This "first guess" is needed for inverse transform. |
| |
| <h4>Default implementation</h4> |
| The default implementation computes the average of all values returned by |
| <a href="#getCellValue(int,int,int)"><code>getCellValue(dim, …)</code></a>, but subclasses may override with more specific values. |
| |
| <div class="note"><b>Example:</b> |
| In the <cite>"France geocentric interpolation"</cite> (ESPG:9655) operation method, those "average" values |
| are fixed by definition to -168, -60 and +320 metres for dimensions 0, 1 and 2 respectively |
| (geocentric <var>X</var>, <var>Y</var> and <var>Z</var>).</div></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>dim</code> - the dimension for which to get an average translation value, |
| from 0 inclusive to <a href="#getTranslationDimensions()"><code>getTranslationDimensions()</code></a> exclusive.</dd> |
| <dt>Returns:</dt> |
| <dd>a translation value close to the average for the given dimension.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCellPrecision()"> |
| <h3>getCellPrecision</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type">double</span> <span class="element-name">getCellPrecision</span>()</div> |
| <div class="block">Returns an estimation of cell value precision (not to be confused with accuracy). |
| This information can be determined in different ways: |
| |
| <ul> |
| <li>If the data are read from an ASCII file with a fixed number of digits, then a suggested value is half |
| the precision of the last digit (i.e. 0.5 × 10⁻ⁿ where <var>n</var> is the number of digits after the |
| comma).</li> |
| <li>If there is no indication about precision, then this method should return a value smaller than the |
| best accuracy found in the grid. Accuracy are often specified on a cell-by-cell basis in grid files.</li> |
| </ul> |
| |
| The output unit of measurement is the same than the one documented in <a href="#getCellValue(int,int,int)"><code>getCellValue(int, int, int)</code></a>. |
| In particular if <a href="#isCellValueRatio()"><code>isCellValueRatio()</code></a> returns <code>true</code>, then the accuracy is in |
| units of grid cell size. |
| |
| <p>This information is used for determining a tolerance threshold in iterative calculation.</p></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>an estimation of cell value precision.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isCellValueRatio()"> |
| <h3>isCellValueRatio</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isCellValueRatio</span>()</div> |
| <div class="block">Returns <code>true</code> if the translation values in the cells are divided by the cell size. |
| If <code>true</code>, then the values returned by <a href="#getCellValue(int,int,int)"><code>getCellValue(…)</code></a>, |
| <a href="#getCellMean(int)"><code>getCellMean(…)</code></a> and <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(…)</code></a> methods |
| are the ratio of the translation divided by the distance between grid cells in the requested |
| dimension (<var>Δx</var> or <var>Δy</var> in the <a href="#%3Cinit%3E(javax.measure.Unit,org.apache.sis.referencing.operation.transform.LinearTransform,int%5B%5D,boolean,javax.measure.Unit)">constructor javadoc</a>).</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the translation values in the cells are divided by the cell size.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="isCellInGrid(double,double)"> |
| <h3>isCellInGrid</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isCellInGrid</span><wbr><span class="parameters">(double gridX, |
| double gridY)</span></div> |
| <div class="block">Returns <code>true</code> if the given grid coordinates is inside this grid.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>gridX</code> - first grid coordinate of the point to test.</dd> |
| <dd><code>gridY</code> - second grid coordinate of the point to test.</dd> |
| <dt>Returns:</dt> |
| <dd>whether the given point is inside this grid.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolateInCell(double, double, double[])</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="replaceOutsideGridCoordinates(double[])"> |
| <h3>replaceOutsideGridCoordinates</h3> |
| <div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">replaceOutsideGridCoordinates</span><wbr><span class="parameters">(double[] gridCoordinates)</span></div> |
| <div class="block">Invoked when a <code>gridX</code> or <code>gridY</code> coordinate is outside the range of valid grid coordinates. |
| This method can replace the invalid coordinate by a valid one. The main purpose is to handle datum shift |
| grids crossing the anti-meridian. For example, NADCON grid for Alaska is defined in a [−194° … −127.875°] |
| longitude range, so a longitude of 170° needs to be converted to a longitude of −190° before it can be |
| processed by that grid. |
| |
| <p>The default implementation does nothing. Subclasses need to override this method if they want to handle |
| longitude wraparounds. Note that the coordinate values are grid indices, not longitude or latitude values. |
| So the period to add or remove is the number of cells that the grid would have if it was spanning 360° of |
| longitude.</p> |
| |
| <div class="note"><b>Example:</b> |
| if longitude values are mapped to <code>gridX</code> coordinates (in dimension 0), and if a shift of 360° in |
| longitude values is equivalent to a shift of <code>periodX</code> cells in the grid, then this method can be |
| implemented as below: |
| |
| <blockquote><pre><font color="green">private</font> <font color="green">final</font> <font color="green">double</font> periodX = ...; <i><font color="gray">// Number of grid cells in 360° of longitude.</font></i> |
| |
| @Override |
| <font color="green">protected</font> <font color="green">void</font> <b>replaceOutsideGridCoordinates</b>(<font color="green">double</font>[] gridCoordinates) { |
| gridCoordinates[0] = Math.<b>IEEEremainder</b>(gridCoordinates[0], periodX); |
| }</pre></blockquote></div> |
| |
| This method receives all grid coordinates in the <code>gridCoordinates</code> argument and can modify any |
| of them, possibly many at once. The reason is because a shift of 360° of longitude (for example) may |
| correspond to an offset in both <code>gridX</code> and <code>gridY</code> indices if the grid is inclined. |
| The <code>gridCoordinates</code> array length is the number of grid dimensions, |
| typically <a href="#INTERPOLATED_DIMENSIONS">2</a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>gridCoordinates</code> - on input, the cell indices of the point which is outside the grid. |
| On output, the cell indices of an equivalent point inside the grid if possible. |
| Coordinate values are modified in-place.</dd> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list-long"> |
| <li><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Math.html#IEEEremainder(double,double)" title="class or interface in java.lang" class="external-link"><code>Math.IEEEremainder(double, double)</code></a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getParameterDescriptors()"> |
| <h3>getParameterDescriptors</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/parameter/ParameterDescriptorGroup.html" title="class or interface in org.opengis.parameter" class="external-link">ParameterDescriptorGroup</a></span> <span class="element-name">getParameterDescriptors</span>()</div> |
| <div class="block">Returns a description of the values in this grid. Grid values may be given directly as matrices or tensors, |
| or indirectly as name of file from which data were loaded. If grid values are given directly, then: |
| |
| <ul> |
| <li>The number of <a href="#getGridSize()">grid</a> dimensions determines the parameter type: |
| one-dimensional grids are represented by <a href="../../math/Vector.html" title="class in org.apache.sis.math"><code>Vector</code></a> instances, |
| two-dimensional grids are represented by <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Matrix</code></a> instances, |
| and grids with more than <a href="#INTERPOLATED_DIMENSIONS">2</a> are represented by tensors.</li> |
| <li>The <a href="#getTranslationDimensions()">number of dimensions of translation vectors</a> |
| determines how many matrix or tensor parameters appear.</li> |
| </ul> |
| |
| <div class="note"><b>Example 1:</b> |
| if this <code>DatumShiftGrid</code> instance has been created for performing NADCON datum shifts, |
| then this method returns a group named "NADCON" with two parameters: |
| <ul> |
| <li>A parameter of type <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a> named “Latitude difference file”.</li> |
| <li>A parameter of type <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/nio/file/Path.html" title="class or interface in java.nio.file" class="external-link"><code>Path</code></a> named “Longitude difference file”.</li> |
| </ul></div> |
| |
| <div class="note"><b>Example 2:</b> |
| if this <code>DatumShiftGrid</code> instance has been created by |
| <a href="../operation/builder/LocalizationGridBuilder.html" title="class in org.apache.sis.referencing.operation.builder"><code>LocalizationGridBuilder</code></a>, |
| then this method returns a group named "Localization grid" with four parameters: |
| <ul> |
| <li>A parameter of type <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link"><code>Integer</code></a> named “num_row” for the number of rows in each matrix.</li> |
| <li>A parameter of type <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link"><code>Integer</code></a> named “num_col” for the number of columns in each matrix.</li> |
| <li>A parameter of type <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Matrix</code></a> named “grid_x”.</li> |
| <li>A parameter of type <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/Matrix.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Matrix</code></a> named “grid_y”.</li> |
| </ul></div></div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>a description of the values in this grid.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getParameterValues(org.apache.sis.parameter.Parameters)"> |
| <h3>getParameterValues</h3> |
| <div class="member-signature"><span class="modifiers">public abstract</span> <span class="return-type">void</span> <span class="element-name">getParameterValues</span><wbr><span class="parameters">(<a href="../../parameter/Parameters.html" title="class in org.apache.sis.parameter">Parameters</a> parameters)</span></div> |
| <div class="block">Gets the parameter values for the grids and stores them in the provided <code>parameters</code> group. |
| The given <code>parameters</code> must have the descriptor returned by <a href="#getParameterDescriptors()"><code>getParameterDescriptors()</code></a>. |
| The matrices, tensors or file names are stored in the given <code>parameters</code> instance. |
| |
| <div class="note"><b>Implementation note:</b> |
| this method is invoked by <a href="../operation/transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>InterpolatedTransform</code></a> |
| and other transforms for initializing the values of their parameter group.</div></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>parameters</code> - the parameter group where to set the values.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="toString()"> |
| <h3>toString</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">toString</span>()</div> |
| <div class="block">Returns a string representation of this <code>DatumShiftGrid</code> for debugging purposes.</div> |
| <dl class="notes"> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>a string representation of this datum shift grid.</dd> |
| <dt>Since:</dt> |
| <dd>1.0</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="equals(java.lang.Object)"> |
| <h3>equals</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">equals</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> other)</span></div> |
| <div class="block">Returns <code>true</code> if the given object is a grid containing the same data than this grid. |
| Default implementation compares only the properties known to this abstract class like |
| <a href="#getGridSize()">grid size</a>, <a href="#getCoordinateUnit()">coordinate unit</a>, <i>etc.</i> |
| Subclasses need to override for adding comparison of the actual values.</div> |
| <dl class="notes"> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>other</code> - the other object to compare with this datum shift grid.</dd> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the given object is non-null, of the same class than this <code>DatumShiftGrid</code> |
| and contains the same data.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="hashCode()"> |
| <h3>hashCode</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">hashCode</span>()</div> |
| <div class="block">Returns a hash code value for this datum shift grid. |
| This method does not need to compute a hash code from all grid values. |
| Comparing some metadata like the grid filename is considered sufficient</div> |
| <dl class="notes"> |
| <dt>Overrides:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd> |
| <dt>Returns:</dt> |
| <dd>a hash code based on metadata.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 2010–2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |