| <!DOCTYPE HTML> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 --> |
| <title>FractionalGridCoordinates (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.feature, package: org.apache.sis.coverage.grid, class: FractionalGridCoordinates"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <meta name="keywords" content="org.apache.sis.coverage.grid.FractionalGridCoordinates class"> |
| <meta name="keywords" content="getDimension()"> |
| <meta name="keywords" content="getCoordinateValues()"> |
| <meta name="keywords" content="getCoordinateValue()"> |
| <meta name="keywords" content="getCoordinateFractional()"> |
| <meta name="keywords" content="setCoordinateValue()"> |
| <meta name="keywords" content="toExtent()"> |
| <meta name="keywords" content="toPosition()"> |
| <meta name="keywords" content="toString()"> |
| <meta name="keywords" content="hashCode()"> |
| <meta name="keywords" content="equals()"> |
| <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.feature</a></div> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">org.apache.sis.coverage.grid</a></div> |
| <h1 title="Class FractionalGridCoordinates" class="title">Class FractionalGridCoordinates</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">FractionalGridCoordinates</div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">FractionalGridCoordinates</span> |
| <span class="extends-implements">extends <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> |
| implements <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></span></div> |
| <div class="block">Grid coordinates which may have fraction digits after the integer part. |
| Grid coordinates specify the location of a cell within a <a href="GridCoverage.html" title="class in org.apache.sis.coverage.grid"><code>GridCoverage</code></a>. |
| They are normally integer numbers, but fractional parts may exist for example |
| after converting a geospatial <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link"><code>DirectPosition</code></a> to grid coordinates. |
| Preserving that fractional part is needed for interpolations. |
| This class can store such fractional part and can also compute a <a href="GridExtent.html" title="class in org.apache.sis.coverage.grid"><code>GridExtent</code></a> |
| containing the coordinates, which can be used for requesting data for interpolations. |
| |
| <p>Current implementation stores coordinate values as <code>double</code> precision floating-point numbers |
| and <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#round(double)" title="class or interface in java.lang" class="external-link">rounds</a> them to 64-bits integers on the fly. If a <code>double</code> |
| cannot be <a href="#getCoordinateValue(int)">returned</a> as a <code>long</code>, or if a <code>long</code> |
| cannot be <a href="#setCoordinateValue(int,long)">stored</a> as a <code>double</code>, then an |
| <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"><code>ArithmeticException</code></a> is thrown.</p></div> |
| <dl class="notes"> |
| <dt>Since:</dt> |
| <dd>1.1</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="GridCoverage.Evaluator.html#toGridCoordinates(org.opengis.geometry.DirectPosition)"><code>GridCoverage.Evaluator.toGridCoordinates(DirectPosition)</code></a></li> |
| <li><a href="../../../../../../serialized-form.html#org.apache.sis.coverage.grid.FractionalGridCoordinates">Serialized Form</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)" class="member-name-link">FractionalGridCoordinates</a><wbr>(int dimension)</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Creates a new grid coordinates with the given number of dimensions.</div> |
| </div> |
| <div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.coverage.grid.FractionalGridCoordinates)" class="member-name-link">FractionalGridCoordinates</a><wbr>(<a href="FractionalGridCoordinates.html" title="class in org.apache.sis.coverage.grid">FractionalGridCoordinates</a> other)</code></div> |
| <div class="col-last odd-row-color"> |
| <div class="block">Creates a new grid coordinates initialized to a copy of the given coordinates.</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>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#equals(java.lang.Object)" class="member-name-link">equals</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> object)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Compares this grid coordinates with the specified object for equality.</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="#getCoordinateFractional(int)" class="member-name-link">getCoordinateFractional</a><wbr>(int dimension)</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 grid coordinate value together with its fractional part, if any.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCoordinateValue(int)" class="member-name-link">getCoordinateValue</a><wbr>(int dimension)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns the grid coordinate value at the specified dimension.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long[]</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCoordinateValues()" class="member-name-link">getCoordinateValues</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 one integer value for each dimension of the grid.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDimension()" class="member-name-link">getDimension</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 number of dimension of this grid coordinates.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#hashCode()" class="member-name-link">hashCode</a>()</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Returns a hash code value for this grid 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="#setCoordinateValue(int,long)" class="member-name-link">setCoordinateValue</a><wbr>(int dimension, |
| long value)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets the coordinate value at the specified dimension.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toExtent(org.apache.sis.coverage.grid.GridExtent,long...)" class="member-name-link">toExtent</a><wbr>(<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a> bounds, |
| long... size)</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 new grid extent around this grid coordinates.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">DirectPosition</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toPosition(org.opengis.referencing.operation.MathTransform)" class="member-name-link">toPosition</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> gridToCRS)</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 grid coordinates converted to a geospatial position using the given transform.</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 grid coordinates for debugging purpose.</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#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#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)"> |
| <h3>FractionalGridCoordinates</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">FractionalGridCoordinates</span><wbr><span class="parameters">(int dimension)</span></div> |
| <div class="block">Creates a new grid coordinates with the given number of dimensions. |
| |
| <h4 id="usage-note-heading">Usage note</h4> |
| <code>FractionalGridCoordinates</code> are usually not created directly, but are instead obtained |
| indirectly for example from the <a href="GridCoverage.Evaluator.html#toGridCoordinates(org.opengis.geometry.DirectPosition)">conversion of a geospatial position</a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>dimension</code> - the number of dimensions.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="<init>(org.apache.sis.coverage.grid.FractionalGridCoordinates)"> |
| <h3>FractionalGridCoordinates</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">FractionalGridCoordinates</span><wbr><span class="parameters">(<a href="FractionalGridCoordinates.html" title="class in org.apache.sis.coverage.grid">FractionalGridCoordinates</a> other)</span></div> |
| <div class="block">Creates a new grid coordinates initialized to a copy of the given coordinates.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>other</code> - the coordinates to copy.</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="getDimension()"> |
| <h3>getDimension</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getDimension</span>()</div> |
| <div class="block">Returns the number of dimension of this grid coordinates.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>the number of dimensions.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCoordinateValues()"> |
| <h3>getCoordinateValues</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">long[]</span> <span class="element-name">getCoordinateValues</span>()</div> |
| <div class="block">Returns one integer value for each dimension of the grid. |
| The default implementation invokes <a href="#getCoordinateValue(int)"><code>getCoordinateValue(int)</code></a> |
| for each element in the returned array.</div> |
| <dl class="notes"> |
| <dt>Returns:</dt> |
| <dd>a copy of the coordinates. Changes in the returned array will |
| not be reflected back in this <code>GridCoordinates</code> object.</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 a coordinate value is outside the range |
| of values representable as a 64-bits integer value.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCoordinateValue(int)"> |
| <h3>getCoordinateValue</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">long</span> <span class="element-name">getCoordinateValue</span><wbr><span class="parameters">(int dimension)</span></div> |
| <div class="block">Returns the grid coordinate value at the specified dimension. |
| Floating-point values are rounded to the nearest 64-bits integer values. |
| If the coordinate value is NaN or outside the range of <code>long</code> values, |
| then an <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"><code>ArithmeticException</code></a> is thrown.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>dimension</code> - the dimension for which to obtain the coordinate value.</dd> |
| <dt>Returns:</dt> |
| <dd>the coordinate value at the given dimension, |
| <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Math.html#round(double)" title="class or interface in java.lang" class="external-link">rounded</a> to nearest integer.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is negative or is |
| equal or greater than the <a href="#getDimension()">grid dimension</a>.</dd> |
| <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 the coordinate value is outside the range |
| of values representable as a 64-bits integer value.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="getCoordinateFractional(int)"> |
| <h3>getCoordinateFractional</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">double</span> <span class="element-name">getCoordinateFractional</span><wbr><span class="parameters">(int dimension)</span></div> |
| <div class="block">Returns a grid coordinate value together with its fractional part, if any.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>dimension</code> - the dimension for which to obtain the coordinate value.</dd> |
| <dt>Returns:</dt> |
| <dd>the coordinate value at the given dimension.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is negative or is |
| equal or greater than the <a href="#getDimension()">grid dimension</a>.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setCoordinateValue(int,long)"> |
| <h3>setCoordinateValue</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setCoordinateValue</span><wbr><span class="parameters">(int dimension, |
| long value)</span></div> |
| <div class="block">Sets the coordinate value at the specified dimension. |
| The given value shall be convertible to <code>double</code> without precision lost.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>dimension</code> - the dimension for which to set the coordinate value.</dd> |
| <dd><code>value</code> - the new value.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">IndexOutOfBoundsException</a></code> - if the given index is negative or is |
| equal or greater than the <a href="#getDimension()">grid dimension</a>.</dd> |
| <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 method cannot store the given grid coordinate |
| without precision lost.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="toExtent(org.apache.sis.coverage.grid.GridExtent,long...)"> |
| <h3>toExtent</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a></span> <span class="element-name">toExtent</span><wbr><span class="parameters">(<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a> bounds, |
| long... size)</span></div> |
| <div class="block">Creates a new grid extent around this grid coordinates. The returned extent will have the same number |
| of dimensions than this grid coordinates. For each dimension <var>i</var> the following relationships |
| will hold: |
| |
| <ol> |
| <li>If <code>extent.<a href="GridExtent.html#getSize(int)">getSize</a>(i)</code> ≥ 2 and no shift (see below) then:<ul> |
| <li><code>extent.<a href="GridExtent.html#getLow(int)">getLow</a>(i)</code> ≤ |
| <code><a href="#getCoordinateFractional(int)">getCoordinateFractional</a>(i)</code></li> |
| <li><code>extent.<a href="GridExtent.html#getHigh(int)">getHigh</a>(i)</code> ≥ |
| <code><a href="#getCoordinateFractional(int)">getCoordinateFractional</a>(i)</code></li> |
| </ul></li> |
| <li>If <code>bounds.getSize(i)</code> ≥ <code>size[i]</code> and <code>size[i]</code> ≠ 0 then:<ul> |
| <li><code>extent.<a href="GridExtent.html#getSize(int)">getSize</a>(i)</code> = <code>size[i]</code></li> |
| </ul></li> |
| </ol> |
| |
| <p>The <code>size</code> argument is optional and can be incomplete (i.e. the number of <code>size</code> values can be |
| less than the number of dimensions). For each dimension <var>i</var>, if a <code>size[i]</code> value is provided |
| and is not zero, then this method tries to expand the extent in that dimension to the specified <code>size[i]</code> |
| value as shown in constraint #2 above. Otherwise the default size is the smallest possible extent that met |
| constraint #1 above, clipped to the <code>bounds</code>. This implies a size of 1 if the grid coordinate in that |
| dimension is an integer, or a size of 2 (before clipping to the bounds) if the grid coordinate has a fractional |
| part.</p> |
| |
| <p>The <code>bounds</code> argument is also optional. |
| If non-null, then this method enforces the following additional rules:</p> |
| |
| <ul> |
| <li>Coordinates rounded to nearest integers must be inside the given bounds, |
| otherwise a <a href="../PointOutsideCoverageException.html" title="class in org.apache.sis.coverage"><code>PointOutsideCoverageException</code></a> is thrown.</li> |
| <li>If the computed extent overlaps an area outside the bounds, then the extent will be shifted (if an explicit |
| size was given) or clipped (if automatic size is used) in order to be be fully contained inside the bounds.</li> |
| <li>If a given size is larger than the corresponding bounds <a href="GridExtent.html#getSize(int)">size</a>, |
| then the returned extent will be clipped to the bounds.</li> |
| </ul> |
| |
| <p>In all cases, this method tries to keep the grid coordinates close to the center of the returned extent. |
| A shift may exist if necessary for keeping the extent inside the <code>bounds</code> argument, but will never |
| move the grid coordinates outside the [<var>low</var> … <var>high</var>+1) range of returned extent.</p></div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>bounds</code> - if the coordinates shall be contained inside a grid, that grid extent. Otherwise <code>null</code>.</dd> |
| <dd><code>size</code> - the desired extent sizes as strictly positive numbers, or 0 sentinel values for automatic |
| sizes (1 or 2 depending on bounds and coordinate values). This array may have any length; |
| if shorter than the number of dimensions, missing values default to 0. |
| If longer than the number of dimensions, extra values are ignored.</dd> |
| <dt>Returns:</dt> |
| <dd>a grid extent of the given size (if possible) containing those grid coordinates.</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 a <code>size</code> value is negative.</dd> |
| <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 a coordinate value is outside the range of <code>long</code> values.</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 <code>bounds</code> dimension is not equal to grid coordinates dimension.</dd> |
| <dd><code><a href="../PointOutsideCoverageException.html" title="class in org.apache.sis.coverage">PointOutsideCoverageException</a></code> - if the grid coordinates (rounded to nearest integers) are outside the |
| given bounds.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="toPosition(org.opengis.referencing.operation.MathTransform)"> |
| <h3>toPosition</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/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">DirectPosition</a></span> <span class="element-name">toPosition</span><wbr><span class="parameters">(<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> gridToCRS)</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 grid coordinates converted to a geospatial position using the given transform. |
| The <code>gridToCRS</code> argument is typically <a href="GridGeometry.html#getGridToCRS(org.opengis.referencing.datum.PixelInCell)"><code>GridGeometry.getGridToCRS(PixelInCell)</code></a> |
| with <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html#CELL_CENTER" title="class or interface in org.opengis.referencing.datum" class="external-link"><code>PixelInCell.CELL_CENTER</code></a>.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>gridToCRS</code> - the transform to apply on grid coordinates.</dd> |
| <dt>Returns:</dt> |
| <dd>the grid coordinates converted using the given transform.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">TransformException</a></code> - if the grid coordinates cannot be converted by <code>gridToCRS</code>.</dd> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="tag-list-long"> |
| <li><a href="GridCoverage.Evaluator.html#toGridCoordinates(org.opengis.geometry.DirectPosition)"><code>GridCoverage.Evaluator.toGridCoordinates(DirectPosition)</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 grid coordinates for debugging purpose.</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> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="hashCode()"> |
| <h3>hashCode</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">hashCode</span>()</div> |
| <div class="block">Returns a hash code value for this grid coordinates.</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#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="equals(java.lang.Object)"> |
| <h3>equals</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">equals</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a> object)</span></div> |
| <div class="block">Compares this grid coordinates with the specified object for equality.</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#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a></code> in class <code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>object</code> - the object to compares with this grid coordinates.</dd> |
| <dt>Returns:</dt> |
| <dd><code>true</code> if the given object is equal to this grid coordinates.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| </div> |
| </div> |
| </body> |
| </html> |