blob: b357382f558201f0970389260a6f4e6a55f99a1b [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 -->
<title>LocalizationGridBuilder (Apache SIS 1.4 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="dc.created" content="2023-10-05">
<meta name="description" content="declaration: module: org.apache.sis.referencing, package: org.apache.sis.referencing.operation.builder, class: LocalizationGridBuilder">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.referencing.operation.builder.LocalizationGridBuilder class">
<meta name="keywords" content="setDesiredPrecision()">
<meta name="keywords" content="getDesiredPrecision()">
<meta name="keywords" content="setSourceToGrid()">
<meta name="keywords" content="getSourceToGrid()">
<meta name="keywords" content="getSourceEnvelope()">
<meta name="keywords" content="setControlPoints()">
<meta name="keywords" content="setControlPoint()">
<meta name="keywords" content="getControlPoint()">
<meta name="keywords" content="getRow()">
<meta name="keywords" content="getColumn()">
<meta name="keywords" content="resolveWraparoundAxis()">
<meta name="keywords" content="addLinearizers()">
<meta name="keywords" content="create()">
<meta name="keywords" content="linearizer()">
<meta name="keywords" content="errors()">
<meta name="keywords" content="toString()">
<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">
<script type="text/javascript" src="../../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../../script-dir/jquery-3.6.1.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="../../../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</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>Field</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>Field</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>Field&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>Field&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="module-label-in-type">Module</span>&nbsp;<a href="../../../../../../module-summary.html">org.apache.sis.referencing</a></div>
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.referencing.operation.builder</a></div>
<h1 title="Class LocalizationGridBuilder" class="title">Class LocalizationGridBuilder</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance"><a href="TransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder">TransformBuilder</a>
<div class="inheritance">LocalizationGridBuilder</div>
</div>
</div>
<section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">LocalizationGridBuilder</span>
<span class="extends-implements">extends <a href="TransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder">TransformBuilder</a></span></div>
<div class="block">Creates an "almost linear" transform mapping the given source points to the given target points.
The transform is backed by a <cite>grid of localization</cite>, a two-dimensional array of coordinate tuples.
Grid size is <code>width</code> × <code>height</code> and input coordinates are (<var>i</var>,<var>j</var>) indices in the grid,
where <var>i</var> must be in the [0…<code>width</code>-1] range and <var>j</var> in the [0…<code>height</code>-1] range inclusive.
Output coordinates are the values stored in the grid of localization at the specified index.
After a <code>Localization­Grid­Builder</code> instance has been fully populated (i.e. real world coordinates have been
specified for all grid cells), a transformation from grid coordinates to "real world" coordinates can be obtained
with the <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(Math­Transform­Factory)</code></a> method. If this transform is close enough to an affine transform,
then an instance of <a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform"><code>Linear­Transform</code></a> is returned.
Otherwise, a transform backed by the localization grid is returned.
<p>This builder performs the following steps:</p>
<ol>
<li>Compute a linear approximation of the transformation using <a href="LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder"><code>Linear­Transform­Builder</code></a>.</li>
<li>Compute <a href="../../datum/DatumShiftGrid.html" title="class in org.apache.sis.referencing.datum"><code>Datum­Shift­Grid</code></a> with the residuals.</li>
<li>Create a <a href="../transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>Interpolated­Transform</code></a> with the above shift grid.</li>
<li>If a <a href="LinearTransformBuilder.html#linearizer()">linearizer has been applied</a>,
concatenate the inverse transform of that linearizer.</li>
</ol>
Builders are not thread-safe. Builders can be used only once;
points cannot be added or modified after <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(Math­Transform­Factory)</code></a> has been invoked.
<h2 id="linearizers-heading">Linearizers</h2>
If the localization grid is not close enough to a linear transform, <a href="../transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>Interpolated­Transform</code></a> may not converge.
To improve the speed and reliability of the transform, a non-linear step can be <a href="#addLinearizers(java.util.Map,boolean,int...)">specified</a>.
Many candidates can be specified in case the exact form of that non-linear step is unknown;
<code>Localization­Grid­Builder</code> will select the non-linear step that provides the best improvement, if any.
See the <cite>Linearizers</cite> section in <a href="LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder"><code>Linear­Transform­Builder</code></a> for more discussion.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.8</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>Interpolated­Transform</code></a></li>
<li><a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform"><code>Linear­Transform</code></a></li>
<li><a href="../../datum/DatumShiftGrid.html" title="class in org.apache.sis.referencing.datum"><code>Datum­Shift­Grid</code></a></li>
</ul>
</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== 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 two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(int,int)" class="member-name-link">Localization­Grid­Builder</a><wbr>(int&nbsp;width,
int&nbsp;height)</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a new, initially empty, builder for a localization grid of the given size.</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.math.Vector,org.apache.sis.math.Vector)" class="member-name-link">Localization­Grid­Builder</a><wbr>(<a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a>&nbsp;source­X,
<a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a>&nbsp;source­Y)</code></div>
<div class="col-last odd-row-color">
<div class="block">Creates a new, initially empty, builder for a localization grid of a size inferred from the given points.</div>
</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.referencing.operation.builder.LinearTransformBuilder)" class="member-name-link">Localization­Grid­Builder</a><wbr>(<a href="LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder">Linear­Transform­Builder</a>&nbsp;localizations)</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a new builder for a localization grid inferred from the given provider of control points.</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-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>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addLinearizers(java.util.Map,boolean,int...)" class="member-name-link">add­Linearizers</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><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">Math­Transform</a>&gt;&nbsp;projections,
boolean&nbsp;compensate,
int...&nbsp;proj­To­Grid)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds transforms to potentially apply on target control points before to compute the transform.</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/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Math­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="#create(org.opengis.referencing.operation.MathTransformFactory)" class="member-name-link">create</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransformFactory.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Math­Transform­Factory</a>&nbsp;factory)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Creates a transform from the source points to the target points.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Statistics.html" title="class in org.apache.sis.math">Statistics</a>[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#errors(boolean)" class="member-name-link">errors</a><wbr>(boolean&nbsp;linear)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns statistics of differences between values calculated by the transform and actual values.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getColumn(int,int)" class="member-name-link">get­Column</a><wbr>(int&nbsp;dimension,
int&nbsp;column)</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 column of coordinate values in the given dimension.</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="#getControlPoint(int,int)" class="member-name-link">get­Control­Point</a><wbr>(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-tab4">
<div class="block">Returns a single target coordinate for the given source coordinate, or <code>null</code> if none.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDesiredPrecision()" class="member-name-link">get­Desired­Precision</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 desired precision of <em>inverse</em> transformations, in units of source coordinates.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRow(int,int)" class="member-name-link">get­Row</a><wbr>(int&nbsp;dimension,
int&nbsp;row)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a row of coordinate values in 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="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="#getSourceEnvelope(boolean)" class="member-name-link">get­Source­Envelope</a><wbr>(boolean&nbsp;full­Area)</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 envelope of source coordinates.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">Linear­Transform</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSourceToGrid()" class="member-name-link">get­Source­To­Grid</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 current relationship between "real-world" source coordinates and 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/11/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a><wbr>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.Entry.html" title="class or interface in java.util" class="external-link">Map​.Entry</a>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><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">Math­Transform</a>&gt;&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#linearizer(boolean)" class="member-name-link">linearizer</a><wbr>(boolean&nbsp;if­Not­Compensated)</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 linearizer applied on target control points.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../../../../../../../org.apache.sis.util/org/apache/sis/measure/NumberRange.html" title="class in org.apache.sis.measure">Number­Range</a><wbr>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</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="#resolveWraparoundAxis(int,int,double)" class="member-name-link">resolve­Wraparound­Axis</a><wbr>(int&nbsp;dimension,
int&nbsp;direction,
double&nbsp;period)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Tries to remove discontinuities in coordinates values caused by anti-meridian crossing.</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="#setControlPoint(int,int,double...)" class="member-name-link">set­Control­Point</a><wbr>(int&nbsp;grid­X,
int&nbsp;grid­Y,
double...&nbsp;target)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets a single matching control point pair.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setControlPoints(org.apache.sis.math.Vector...)" class="member-name-link">set­Control­Points</a><wbr>(<a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a>...&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">Sets all control points.</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="#setDesiredPrecision(double)" class="member-name-link">set­Desired­Precision</a><wbr>(double&nbsp;precision)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the desired precision of <em>inverse</em> transformations, in units of source coordinates.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setSourceToGrid(org.apache.sis.referencing.operation.transform.LinearTransform)" class="member-name-link">set­Source­To­Grid</a><wbr>(<a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">Linear­Transform</a>&nbsp;source­To­Grid)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Defines relationship between "real-world" source coordinates and 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/11/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 builder for debugging purpose.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString(boolean,java.util.Locale)" class="member-name-link">to­String</a><wbr>(boolean&nbsp;linear,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Locale.html" title="class or interface in java.util" class="external-link">Locale</a>&nbsp;locale)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a string representation of this builder in the given locale.</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/11/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/11/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/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/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/11/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/11/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/11/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/11/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/11/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/11/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/11/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">
<!-- ========= 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;(int,int)">
<h3>LocalizationGridBuilder</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">LocalizationGridBuilder</span><wbr><span class="parameters">(int&nbsp;width,
int&nbsp;height)</span></div>
<div class="block">Creates a new, initially empty, builder for a localization grid of the given size.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>width</code> - the number of columns in the grid of target positions.</dd>
<dd><code>height</code> - the number of rows in the grid of target positions.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.sis.math.Vector,org.apache.sis.math.Vector)">
<h3>LocalizationGridBuilder</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">LocalizationGridBuilder</span><wbr><span class="parameters">(<a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a>&nbsp;sourceX,
<a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a>&nbsp;sourceY)</span></div>
<div class="block">Creates a new, initially empty, builder for a localization grid of a size inferred from the given points.
This constructor uses the given vectors for computing a grid size and the following initial conversion:
<blockquote>(<code>source­X</code>, <code>source­Y</code>) → (<code>grid­X</code>, <code>grid­Y</code>)</blockquote>
Above conversion can be obtained by <a href="#getSourceToGrid()"><code>get­Source­To­Grid()</code></a>.
<p>Values in the given vectors should be integers, but this constructor is tolerant to non-integer values
if they have a constant offset (typically 0.5) relative to integer values. The two vectors do not need to
have the same length (i.e. <code>source­X[i]</code> are not necessarily related to <code>source­Y[i]</code>).</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source­X</code> - all possible <var>x</var> inputs before conversion to grid coordinates.</dd>
<dd><code>source­Y</code> - all possible <var>y</var> inputs before conversion to grid coordinates.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if this constructor cannot infer a reasonable grid size from the given vectors.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.apache.sis.referencing.operation.builder.LinearTransformBuilder)">
<h3>LocalizationGridBuilder</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">LocalizationGridBuilder</span><wbr><span class="parameters">(<a href="LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder">LinearTransformBuilder</a>&nbsp;localizations)</span></div>
<div class="block">Creates a new builder for a localization grid inferred from the given provider of control points.
The <a href="LinearTransformBuilder.html#getSourceDimensions()">number of source dimensions</a> in the
given <code>localizations</code> argument shall be 2. The <code>localization</code> can be used in two ways:
<ul class="verbose">
<li>If the <code>localizations</code> instance has been
<a href="LinearTransformBuilder.html#%3Cinit%3E(int...)">created with a fixed grid size</a>,
then that instance is used as-is — it is not copied. It is okay to specify an empty instance and
to provide control points later by calls to <a href="#setControlPoint(int,int,double...)"><code>set­Control­Point(int, int, double...)</code></a>.</li>
<li>If the <code>localizations</code> instance has been
<a href="LinearTransformBuilder.html#%3Cinit%3E()">created for a grid of unknown size</a>,
then this constructor tries to infer a grid size by inspection of the control points present in
<code>localizations</code> at the time this constructor is invoked. Changes in <code>localizations</code>
after construction will not be reflected in this new builder.</li>
</ul>
The new builder inherits the <a href="LinearTransformBuilder.html#addLinearizers(java.util.Map,int...)">linearizers</a>
of <code>localizations</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>localizations</code> - the provider of control points for which to create a localization grid.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if this constructor cannot infer a reasonable grid size from the given localizations.</dd>
<dt>Since:</dt>
<dd>1.0</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="setDesiredPrecision(double)">
<h3>setDesiredPrecision</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setDesiredPrecision</span><wbr><span class="parameters">(double&nbsp;precision)</span></div>
<div class="block">Sets the desired precision of <em>inverse</em> transformations, in units of source coordinates.
If a conversion from "real world" to grid coordinates <a href="#setSourceToGrid(org.apache.sis.referencing.operation.transform.LinearTransform)">has been specified</a>,
then the given precision is in "real world" units. Otherwise the precision is in units of grid cells
(i.e. a value of 1 is the size of one grid cell).
<div class="note"><b>Note:</b>
there is no method for setting the desired target precision because forward transformations <em>precision</em>
(not to be confused with <em>accuracy</em>) are limited only by rounding errors. Of course the accuracy of both
forward and inverse transformations still limited by the accuracy of given control points and the grid resolution.
</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>precision</code> - desired precision of the results of inverse transformations.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(…)</code></a> has already been invoked.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="../../datum/DatumShiftGrid.html#getCellPrecision()"><code>Datum­Shift­Grid​.get­Cell­Precision()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getDesiredPrecision()">
<h3>getDesiredPrecision</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getDesiredPrecision</span>()</div>
<div class="block">Returns the desired precision of <em>inverse</em> transformations, in units of source coordinates.
This is the precision sets by the last call to <a href="#setDesiredPrecision(double)"><code>set­Desired­Precision(double)</code></a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>desired precision of the results of inverse transformations.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setSourceToGrid(org.apache.sis.referencing.operation.transform.LinearTransform)">
<h3>setSourceToGrid</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setSourceToGrid</span><wbr><span class="parameters">(<a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a>&nbsp;sourceToGrid)</span></div>
<div class="block">Defines relationship between "real-world" source coordinates and grid coordinates.
The given transform is usually two-dimensional, in which case conversions from (<var>x</var>,<var>y</var>)
source coordinates to (<code>grid­X</code>, <code>grid­Y</code>) indices can be done with the following formulas:
<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 same unit of measurement than the one documented in the
<a href="#setDesiredPrecision(double)"><code>set­Desired­Precision(double)</code></a> method.</li>
</ul>
The <code>coordinate­To­Grid</code> transform for the above formulas can be represented by the following matrix:
<pre class="math">
┌ ┐
│ 1/Δx 0 -x₀/Δx │
│ 0 1/Δy -y₀/Δy │
│ 0 0 1 │
└ ┘</pre>
If this method is never invoked, then the default conversion is identity.
If a <a href="#setDesiredPrecision(double)">desired precision</a> has been specified before this method call,
it is caller's responsibility to convert that value to new source units if needed.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>source­To­Grid</code> - conversion from the "real world" source coordinates to grid indices including fractional parts.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(…)</code></a> has already been invoked.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="../../datum/DatumShiftGrid.html#getCoordinateToGrid()"><code>Datum­Shift­Grid​.get­Coordinate­To­Grid()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSourceToGrid()">
<h3>getSourceToGrid</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a></span>&nbsp;<span class="element-name">getSourceToGrid</span>()</div>
<div class="block">Returns the current relationship between "real-world" source coordinates and grid coordinates.
This is the value set by the last call to <a href="#setSourceToGrid(org.apache.sis.referencing.operation.transform.LinearTransform)"><code>set­Source­To­Grid(Linear­Transform)</code></a>.
If that setter method has never been invoked, then this is an automatically computed transform
if the grid coordinates <a href="#%3Cinit%3E(org.apache.sis.math.Vector,org.apache.sis.math.Vector)">have been specified
to the constructor</a>, or the identity transform <a href="#%3Cinit%3E(int,int)">otherwise</a>.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the current relationship between "real-world" source coordinates and grid coordinates.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSourceEnvelope(boolean)">
<h3>getSourceEnvelope</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">getSourceEnvelope</span><wbr><span class="parameters">(boolean&nbsp;fullArea)</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 envelope of source coordinates. The <code>full­Area</code> argument control whether
the returned envelope shall encompass full surface of every cells or only their centers:
<ul>
<li>If <code>true</code>, then the returned envelope encompasses full cell surfaces,
from lower border to upper border. In other words, the returned envelope encompasses all
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html#CELL_CORNER" title="class or interface in org.opengis.referencing.datum" class="external-link">cell corners</a>.</li>
<li>If <code>false</code>, then the returned envelope encompasses only
<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">cell centers</a>, inclusive.</li>
</ul>
This is the envelope of the grid domain (i.e. the ranges of valid <code>grid­X</code> and <code>grid­Y</code> argument
values in calls to <code>get/set­Control­Point(…)</code> methods) transformed as below:
<ol>
<li>expanded by ½ cell on each side if <code>full­Area</code> is <code>true</code></li>
<li>transformed by the inverse of <a href="#getSourceToGrid()">source to grid</a> transform.</li>
</ol></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>full­Area</code> - whether the envelope shall encompass the full cell surfaces instead of only their centers.</dd>
<dt>Returns:</dt>
<dd>the envelope of grid points, from lower corner to upper corner.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if the grid points are not yet known.</dd>
<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 the envelope cannot be calculated.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="LinearTransformBuilder.html#getSourceEnvelope()"><code>Linear­Transform­Builder​.get­Source­Envelope()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setControlPoints(org.apache.sis.math.Vector...)">
<h3>setControlPoints</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setControlPoints</span><wbr><span class="parameters">(<a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a>...&nbsp;coordinates)</span></div>
<div class="block">Sets all control points. The length of given vectors must be equal to the total number of cells in the grid.
The first vector provides the <var>x</var> coordinates; the second vector provides the <var>y</var> coordinates,
<i>etc.</i>. Coordinates are stored in row-major order (column index varies faster, followed by row index).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>coordinates</code> - coordinates in each target dimensions, stored in row-major order.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(…)</code></a> has already been invoked.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setControlPoint(int,int,double...)">
<h3>setControlPoint</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setControlPoint</span><wbr><span class="parameters">(int&nbsp;gridX,
int&nbsp;gridY,
double...&nbsp;target)</span></div>
<div class="block">Sets a single matching control point pair. Source position is assumed precise and target position is assumed uncertain.
If the given source position was already associated with another target position, then the old target position is discarded.
<p>If a <a href="#getSourceToGrid()">source to grid</a> conversion exists, it shall have been applied
by the caller for computing the (<code>grid­X</code>, <code>grid­Y</code>) coordinates given to this method.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>grid­X</code> - the column index in the grid where to store the given target position.</dd>
<dd><code>grid­Y</code> - the row index in the grid where to store the given target position.</dd>
<dd><code>target</code> - the target coordinates, assumed uncertain.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(…)</code></a> has already been invoked.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the <code>x</code> or <code>y</code> coordinate value is out of grid range.</dd>
<dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/MismatchedDimensionException.html" title="class or interface in org.opengis.geometry" class="external-link">Mismatched­Dimension­Exception</a></code> - if the target position does not have the expected number of dimensions.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getControlPoint(int,int)">
<h3>getControlPoint</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double[]</span>&nbsp;<span class="element-name">getControlPoint</span><wbr><span class="parameters">(int&nbsp;gridX,
int&nbsp;gridY)</span></div>
<div class="block">Returns a single target coordinate for the given source coordinate, or <code>null</code> if none.
If <a href="#addLinearizers(java.util.Map,boolean,int...)">linearizers</a> have been specified and <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(…)</code></a>
has already been invoked, then the control points may be projected using one of the linearizers.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>grid­X</code> - the column index in the grid where to read the target position.</dd>
<dd><code>grid­Y</code> - the row index in the grid where to read the target position.</dd>
<dt>Returns:</dt>
<dd>the target coordinates associated to the given source, or <code>null</code> if none.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the <code>x</code> or <code>y</code> coordinate value is out of grid range.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getRow(int,int)">
<h3>getRow</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a></span>&nbsp;<span class="element-name">getRow</span><wbr><span class="parameters">(int&nbsp;dimension,
int&nbsp;row)</span></div>
<div class="block">Returns a row of coordinate values in the given dimension.
The returned vector is a view; changes in the returned vector will be reflected in this builder.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>dimension</code> - the target dimension for which to get coordinate values.</dd>
<dd><code>row</code> - index of the row to get.</dd>
<dt>Returns:</dt>
<dd>coordinate values of the specified row in the specified dimension.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getColumn(int,int)">
<h3>getColumn</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a></span>&nbsp;<span class="element-name">getColumn</span><wbr><span class="parameters">(int&nbsp;dimension,
int&nbsp;column)</span></div>
<div class="block">Returns a column of coordinate values in the given dimension.
The returned vector is a view; changes in the returned vector will be reflected in this builder.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>dimension</code> - the target dimension for which to get coordinate values.</dd>
<dd><code>column</code> - index of the column to get.</dd>
<dt>Returns:</dt>
<dd>coordinate values of the specified column in the specified dimension.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="resolveWraparoundAxis(int,int,double)">
<h3>resolveWraparoundAxis</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../../../../../../../org.apache.sis.util/org/apache/sis/measure/NumberRange.html" title="class in org.apache.sis.measure">NumberRange</a>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Double.html" title="class or interface in java.lang" class="external-link">Double</a>&gt;</span>&nbsp;<span class="element-name">resolveWraparoundAxis</span><wbr><span class="parameters">(int&nbsp;dimension,
int&nbsp;direction,
double&nbsp;period)</span></div>
<div class="block">Tries to remove discontinuities in coordinates values caused by anti-meridian crossing.
This method can be invoked when the localization grid may cross the anti-meridian,
where longitude values may suddenly jump from +180° to -180° or conversely.
This method walks through the coordinate values of the given dimension (typically the longitudes dimension)
in the given direction (grid rows or grid columns).
If a difference greater than <code>period/2</code> (typically 180°) is found between two consecutive values,
then a multiple of <code>period</code> (typically 360°) is added or subtracted in order to make a value as close
as possible from its previous value.
<p>This method needs a direction to be specified:</p>
<ul>
<li>Direction 0 means that each value is compared with the value in the previous column,
except the value in the first column which is compared to the value in previous row.</li>
<li>Direction 1 means that each value is compared with the value in the previous row,
except the value in the first row which is compared to the value in previous column.</li>
</ul>
The recommended value is the direction of most stable values. Typically, longitude values increase with column indices
and are almost constant when increasing row indices. In such case, the recommended direction is 1 for comparing each
value with the value in previous row, since that value should be closer than the value in previous column.
<h4 id="example-heading">Example</h4>
for a grid of (<var>longitude</var>, <var>latitude</var>) values in decimal degrees where longitude values
vary (increase or decrease) with increasing column indices and latitude values vary (increase or decrease)
with increasing row indices, the following method should be invoked for protecting the grid against
discontinuities on anti-meridian:
<div class="snippet-container"><button class="copy snippet-copy" aria-label="Copy snippet" onclick="copySnippet(this)"><span data-copied="Copied!">Copy</span><img src="../../../../../../../copy.svg" alt="Copy snippet"></button>
<pre class="snippet"><code class="language-java">grid.resolveWraparoundAxis(0, 1, 360);
</code></pre>
</div>
</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>dimension</code> - the dimension to process.
This is 0 for longitude dimension in a (<var>longitudes</var>, <var>latitudes</var>) grid.</dd>
<dd><code>direction</code> - the direction to walk through: 0 for columns or 1 for rows.
The recommended direction is the direction of most stable values, typically 1 (rows) for longitudes.</dd>
<dd><code>period</code> - that wraparound range (typically 360° for longitudes). Must be strictly positive.</dd>
<dt>Returns:</dt>
<dd>the range of coordinate values in the specified dimension after correction for wraparound values.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if this method has already been invoked for the same dimension,
or if <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(…)</code></a> has already been invoked.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addLinearizers(java.util.Map,boolean,int...)">
<h3>addLinearizers</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">addLinearizers</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><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">MathTransform</a>&gt;&nbsp;projections,
boolean&nbsp;compensate,
int...&nbsp;projToGrid)</span></div>
<div class="block">Adds transforms to potentially apply on target control points before to compute the transform.
This method can be invoked if the departure from a linear transform is too large, resulting
in <a href="../transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>Interpolated­Transform</code></a> to fail with "no convergence error" messages.
If linearizers have been specified, then the <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(Math­Transform­Factory)</code></a> method
will try to apply each transform on target coordinates and check which one results in the
best correlation coefficients. Exactly one of the specified transforms will be selected.
If applying no transform is an acceptable solution, then an
<a href="../transform/MathTransforms.html#identity(int)">identity transform</a> should be included in the given <code>projections</code> map.
<p>The linearizers are specified as <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>s from current <a href="#getControlPoint(int,int)">target coordinates of control points</a> to other spaces where <cite>sources to new targets</cite> transforms may
be more linear. The keys in the map are arbitrary identifiers.
The <code>proj­To­Grid</code> argument specifies which control point dimensions to use as <code>projections</code> source
coordinates and can be null or omitted if the projections shall be applied on all target coordinates.
It is possible to invoke this method many times with different <code>dimensions</code> argument values.</p>
<p>The <code>compensate</code> argument tell whether the inverse of specified transform shall be concatenated
to the final <a href="#create(org.opengis.referencing.operation.MathTransformFactory)">interpolated transform</a>. If <code>true</code>, the <code>projection</code> effect
will be cancelled in the final result, i.e. the target coordinates will be approximately the same as if
no projection were applied. In such case, the advantage of applying a projection is to improve numerical
stability with a better linear approximation in used by the coordinate transformation process.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>projections</code> - projections from current target coordinates to other spaces which may result in more linear transforms.</dd>
<dd><code>compensate</code> - whether the inverse of selected projection shall be concatenated to the final interpolated transform.</dd>
<dd><code>proj­To­Grid</code> - the target dimensions to project, or null or omitted for projecting all target dimensions.
If non-null and non-empty, then all transforms in the <code>projections</code> map shall have a
number of source and target dimensions equals to the length of this array.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(…)</code></a> has already been invoked.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="LinearTransformBuilder.html#addLinearizers(java.util.Map,int...)"><code>Linear­Transform­Builder​.add­Linearizers(Map, int...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="create(org.opengis.referencing.operation.MathTransformFactory)">
<h3>create</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/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link">MathTransform</a></span>&nbsp;<span class="element-name">create</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransformFactory.html" title="class or interface in org.opengis.referencing.operation" class="external-link">MathTransformFactory</a>&nbsp;factory)</span>
throws <span class="exceptions"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/FactoryException.html" title="class or interface in org.opengis.util" class="external-link">FactoryException</a></span></div>
<div class="block">Creates a transform from the source points to the target points.
This method assumes that source points are precise and all uncertainty is in the target points.
If this transform is close enough to an affine transform, then an instance of <a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform"><code>Linear­Transform</code></a> is returned.
<p>If this method is invoked more than once, the previously created transform instance is returned.</p></div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="TransformBuilder.html#create(org.opengis.referencing.operation.MathTransformFactory)">create</a></code>&nbsp;in class&nbsp;<code><a href="TransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder">Transform­Builder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>factory</code> - the factory to use for creating the transform, or <code>null</code> for the default factory.
The <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransformFactory.html#createAffineTransform(org.opengis.referencing.operation.Matrix)" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Math­Transform­Factory​.create­Affine­Transform(Matrix)</code></a> method of that factory
shall return <a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform"><code>Linear­Transform</code></a> instances.</dd>
<dt>Returns:</dt>
<dd>the transform from source to target points.</dd>
<dt>Throws:</dt>
<dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/FactoryException.html" title="class or interface in org.opengis.util" class="external-link">Factory­Exception</a></code> - if the transform cannot be created,
for example because the target points have not be specified.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="linearizer(boolean)">
<h3>linearizer</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Map.Entry.html" title="class or interface in java.util" class="external-link">Map.Entry</a>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><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">MathTransform</a>&gt;&gt;</span>&nbsp;<span class="element-name">linearizer</span><wbr><span class="parameters">(boolean&nbsp;ifNotCompensated)</span></div>
<div class="block">Returns the linearizer applied on target control points.
This method returns a non-empty value if <a href="#addLinearizers(java.util.Map,boolean,int...)"><code>add­Linearizers(Map, boolean, int...)</code></a> has
been invoked with a non-empty map, followed by a <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(Math­Transform­Factory)</code></a> call.
In such case, <a href="LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder"><code>Linear­Transform­Builder</code></a> selects a linearizer identified by the returned
<var>key</var> - <var>value</var> entry. The entry key is one of the keys of the maps given
to <code>add­Linearizers(…)</code>. The entry value is the associated <code>Math­Transform</code>,
possibly modified as described in the <cite>axis order</cite> section below.
<p>All control points returned by <a href="#getControlPoint(int,int)"><code>get­Control­Point(int, int)</code></a> are projected by the selected transform.
Consequently, if the target coordinates of original control points are desired, then the transform computed by
this builder needs to be concatenated with the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html#inverse()" title="class or interface in org.opengis.referencing.operation" class="external-link">inverse</a> of the transform
returned by this method. This is done automatically in the <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(…)</code></a>
method if the <code>compensate</code> flag given to <code>add­Linearizers(…)</code> method was <code>true</code>.
Otherwise the compensation, if desired, needs to be done by the caller.</p>
<h4 id="axis-order-heading">Axis order</h4>
The returned transform will contain an operation step performing axis filtering and swapping implied by the
<code>proj­To­Grid</code> argument that was given to the <code><a href="#addLinearizers(java.util.Map,boolean,int...)">add­Linearizers</a>(…, proj­To­Grid)}</code> method. Consequently, if the <code>proj­To­Grid</code> argument was not an
arithmetic progression, then the transform returned by this method will not be one of the instances given
to <code>add­Linearizers(…)</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>if­Not­Compensated</code> - whether to return the transform only if not already compensated by <code>create(…)</code>.
A value of <code>true</code> is useful if the caller wants the transform only if it needs to compensate itself.</dd>
<dt>Returns:</dt>
<dd>the projection applied on target coordinates before to compute a linear transform.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="LinearTransformBuilder.html#linearizer()"><code>Linear­Transform­Builder​.linearizer()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="errors(boolean)">
<h3>errors</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Statistics.html" title="class in org.apache.sis.math">Statistics</a>[]</span>&nbsp;<span class="element-name">errors</span><wbr><span class="parameters">(boolean&nbsp;linear)</span></div>
<div class="block">Returns statistics of differences between values calculated by the transform and actual values.
The tested transform is
the one computed by <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(Math­Transform­Factory)</code></a> if the <code>linear</code> argument is <code>false</code>,
or the transform computed by <a href="LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder"><code>Linear­Transform­Builder</code></a> if the <code>linear</code> argument is <code>true</code>.
The returned statistics are:
<ol class="verbose">
<li>One <code>Statistics</code> instance for each target dimension, containing statistics about the differences between
coordinates computed by the given transform and expected coordinates. For each (<var>i</var>,<var>j</var>) indices
in this grid, the indices are transformed by a call to <code>mt​.transform(…)</code> and the result is compared with the
coordinates given by <code><a href="#getControlPoint(int,int)">get­Control­Point</a>(i,j)</code>.
Those statistics are identified by labels like “Δx” and “Δy”.</li>
<li>One <code>Statistics</code> instance for each source dimension, containing statistics about the differences between
coordinates computed by the <em>inverse</em> of the transform and expected coordinates.
For each (<var>x</var>,<var>y</var>) control point in this grid, the points are transformed by a call
to <code>mt​.inverse()​.transform(…)</code> and the result is compared with the pixel indices of that point.
Those statistics are identified by labels like "Δi" and "Δj".</li>
</ol></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>linear</code> - <code>false</code> for computing errors using the complete transform,
or <code>true</code> for using only the linear part.</dd>
<dt>Returns:</dt>
<dd>statistics of difference between computed values and expected values for each target dimension.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(Math­Transform­Factory)</code></a> has not yet been invoked.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#toString(boolean,java.util.Locale)"><code>to­String(boolean, Locale)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toString(boolean,java.util.Locale)">
<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/11/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><wbr><span class="parameters">(boolean&nbsp;linear,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Locale.html" title="class or interface in java.util" class="external-link">Locale</a>&nbsp;locale)</span></div>
<div class="block">Returns a string representation of this builder in the given locale.
Current implementation shows the following information:
<ul>
<li>Number of points.</li>
<li>Linearizers and their correlation coefficients (if available).</li>
<li>The linear component of the transform.</li>
<li>Error statistics, as documented in the <a href="#errors(boolean)"><code>errors(boolean)</code></a> method.</li>
</ul>
The string representation may change in any future version.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>linear</code> - <code>false</code> for errors using the complete transform,
or <code>true</code> for using only the linear part.</dd>
<dd><code>locale</code> - the locale for formatting messages and some numbers, or <code>null</code> for the default.</dd>
<dt>Returns:</dt>
<dd>a string representation of this builder.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="#errors(boolean)"><code>errors(boolean)</code></a></li>
</ul>
</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/11/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 builder for debugging purpose.
The string representation is for debugging purpose and may change in any future version.
The default implementation delegates to <a href="#toString(boolean,java.util.Locale)"><code>to­String(boolean, Locale)</code></a> with a null locale.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/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/11/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 builder.</dd>
<dt>Since:</dt>
<dd>1.0</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>