| <!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"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../../../../index.html">Overview</a></li> |
| <li><a href="../../../../../../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: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><a href="../../../../../../../search.html">SEARCH</a> |
| <input type="text" id="search-input" disabled placeholder="Search"> |
| <input type="reset" id="reset-button" disabled value="reset"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="module-label-in-type">Module</span> <a href="../../../../../../module-summary.html">org.apache.sis.referencing</a></div> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <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>LocalizationGridBuilder</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(MathTransformFactory)</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>LinearTransform</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>LinearTransformBuilder</code></a>.</li> |
| <li>Compute <a href="../../datum/DatumShiftGrid.html" title="class in org.apache.sis.referencing.datum"><code>DatumShiftGrid</code></a> with the residuals.</li> |
| <li>Create a <a href="../transform/InterpolatedTransform.html" title="class in org.apache.sis.referencing.operation.transform"><code>InterpolatedTransform</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(MathTransformFactory)</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>InterpolatedTransform</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>LocalizationGridBuilder</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>LinearTransformBuilder</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>InterpolatedTransform</code></a></li> |
| <li><a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform"><code>LinearTransform</code></a></li> |
| <li><a href="../../datum/DatumShiftGrid.html" title="class in org.apache.sis.referencing.datum"><code>DatumShiftGrid</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">LocalizationGridBuilder</a><wbr>(int width, |
| int 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">LocalizationGridBuilder</a><wbr>(<a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a> sourceX, |
| <a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a> sourceY)</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">LocalizationGridBuilder</a><wbr>(<a href="LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder">LinearTransformBuilder</a> 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">addLinearizers</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><<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>> projections, |
| boolean compensate, |
| int... projToGrid)</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">MathTransform</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">MathTransformFactory</a> 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 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">getColumn</a><wbr>(int dimension, |
| int 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">getControlPoint</a><wbr>(int gridX, |
| int gridY)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns 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">getDesiredPrecision</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">getRow</a><wbr>(int dimension, |
| int 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">getSourceEnvelope</a><wbr>(boolean fullArea)</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">LinearTransform</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">getSourceToGrid</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><<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><<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>>></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 ifNotCompensated)</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">NumberRange</a><wbr><<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>></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">resolveWraparoundAxis</a><wbr>(int dimension, |
| int direction, |
| double 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">setControlPoint</a><wbr>(int gridX, |
| int gridY, |
| double... 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">setControlPoints</a><wbr>(<a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a>... 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">setDesiredPrecision</a><wbr>(double 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">setSourceToGrid</a><wbr>(<a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a> sourceToGrid)</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">toString</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns a string representation of this 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">toString</a><wbr>(boolean 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> 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 <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">getClass</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">hashCode</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">notifyAll</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="<init>(int,int)"> |
| <h3>LocalizationGridBuilder</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">LocalizationGridBuilder</span><wbr><span class="parameters">(int width, |
| int 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="<init>(org.apache.sis.math.Vector,org.apache.sis.math.Vector)"> |
| <h3>LocalizationGridBuilder</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <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> sourceX, |
| <a href="../../../../../../../org.apache.sis.util/org/apache/sis/math/Vector.html" title="class in org.apache.sis.math">Vector</a> 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>sourceX</code>, <code>sourceY</code>) → (<code>gridX</code>, <code>gridY</code>)</blockquote> |
| |
| Above conversion can be obtained by <a href="#getSourceToGrid()"><code>getSourceToGrid()</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>sourceX[i]</code> are not necessarily related to <code>sourceY[i]</code>).</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>sourceX</code> - all possible <var>x</var> inputs before conversion to grid coordinates.</dd> |
| <dd><code>sourceY</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">ArithmeticException</a></code> - if this constructor cannot infer a reasonable grid size from the given vectors.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="<init>(org.apache.sis.referencing.operation.builder.LinearTransformBuilder)"> |
| <h3>LocalizationGridBuilder</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <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> 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>setControlPoint(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">ArithmeticException</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> <span class="return-type">void</span> <span class="element-name">setDesiredPrecision</span><wbr><span class="parameters">(double 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">IllegalStateException</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>DatumShiftGrid.getCellPrecision()</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> <span class="return-type">double</span> <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>setDesiredPrecision(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> <span class="return-type">void</span> <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> 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>gridX</code>, <code>gridY</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>setDesiredPrecision(double)</code></a> method.</li> |
| </ul> |
| |
| The <code>coordinateToGrid</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>sourceToGrid</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">IllegalStateException</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>DatumShiftGrid.getCoordinateToGrid()</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> <span class="return-type"><a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform">LinearTransform</a></span> <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>setSourceToGrid(LinearTransform)</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> <span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html" title="class or interface in org.opengis.geometry" class="external-link">Envelope</a></span> <span class="element-name">getSourceEnvelope</span><wbr><span class="parameters">(boolean 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>fullArea</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>gridX</code> and <code>gridY</code> argument |
| values in calls to <code>get/setControlPoint(…)</code> methods) transformed as below: |
| <ol> |
| <li>expanded by ½ cell on each side if <code>fullArea</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>fullArea</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">IllegalStateException</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">TransformException</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>LinearTransformBuilder.getSourceEnvelope()</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> <span class="return-type">void</span> <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>... 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">IllegalStateException</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> <span class="return-type">void</span> <span class="element-name">setControlPoint</span><wbr><span class="parameters">(int gridX, |
| int gridY, |
| double... 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>gridX</code>, <code>gridY</code>) coordinates given to this method.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>gridX</code> - the column index in the grid where to store the given target position.</dd> |
| <dd><code>gridY</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">IllegalStateException</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">IllegalArgumentException</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">MismatchedDimensionException</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> <span class="return-type">double[]</span> <span class="element-name">getControlPoint</span><wbr><span class="parameters">(int gridX, |
| int 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>gridX</code> - the column index in the grid where to read the target position.</dd> |
| <dd><code>gridY</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">IllegalArgumentException</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> <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> <span class="element-name">getRow</span><wbr><span class="parameters">(int dimension, |
| int 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> <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> <span class="element-name">getColumn</span><wbr><span class="parameters">(int dimension, |
| int 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> <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><<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>></span> <span class="element-name">resolveWraparoundAxis</span><wbr><span class="parameters">(int dimension, |
| int direction, |
| double 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">IllegalStateException</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> <span class="return-type">void</span> <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><<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>> projections, |
| boolean compensate, |
| int... 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>InterpolatedTransform</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(MathTransformFactory)</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>MathTransform</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>projToGrid</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>projToGrid</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">IllegalStateException</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>LinearTransformBuilder.addLinearizers(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> <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> <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> 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>LinearTransform</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> in class <code><a href="TransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder">TransformBuilder</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>MathTransformFactory.createAffineTransform(Matrix)</code></a> method of that factory |
| shall return <a href="../transform/LinearTransform.html" title="interface in org.apache.sis.referencing.operation.transform"><code>LinearTransform</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">FactoryException</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> <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><<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><<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>>></span> <span class="element-name">linearizer</span><wbr><span class="parameters">(boolean 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>addLinearizers(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(MathTransformFactory)</code></a> call. |
| In such case, <a href="LinearTransformBuilder.html" title="class in org.apache.sis.referencing.operation.builder"><code>LinearTransformBuilder</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>addLinearizers(…)</code>. The entry value is the associated <code>MathTransform</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>getControlPoint(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>addLinearizers(…)</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>projToGrid</code> argument that was given to the <code><a href="#addLinearizers(java.util.Map,boolean,int...)">addLinearizers</a>(…, projToGrid)}</code> method. Consequently, if the <code>projToGrid</code> argument was not an |
| arithmetic progression, then the transform returned by this method will not be one of the instances given |
| to <code>addLinearizers(…)</code>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>ifNotCompensated</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>LinearTransformBuilder.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> <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> <span class="element-name">errors</span><wbr><span class="parameters">(boolean 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(MathTransformFactory)</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>LinearTransformBuilder</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)">getControlPoint</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">IllegalStateException</a></code> - if <a href="#create(org.opengis.referencing.operation.MathTransformFactory)"><code>create(MathTransformFactory)</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>toString(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> <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> <span class="element-name">toString</span><wbr><span class="parameters">(boolean 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> 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> <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> <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>toString(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">toString</a></code> in class <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> |