blob: efb3ae8b0d5d9b81f94be7bbc8272bc6ae331aec [file] [log] [blame]
<!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">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</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>&nbsp;<a href="package-summary.html">org.apache.sis.referencing.datum</a></div>
<h1 title="Class DatumShiftGrid" class="title">Class DatumShiftGrid&lt;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>&lt;C&gt;,<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>&lt;T&gt;&gt;</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&lt;C,<wbr>T&gt;</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&lt;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>&lt;C&gt;,<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>&lt;T&gt;&gt;</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>Datum­Shift­Grid</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>Datum­Shift­Grid</code>
class can describe both cases, but will be used with different <code>Math­Transform</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>get­Coordinate­Unit()</code></a>.</li>
<li>Above coordinates are converted to grid indices including fractional parts.
That conversion is given by <a href="#getCoordinateToGrid()"><code>get­Coordinate­To­Grid()</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>interpolate­In­Cell(…)</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>is­Cell­Value­Ratio()</code></a>.</li>
<li>The resulting translation vectors are in the unit given by <a href="#getTranslationUnit()"><code>get­Translation­Unit()</code></a>.</li>
</ol>
The <a href="#interpolateAt(double...)"><code>interpolate­At(…)</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>Math­Transform</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>Interpolated­Transform</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>Interpolated­Geocentric­Transform</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>Datum­Shift­Grid</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>get­Cell­Value(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>interpolate­In­Cell(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>derivative­In­Cell(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>Datum­Shift­Grid</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>Datum­Shift­Grid</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>replace­Outside­Grid­Coordinates(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>Math­Transform</code></a> should search and use the
densest sub-grid containing the point. This functionality is not supported directly by <code>Datum­Shift­Grid</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>Interpolated­Transform</code></a> for each <code>Datum­Shift­Grid</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>Math­Transforms​.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>Datum­Shift­Transform</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">Datum­Shift­Grid</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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>&gt;&nbsp;coordinate­Unit,
<a href="../operation/transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">Linear­Transform</a>&nbsp;coordinate­To­Grid,
int[]&nbsp;grid­Size,
boolean&nbsp;is­Cell­Value­Ratio,
<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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>&gt;&nbsp;translation­Unit)</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">Datum­Shift­Grid</a><wbr>(<a href="DatumShiftGrid.html" title="class in org.apache.sis.referencing.datum">Datum­Shift­Grid</a>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>,<wbr><a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>&gt;&nbsp;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">derivative­In­Cell</a><wbr>(double&nbsp;grid­X,
double&nbsp;grid­Y)</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>&nbsp;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">get­Cell­Mean</a><wbr>(int&nbsp;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">get­Cell­Precision</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">get­Cell­Value</a><wbr>(int&nbsp;dim,
int&nbsp;grid­X,
int&nbsp;grid­Y)</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">Linear­Transform</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">get­Coordinate­To­Grid</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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>&gt;</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">get­Coordinate­Unit</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">get­Domain­Of­Validity</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>interpolate­At(…)</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">get­Domain­Of­Validity</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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>&gt;&nbsp;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">get­Grid­Size</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">get­Grid­Size</a><wbr>(int&nbsp;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">Parameter­Descriptor­Group</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">get­Parameter­Descriptors</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">get­Parameter­Values</a><wbr>(<a href="../../parameter/Parameters.html" title="class in org.apache.sis.parameter">Parameters</a>&nbsp;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">get­Translation­Dimensions</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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>&gt;</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">get­Translation­Unit</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>interpolate­At(…)</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">hash­Code</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">interpolate­At</a><wbr>(double...&nbsp;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">interpolate­In­Cell</a><wbr>(double&nbsp;grid­X,
double&nbsp;grid­Y,
double[]&nbsp;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">is­Cell­In­Grid</a><wbr>(double&nbsp;grid­X,
double&nbsp;grid­Y)</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">is­Cell­Value­Ratio</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">replace­Outside­Grid­Coordinates</a><wbr>(double[]&nbsp;grid­Coordinates)</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>grid­X</code> or <code>grid­Y</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">to­String</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>Datum­Shift­Grid</code> for debugging purposes.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<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">get­Class</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">notify­All</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>&nbsp;<span class="return-type">int</span>&nbsp;<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)">get­Cell­Value</a>(…, x, y)</code>,
<code><a href="#interpolateInCell(double,double,double%5B%5D)">interpolate­In­Cell</a>(x, y, …)</code>,
<code><a href="#derivativeInCell(double,double)">derivative­In­Cell</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="&lt;init&gt;(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>&nbsp;<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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>&gt;&nbsp;coordinateUnit,
<a href="../operation/transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a>&nbsp;coordinateToGrid,
int[]&nbsp;gridSize,
boolean&nbsp;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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>&gt;&nbsp;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>get­Coordinate­Unit()</code></a>,
<a href="#getCoordinateToGrid()"><code>get­Coordinate­To­Grid()</code></a>, <a href="#isCellValueRatio()"><code>is­Cell­Value­Ratio()</code></a> and <a href="#getTranslationUnit()"><code>get­Translation­Unit()</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>coordinate­Unit</code> - the unit of measurement of input values, before conversion to grid indices by <code>coordinate­To­Grid</code>.</dd>
<dd><code>coordinate­To­Grid</code> - conversion from the "real world" coordinates to grid indices including fractional parts.</dd>
<dd><code>grid­Size</code> - number of cells along each axis in the grid. The length of this array shall be equal to <code>coordinate­To­Grid</code> target dimensions.</dd>
<dd><code>is­Cell­Value­Ratio</code> - <code>true</code> if results of <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolate­In­Cell(…)</code></a> are divided by grid cell size.</dd>
<dd><code>translation­Unit</code> - the unit of measurement of output values.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.sis.referencing.datum.DatumShiftGrid)">
<h3>DatumShiftGrid</h3>
<div class="member-signature"><span class="modifiers">protected</span>&nbsp;<span class="element-name">DatumShiftGrid</span><wbr><span class="parameters">(<a href="DatumShiftGrid.html" title="class in org.apache.sis.referencing.datum">DatumShiftGrid</a>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>,<wbr><a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>&gt;&nbsp;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>&nbsp;<span class="return-type">int[]</span>&nbsp;<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>coordinate­To­Grid</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>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getGridSize</span><wbr><span class="parameters">(int&nbsp;dimension)</span></div>
<div class="block">Returns the number of cells in the specified dimension.
Invoking this method is equivalent to <code>get­Grid­Size()[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">Index­Out­Of­Bounds­Exception</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>&nbsp;<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>&nbsp;<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>interpolate­At(…)</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>get­Coordinate­Unit()</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">Transform­Exception</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>&nbsp;<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>&nbsp;<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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>&gt;&nbsp;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">Transform­Exception</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>&nbsp;<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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">C</a>&gt;</span>&nbsp;<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>get­Translation­Unit()</code></a></li>
<li><a href="../operation/AbstractCoordinateOperation.html#getInterpolationCRS()"><code>Abstract­Coordinate­Operation​.get­Interpolation­CRS()</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>&nbsp;<span class="return-type"><a href="../operation/transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a></span>&nbsp;<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>Linear­Transform</code></a> shall be in the unit of measurement
given by <a href="#getCoordinateUnit()"><code>get­Coordinate­Unit()</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>Pixel­In­Cell​.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>grid­X</code>, <code>grid­Y</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>get­Coordinate­Unit()</code></a>.</li>
</ul>
The <code>coordinate­To­Grid</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>&nbsp;<span class="return-type">int</span>&nbsp;<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>&nbsp;<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>&lt;<a href="DatumShiftGrid.html" title="type parameter in DatumShiftGrid">T</a>&gt;</span>&nbsp;<span class="element-name">getTranslationUnit</span>()</div>
<div class="block">Returns the unit of measurement of output values, as interpolated by the <code>interpolate­At(…)</code> method.
Apache SIS <code>Math­Transform</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>Interpolated­Transform</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>Interpolated­Geocentric­Transform</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>interpolate­At(…)</code>.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#getCoordinateUnit()"><code>get­Coordinate­Unit()</code></a></li>
<li><a href="#interpolateAt(double...)"><code>interpolate­At(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>&nbsp;<span class="return-type">double[]</span>&nbsp;<span class="element-name">interpolateAt</span><wbr><span class="parameters">(double...&nbsp;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>get­Coordinate­Unit()</code></a>.
The output values are in the unit given by <a href="#getTranslationUnit()"><code>get­Translation­Unit()</code></a>.
The length of the returned array is given by <a href="#getTranslationDimensions()"><code>get­Translation­Dimensions()</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>get­Coordinate­To­Grid()</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>interpolate­In­Cell(double, double, double[])</code></a>.</li>
<li>If <a href="#isCellValueRatio()"><code>is­Cell­Value­Ratio()</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>interpolate­In­Cell(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">Transform­Exception</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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">interpolateInCell</span><wbr><span class="parameters">(double&nbsp;gridX,
double&nbsp;gridY,
double[]&nbsp;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>get­Translation­Dimensions()</code></a>.
The output unit of measurement is the same than the one documented in <a href="#getCellValue(int,int,int)"><code>get­Cell­Value(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>get­Translation­Dimensions()</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>derivative­In­Cell(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>get­Translation­Dimensions()</code></a>.
<ol>
<li>Clamp the <code>grid­X</code> index into the [0 … <code>grid­Size[0]</code> - 1] range, inclusive.</li>
<li>Clamp the <code>grid­Y</code> index into the [0 … <code>grid­Size[1]</code> - 1] range, inclusive.</li>
<li>Using <a href="#getCellValue(int,int,int)"><code>get­Cell­Value(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>grid­X</code> - first grid coordinate of the point for which to get the translation.</dd>
<dd><code>grid­Y</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>is­Cell­In­Grid(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>&nbsp;<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>&nbsp;<span class="element-name">derivativeInCell</span><wbr><span class="parameters">(double&nbsp;gridX,
double&nbsp;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>interpolate­In­Cell(double, double, double[])</code></a> at adjacent positions. For a two-dimensional grid,
<code>tₐ(x,y)</code> an abbreviation for <code>interpolate­In­Cell(grid­X, grid­Y, …)[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>interpolate­In­Cell(double, double, double[])</code></a> even when the
given coordinates are outside the grid. The <code>interpolate­In­Cell(…)</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>grid­X</code> and <code>grid­Y</code> are outside the grid, then the derivative is the identity matrix.</li>
<li>If only <code>grid­X</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>grid­Y</code> position.</li>
<li>If only <code>grid­Y</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>grid­X</code> position.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>grid­X</code> - first grid coordinate of the point for which to get the translation.</dd>
<dd><code>grid­Y</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>is­Cell­In­Grid(double, double)</code></a></li>
<li><a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolate­In­Cell(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>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getCellValue</span><wbr><span class="parameters">(int&nbsp;dim,
int&nbsp;gridX,
int&nbsp;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>is­Cell­Value­Ratio()</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>get­Translation­Unit()</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>get­Translation­Dimensions()</code></a> exclusive.</dd>
<dd><code>grid­X</code> - the grid index on the <var>x</var> axis, from 0 inclusive to <code>grid­Size[0]</code> exclusive.</dd>
<dd><code>grid­Y</code> - the grid index on the <var>y</var> axis, from 0 inclusive to <code>grid­Size[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">Index­Out­Of­Bounds­Exception</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>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getCellMean</span><wbr><span class="parameters">(int&nbsp;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>get­Cell­Value(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>get­Translation­Dimensions()</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>&nbsp;<span class="return-type">double</span>&nbsp;<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>get­Cell­Value(int, int, int)</code></a>.
In particular if <a href="#isCellValueRatio()"><code>is­Cell­Value­Ratio()</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>&nbsp;<span class="return-type">boolean</span>&nbsp;<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>get­Cell­Value(…)</code></a>,
<a href="#getCellMean(int)"><code>get­Cell­Mean(…)</code></a> and <a href="#interpolateInCell(double,double,double%5B%5D)"><code>interpolate­In­Cell(…)</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>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">isCellInGrid</span><wbr><span class="parameters">(double&nbsp;gridX,
double&nbsp;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>grid­X</code> - first grid coordinate of the point to test.</dd>
<dd><code>grid­Y</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>interpolate­In­Cell(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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">replaceOutsideGridCoordinates</span><wbr><span class="parameters">(double[]&nbsp;gridCoordinates)</span></div>
<div class="block">Invoked when a <code>grid­X</code> or <code>grid­Y</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>grid­X</code> coordinates (in dimension 0), and if a shift of 360° in
longitude values is equivalent to a shift of <code>period­X</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>grid­Coordinates</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>grid­X</code> and <code>grid­Y</code> indices if the grid is inclined.
The <code>grid­Coordinates</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>grid­Coordinates</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>&nbsp;<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>&nbsp;<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>Datum­Shift­Grid</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>Datum­Shift­Grid</code> instance has been created by
<a href="../operation/builder/LocalizationGridBuilder.html" title="class in org.apache.sis.referencing.operation.builder"><code>Localization­Grid­Builder</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>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">getParameterValues</span><wbr><span class="parameters">(<a href="../../parameter/Parameters.html" title="class in org.apache.sis.parameter">Parameters</a>&nbsp;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>get­Parameter­Descriptors()</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>Interpolated­Transform</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>&nbsp;<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>&nbsp;<span class="element-name">toString</span>()</div>
<div class="block">Returns a string representation of this <code>Datum­Shift­Grid</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">to­String</a></code>&nbsp;in class&nbsp;<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>&nbsp;<span class="return-type">boolean</span>&nbsp;<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>&nbsp;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>&nbsp;in class&nbsp;<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>Datum­Shift­Grid</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>&nbsp;<span class="return-type">int</span>&nbsp;<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">hash­Code</a></code>&nbsp;in class&nbsp;<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 &#169; 2010&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>