blob: 508768ea8fc9eb4bb8f9de87b4c6b9b0b3d04bd5 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (19) -->
<title>GridDerivation (Apache SIS 1.3 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.sis.coverage.grid, class: GridDerivation">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.coverage.grid.GridDerivation class">
<meta name="keywords" content="base">
<meta name="keywords" content="rounding()">
<meta name="keywords" content="clipping()">
<meta name="keywords" content="margin()">
<meta name="keywords" content="chunkSize()">
<meta name="keywords" content="maximumSubsampling()">
<meta name="keywords" content="subgrid()">
<meta name="keywords" content="slice()">
<meta name="keywords" content="sliceByRatio()">
<meta name="keywords" content="build()">
<meta name="keywords" content="getIntersection()">
<meta name="keywords" content="getSubsampling()">
<meta name="keywords" content="getSubsamplingOffsets()">
<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">
<link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/GridDerivation.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li><a href="#field-summary">Field</a></li>
<li><a href="#constructor-summary">Constr</a></li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li><a href="#field-detail">Field</a></li>
<li><a href="#constructor-detail">Constr</a></li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><a href="../../../../../search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.coverage.grid</a></div>
<h1 title="Class GridDerivation" class="title">Class GridDerivation</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance">GridDerivation</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">GridDerivation</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
<div class="block">Creates a new grid geometry derived from a base grid geometry with different extent or resolution.
<code>Grid­Derivation</code> are created by calls to <a href="GridGeometry.html#derive()"><code>Grid­Geometry​.derive()</code></a>.
Properties of the desired grid geometry can be specified by calls to the following methods,
in that order (each method is optional):
<ol>
<li><a href="#rounding(org.apache.sis.coverage.grid.GridRoundingMode)"><code>rounding(Grid­Rounding­Mode)</code></a>, <a href="#margin(int...)"><code>margin(int...)</code></a> and/or <a href="#chunkSize(int...)"><code>chunk­Size(int...)</code></a> in any order</li>
<li><a href="#subgrid(org.apache.sis.coverage.grid.GridGeometry)"><code>subgrid(Grid­Geometry)</code></a>, <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a> or <a href="#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)"><code>subgrid(Grid­Extent, int...)</code></a></li>
<li><a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(Direct­Position)</code></a> and/or <a href="#sliceByRatio(double,int...)"><code>slice­By­Ratio(double, int...)</code></a></li>
</ol>
Then the grid geometry is created by a call to <a href="#build()"><code>build()</code></a>.
The <a href="#getIntersection()"><code>get­Intersection()</code></a> method can also be invoked for the <a href="GridExtent.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Extent</code></a> part without subsampling.
<p>All methods in this class preserve the number of dimensions. For example, the <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(Direct­Position)</code></a> method sets
the <a href="GridExtent.html#getSize(int)">grid size</a> to 1 in all dimensions specified by the <cite>slice point</cite>,
but does not remove those dimensions from the grid geometry.
For dimensionality reduction, see <a href="GridGeometry.html#selectDimensions(int...)"><code>Grid­Geometry​.select­Dimensions(int[])</code></a>.</p></div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="GridGeometry.html#derive()"><code>Grid­Geometry​.derive()</code></a></li>
<li><a href="GridGeometry.html#selectDimensions(int...)"><code>Grid­Geometry​.select­Dimensions(int[])</code></a></li>
</ul>
</dd>
<p><font size="-1">Defined in the <code>sis-feature</code> module</font></p>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>protected final <a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">Grid­Geometry</a></code></div>
<div class="col-second even-row-color"><code><a href="#base" class="member-name-link">base</a></code></div>
<div class="col-last even-row-color">
<div class="block">The base grid geometry from which to derive a new grid geometry.</div>
</div>
</div>
</section>
</li>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier</div>
<div class="table-header col-second">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>protected </code></div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.apache.sis.coverage.grid.GridGeometry)" class="member-name-link">Grid­Derivation</a><wbr>(<a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">Grid­Geometry</a>&nbsp;base)</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a new builder for deriving a grid geometry from the specified base.</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><a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">Grid­Geometry</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#build()" class="member-name-link">build</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Builds a grid geometry with the configuration specified by the other methods in this <code>Grid­Derivation</code> class.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#chunkSize(int...)" class="member-name-link">chunk­Size</a><wbr>(int...&nbsp;cell­Counts)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies the size of tiles or chunks in the base grid geometry.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clipping(org.apache.sis.coverage.grid.GridClippingMode)" class="member-name-link">clipping</a><wbr>(<a href="GridClippingMode.html" title="enum class in org.apache.sis.coverage.grid">Grid­Clipping­Mode</a>&nbsp;mode)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies whether to clip the derived grid extent to the extent of the base grid geometry.</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">Grid­Extent</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getIntersection()" class="member-name-link">get­Intersection</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 extent of the modified grid geometry, ignoring subsampling or changes in resolution.</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="#getSubsampling()" class="member-name-link">get­Subsampling</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 strides for accessing cells along each axis of the base grid.</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="#getSubsamplingOffsets()" class="member-name-link">get­Subsampling­Offsets</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 offsets to be subtracted from pixel coordinates before subsampling.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#margin(int...)" class="member-name-link">margin</a><wbr>(int...&nbsp;cell­Counts)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies an amount of cells by which to expand <code>Grid­Extent</code> after rounding.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#maximumSubsampling(int...)" class="member-name-link">maximum­Subsampling</a><wbr>(int...&nbsp;subsampling)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Specifies the maximum subsampling values (inclusive) for each dimension.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#rounding(org.apache.sis.coverage.grid.GridRoundingMode)" class="member-name-link">rounding</a><wbr>(<a href="GridRoundingMode.html" title="enum class in org.apache.sis.coverage.grid">Grid­Rounding­Mode</a>&nbsp;mode)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Controls behavior of rounding from floating point values to integers.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#slice(org.opengis.geometry.DirectPosition)" class="member-name-link">slice</a><wbr>(<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">Direct­Position</a>&nbsp;slice­Point)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests a grid geometry for a slice at the given "real world" position.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#sliceByRatio(double,int...)" class="member-name-link">slice­By­Ratio</a><wbr>(double&nbsp;slice­Ratio,
int...&nbsp;dimensions­To­Keep)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests a grid geometry for a slice at the given relative position.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)" class="member-name-link">subgrid</a><wbr>(<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">Grid­Extent</a>&nbsp;area­Of­Interest,
int...&nbsp;subsampling)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests a grid geometry over a sub-region of the base grid geometry and optionally with subsampling.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#subgrid(org.apache.sis.coverage.grid.GridGeometry)" class="member-name-link">subgrid</a><wbr>(<a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">Grid­Geometry</a>&nbsp;area­Of­Interest)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adapts the base grid for the geographic area and resolution of the given grid geometry.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">Grid­Derivation</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#subgrid(org.opengis.geometry.Envelope,double...)" class="member-name-link">subgrid</a><wbr>(<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>&nbsp;area­Of­Interest,
double...&nbsp;resolution)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Requests a grid geometry over a sub-envelope and optionally with a coarser resolution.</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/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">to­String</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a string representation of this <code>Grid­Derivation</code> for debugging purpose.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#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/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">get­Class</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="base">
<h3>base</h3>
<div class="member-signature"><span class="modifiers">protected final</span>&nbsp;<span class="return-type"><a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">GridGeometry</a></span>&nbsp;<span class="element-name">base</span></div>
<div class="block">The base grid geometry from which to derive a new grid geometry.</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(org.apache.sis.coverage.grid.GridGeometry)">
<h3>GridDerivation</h3>
<div class="member-signature"><span class="modifiers">protected</span>&nbsp;<span class="element-name">GridDerivation</span><wbr><span class="parameters">(<a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">GridGeometry</a>&nbsp;base)</span></div>
<div class="block">Creates a new builder for deriving a grid geometry from the specified base.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>base</code> - the base to use as a template for deriving a new grid geometry.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="GridGeometry.html#derive()"><code>Grid­Geometry​.derive()</code></a></li>
</ul>
</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="rounding(org.apache.sis.coverage.grid.GridRoundingMode)">
<h3>rounding</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">rounding</span><wbr><span class="parameters">(<a href="GridRoundingMode.html" title="enum class in org.apache.sis.coverage.grid">GridRoundingMode</a>&nbsp;mode)</span></div>
<div class="block">Controls behavior of rounding from floating point values to integers.
This setting modifies computations performed by the following methods
(it has no effect on other methods in this <code>Grid­Derivation</code> class):
<ul>
<li><a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(Direct­Position)</code></a></li>
<li><a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a></li>
</ul>
If this method is never invoked, the default value is <a href="GridRoundingMode.html#NEAREST"><code>Grid­Rounding­Mode​.NEAREST</code></a>.
If this method is invoked too late, an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link"><code>Illegal­State­Exception</code></a> is thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>mode</code> - the new rounding mode.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a> or <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(Direct­Position)</code></a>
has already been invoked.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="clipping(org.apache.sis.coverage.grid.GridClippingMode)">
<h3>clipping</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">clipping</span><wbr><span class="parameters">(<a href="GridClippingMode.html" title="enum class in org.apache.sis.coverage.grid">GridClippingMode</a>&nbsp;mode)</span></div>
<div class="block">Specifies whether to clip the derived grid extent to the extent of the base grid geometry.
The default value is <a href="GridClippingMode.html#STRICT"><code>Grid­Clipping­Mode​.STRICT</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>mode</code> - whether to clip the derived grid extent.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a> or <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(Direct­Position)</code></a>
has already been invoked.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="margin(int...)">
<h3>margin</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">margin</span><wbr><span class="parameters">(int...&nbsp;cellCounts)</span></div>
<div class="block">Specifies an amount of cells by which to expand <code>Grid­Extent</code> after rounding.
This setting modifies computations performed by the following methods:
<ul>
<li><a href="#subgrid(org.apache.sis.coverage.grid.GridGeometry)"><code>subgrid(Grid­Geometry)</code></a></li>
<li><a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a></li>
<li><a href="#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)"><code>subgrid(Grid­Extent, int...)</code></a></li>
</ul>
For each dimension <var>i</var> of the grid computed by above methods, the <a href="GridExtent.html#getLow(int)">low</a>
grid coordinate is subtracted by <code>cell­Count[i]</code> and the <a href="GridExtent.html#getHigh(int)">high</a>
grid coordinate is increased by <code>cell­Count[i]</code>.
This calculation is done in units of the <a href="#base">base</a> grid cells, i.e. before subsampling.
For example if subsampling is 2, then a margin of 6 cells specified with this method will result
in a margin of 3 cells in the grid extent computed by the <a href="#build()"><code>build()</code></a> method.
<div class="note"><b>Use case:</b>
if the caller wants to apply bilinear interpolations in an image, (s)he will need 1 more pixel on each image border.
If the caller wants to apply bi-cubic interpolations, (s)he will need 2 more pixels on each image border.</div>
If this method is never invoked, the default value is zero for all dimensions.
If this method is invoked too late, an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link"><code>Illegal­State­Exception</code></a> is thrown.
If the <code>cell­Counts</code> array length is shorter than the grid dimension,
then zero is assumed for all missing dimensions.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>cell­Counts</code> - number of cells by which to expand the grid extent.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if a value is negative.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a> or <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(Direct­Position)</code></a>
has already been invoked.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="GridExtent.html#expand(long...)"><code>Grid­Extent​.expand(long...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="chunkSize(int...)">
<h3>chunkSize</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">chunkSize</span><wbr><span class="parameters">(int...&nbsp;cellCounts)</span></div>
<div class="block">Specifies the size of tiles or chunks in the base grid geometry. If a chunk size is specified,
then the grid extent computed by <a href="#build()"><code>build()</code></a> will span an integer amount of chunks.
The grid coordinates (0, 0, …) locate the corner of a chunk.
<p>This property operates on the same methods than the <a href="#margin(int...)">margin</a>.
If both a margin and a chunk size are specified, then margins are added first
and the resulting grid coordinates are rounded to chunk size.
This calculation is done in units of the <a href="#base">base</a> grid cells, i.e. before subsampling.
For example if subsampling is 2, then a tile size of 20×20 pixels specified with this method will
result in a tile size of 10×10 cells in the grid extent computed by the <a href="#build()"><code>build()</code></a> method.</p>
<p>If this method is never invoked, the default value is one for all dimensions.
If this method is invoked too late, an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link"><code>Illegal­State­Exception</code></a> is thrown.
If the <code>cell­Counts</code> array length is shorter than the grid dimension,
then one is assumed for all missing dimensions.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>cell­Counts</code> - number of cells in all tiles or chunks.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if a value is zero or negative.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a> or <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(Direct­Position)</code></a>
has already been invoked.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="maximumSubsampling(int...)">
<h3>maximumSubsampling</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">maximumSubsampling</span><wbr><span class="parameters">(int...&nbsp;subsampling)</span></div>
<div class="block">Specifies the maximum subsampling values (inclusive) for each dimension.
If a subsampling value is greater than a specified value in the corresponding dimension,
the subsampling will be clamped to the specified maximal value.
Setting a maximum value of 1 in a dimension is equivalent to disabling subsampling in that dimension.
<p>If this method is never invoked, then there is no maximum value.
If this method is invoked too late, an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link"><code>Illegal­State­Exception</code></a> is thrown.
If the <code>cell­Counts</code> array length is shorter than the grid dimension,
then all missing dimensions have no maximum value.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>subsampling</code> - maximal subsampling values (inclusive).</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if a value is zero or negative.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a> or <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(Direct­Position)</code></a>
has already been invoked.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="subgrid(org.apache.sis.coverage.grid.GridGeometry)">
<h3>subgrid</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">subgrid</span><wbr><span class="parameters">(<a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">GridGeometry</a>&nbsp;areaOfInterest)</span></div>
<div class="block">Adapts the base grid for the geographic area and resolution of the given grid geometry.
The new grid geometry will cover the spatiotemporal region given by <code>area­Of­Interest</code> envelope
(coordinate operations are applied as needed if the Coordinate Reference Systems are not the same).
The new grid geometry resolution will be integer multiples of the <a href="#base"><code>base</code></a> grid geometry resolution.
<div class="note"><b>Usage:</b>
This method can be helpful for implementation of
<a href="../../storage/GridCoverageResource.html#read(org.apache.sis.coverage.grid.GridGeometry,int...)"><code>Grid­Coverage­Resource​.read(Grid­Geometry, int...)</code></a>.
Example:
<blockquote><pre><font color="green">class</font> MyDataStorage <font color="green">extends</font> GridCoverageResource {
@Override
<font color="green">public</font> GridCoverage <b>read</b>(GridGeometry domain, <font color="green">int</font>... range) <font color="green">throws</font> DataStoreException {
GridDerivation change = <b>getGridGeometry</b>().<b>derive</b>().<b>subgrid</b>(domain);
GridExtent toRead = change.<b>buildExtent</b>();
<font color="green">int</font>[] subsampling = change.<b>getSubsampling</b>());
<i><font color="gray">// Do reading here.</font></i>
}
}</pre></blockquote>
</div>
If <code>grid­Extent</code> contains only an envelope, then this method delegates to <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a>.
Otherwise if <code>grid­Extent</code> contains only an extent, then this method delegates to <a href="#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)"><code>subgrid(Grid­Extent, int...)</code></a>.
Otherwise the following information are mandatory:
<ul>
<li><a href="GridGeometry.html#getExtent()">Extent</a> in <code>area­Of­Interest</code>.</li>
<li><a href="GridGeometry.html#getGridToCRS(org.opengis.referencing.datum.PixelInCell)">Grid to CRS</a> conversion in <code>area­Of­Interest</code>.</li>
<li><a href="GridGeometry.html#getGridToCRS(org.opengis.referencing.datum.PixelInCell)">Grid to CRS</a> conversion in <a href="#base"><code>base</code></a> grid.</li>
</ul>
The following information are optional but recommended:
<ul>
<li><a href="GridGeometry.html#getCoordinateReferenceSystem()">Coordinate reference system</a> in <code>area­Of­Interest</code>.</li>
<li><a href="GridGeometry.html#getCoordinateReferenceSystem()">Coordinate reference system</a> in <a href="#base"><code>base</code></a> grid.</li>
<li><a href="GridGeometry.html#getExtent()">Extent</a> in <a href="#base"><code>base</code></a> grid.</li>
</ul>
Optional <a href="#margin(int...)">margin</a> and <a href="#chunkSize(int...)">chunk size</a> can be specified
for increasing the size of the grid extent computed by this method. For example if the caller wants to apply
bilinear interpolations in an image, (s)he will need 1 more pixel on each image border.
If the caller wants to apply bi-cubic interpolations, (s)he will need 2 more pixels on each image border.
<p>Notes:</p>
<ul>
<li>This method can be invoked only once.</li>
<li>This method cannot be used together with another <code>subgrid(…)</code> method.</li>
<li><a href="#rounding(org.apache.sis.coverage.grid.GridRoundingMode)">Rounding mode</a>, <a href="#clipping(org.apache.sis.coverage.grid.GridClippingMode)">clipping mode</a>,
<a href="#margin(int...)">margin</a> and <a href="#chunkSize(int...)">chunk size</a>,
if different than default values, should be set before to invoke this method.</li>
<li><a href="#slice(org.opengis.geometry.DirectPosition)">Slicing</a> can be applied after this method.</li>
<li>This method does not reduce the number of dimensions of the grid geometry.
For dimensionality reduction, see <a href="GridGeometry.html#selectDimensions(int...)"><code>Grid­Geometry​.select­Dimensions(int[])</code></a>.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>area­Of­Interest</code> - the area of interest and desired resolution as a grid geometry.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="DisjointExtentException.html" title="class in org.apache.sis.coverage.grid">Disjoint­Extent­Exception</a></code> - if the given grid of interest does not intersect the grid extent.</dd>
<dd><code><a href="IncompleteGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Incomplete­Grid­Geometry­Exception</a></code> - if a mandatory property of a grid geometry is absent.</dd>
<dd><code><a href="IllegalGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Illegal­Grid­Geometry­Exception</a></code> - if an error occurred while converting the envelope coordinates to grid coordinates.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if a <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(…)</code></a> or <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(…)</code></a>
method has already been invoked.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#getIntersection()"><code>get­Intersection()</code></a></li>
<li><a href="#getSubsampling()"><code>get­Subsampling()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="subgrid(org.opengis.geometry.Envelope,double...)">
<h3>subgrid</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">subgrid</span><wbr><span class="parameters">(<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>&nbsp;areaOfInterest,
double...&nbsp;resolution)</span></div>
<div class="block">Requests a grid geometry over a sub-envelope and optionally with a coarser resolution.
The given envelope does not need to be expressed in the same coordinate reference system (CRS)
than <a href="GridGeometry.html#getCoordinateReferenceSystem()">the CRS of the base grid geometry</a>;
coordinate conversions or transformations will be applied as needed.
That envelope CRS may have fewer dimensions than the base grid geometry CRS,
in which case grid dimensions not mapped to envelope dimensions will be returned unchanged.
The target resolution, if provided, shall be in same units and same order than the given envelope axes.
If the length of <code>resolution</code> array is less than the number of dimensions of <code>area­Of­Interest</code>,
then no subsampling will be applied on the missing dimensions.
<p>Notes:</p>
<ul>
<li>This method can be invoked only once.</li>
<li>This method cannot be used together with another <code>subgrid(…)</code> method.</li>
<li><a href="#rounding(org.apache.sis.coverage.grid.GridRoundingMode)">Rounding mode</a>, <a href="#clipping(org.apache.sis.coverage.grid.GridClippingMode)">clipping mode</a>,
<a href="#margin(int...)">margin</a> and <a href="#chunkSize(int...)">chunk size</a>,
if different than default values, should be set before to invoke this method.</li>
<li><a href="#slice(org.opengis.geometry.DirectPosition)">Slicing</a> can be applied after this method.</li>
<li>This method does not reduce the number of dimensions of the grid geometry.
For dimensionality reduction, see <a href="GridGeometry.html#selectDimensions(int...)"><code>Grid­Geometry​.select­Dimensions(int[])</code></a>.</li>
<li>If the given envelope is known to be expressed in the same CRS than the grid geometry,
then the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html#getCoordinateReferenceSystem()" title="class or interface in org.opengis.geometry" class="external-link">CRS of the envelope</a>
can be left unspecified (<code>null</code>). It may give a slight performance improvement
by avoiding the check for coordinate transformation.</li>
<li>Subsampling computed by this method may be fractional. Consequently, calls to <a href="#getSubsampling()"><code>get­Subsampling()</code></a> and
<a href="#getSubsamplingOffsets()"><code>get­Subsampling­Offsets()</code></a> after this method may cause an <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link"><code>Illegal­State­Exception</code></a> to be thrown.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>area­Of­Interest</code> - the desired spatiotemporal region in any CRS (transformations will be applied as needed),
or <code>null</code> for not restricting the sub-grid to a sub-area.</dd>
<dd><code>resolution</code> - the desired resolution in the same units and order than the axes of the given envelope,
or <code>null</code> or an empty array if no subsampling is desired. The array length should
be equal to the <code>area­Of­Interest</code> dimension, but this is not mandatory
(zero or missing values mean no sub-sampling, extraneous values are ignored).</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="DisjointExtentException.html" title="class in org.apache.sis.coverage.grid">Disjoint­Extent­Exception</a></code> - if the given area of interest does not intersect the grid extent.</dd>
<dd><code><a href="IncompleteGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Incomplete­Grid­Geometry­Exception</a></code> - if the base grid geometry has no extent, no "grid to CRS" transform,
or no CRS (unless <code>area­Of­Interest</code> has no CRS neither, in which case the CRS are assumed the same).</dd>
<dd><code><a href="IllegalGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Illegal­Grid­Geometry­Exception</a></code> - if an error occurred while converting the envelope coordinates to grid coordinates.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if a <a href="#subgrid(org.apache.sis.coverage.grid.GridGeometry)"><code>subgrid(…)</code></a> or <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(…)</code></a>
method has already been invoked.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#getIntersection()"><code>get­Intersection()</code></a></li>
<li><a href="#getSubsampling()"><code>get­Subsampling()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="subgrid(org.apache.sis.coverage.grid.GridExtent,int...)">
<h3>subgrid</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">subgrid</span><wbr><span class="parameters">(<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a>&nbsp;areaOfInterest,
int...&nbsp;subsampling)</span></div>
<div class="block">Requests a grid geometry over a sub-region of the base grid geometry and optionally with subsampling.
The given grid geometry must have the same number of dimension than the base grid geometry.
If the length of <code>subsampling</code> array is less than the number of dimensions,
then no subsampling will be applied on the missing dimensions.
<p>Notes:</p>
<ul>
<li>This method can be invoked only once.</li>
<li>This method cannot be used together with another <code>subgrid(…)</code> method.</li>
<li><a href="#rounding(org.apache.sis.coverage.grid.GridRoundingMode)">Rounding mode</a>, <a href="#clipping(org.apache.sis.coverage.grid.GridClippingMode)">clipping mode</a>,
<a href="#margin(int...)">margin</a> and <a href="#chunkSize(int...)">chunk size</a>,
if different than default values, should be set before to invoke this method.</li>
<li><a href="#slice(org.opengis.geometry.DirectPosition)">Slicing</a> can be applied after this method.</li>
<li>This method does not reduce the number of dimensions of the grid geometry.
For dimensionality reduction, see <a href="GridGeometry.html#selectDimensions(int...)"><code>Grid­Geometry​.select­Dimensions(int[])</code></a>.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>area­Of­Interest</code> - the desired grid extent in unit of base grid cell (i.e. ignoring subsampling),
or <code>null</code> for not restricting the sub-grid to a sub-area.</dd>
<dd><code>subsampling</code> - the subsampling to apply on each grid dimension, or <code>null</code> if none.
All values shall be greater than zero. If the array length is shorter than
the number of dimensions, missing values are assumed to be 1.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="DisjointExtentException.html" title="class in org.apache.sis.coverage.grid">Disjoint­Extent­Exception</a></code> - if the given area of interest does not intersect the grid extent.</dd>
<dd><code><a href="IncompleteGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Incomplete­Grid­Geometry­Exception</a></code> - if the base grid geometry has no extent, no "grid to CRS" transform,
or no CRS (unless <code>area­Of­Interest</code> has no CRS neither, in which case the CRS are assumed the same).</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if a <a href="#subgrid(org.apache.sis.coverage.grid.GridGeometry)"><code>subgrid(…)</code></a> or <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(…)</code></a>
method has already been invoked.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#getIntersection()"><code>get­Intersection()</code></a></li>
<li><a href="#getSubsampling()"><code>get­Subsampling()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="slice(org.opengis.geometry.DirectPosition)">
<h3>slice</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">slice</span><wbr><span class="parameters">(<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>&nbsp;slicePoint)</span></div>
<div class="block">Requests a grid geometry for a slice at the given "real world" position.
The given position can be expressed in any coordinate reference system (CRS).
The position should not define a coordinate for all dimensions, otherwise the slice would degenerate
to a single point. Dimensions can be left unspecified either by assigning to <code>slice­Point</code> a CRS
without those dimensions, or by assigning the NaN value to some coordinates.
<div class="note"><b>Example:</b>
if the <a href="GridGeometry.html#getCoordinateReferenceSystem()">coordinate reference system</a> of base grid geometry has
(<var>longitude</var>, <var>latitude</var>, <var>time</var>) axes, then a (<var>longitude</var>, <var>latitude</var>)
slice at time <var>t</var> can be created with one of the following two positions:
<ul>
<li>A three-dimensional position with (<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#NaN" title="class or interface in java.lang" class="external-link"><code>Double​.Na­N</code></a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Double.html#NaN" title="class or interface in java.lang" class="external-link"><code>Double​.Na­N</code></a>, <var>t</var>) coordinates.</li>
<li>A one-dimensional position with (<var>t</var>) coordinate and the coordinate reference system set to
<a href="../../referencing/CRS.html#getTemporalComponent(org.opengis.referencing.crs.CoordinateReferenceSystem)">the temporal component</a>
of the grid geometry CRS.</li>
</ul></div>
<p>Notes:</p>
<ul>
<li>This method can be invoked after <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a>, but not before.</li>
<li>If a non-default rounding mode is desired, it should be <a href="#rounding(org.apache.sis.coverage.grid.GridRoundingMode)">specified</a>
before to invoke this method.</li>
<li>This method does not reduce the number of dimensions of the grid geometry.
For dimensionality reduction, see <a href="GridGeometry.html#selectDimensions(int...)"><code>Grid­Geometry​.select­Dimensions(int[])</code></a>.</li>
<li>If the given point is known to be expressed in the same CRS than the grid geometry,
then the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html#getCoordinateReferenceSystem()" title="class or interface in org.opengis.geometry" class="external-link">CRS of the point</a>
can be left unspecified (<code>null</code>). It may give a slight performance improvement
by avoiding the check for coordinate transformation.</li>
</ul></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>slice­Point</code> - the coordinates where to get a slice. If no coordinate reference system is associated,
this method assumes that the slice point CRS is the CRS of the base grid geometry.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="IncompleteGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Incomplete­Grid­Geometry­Exception</a></code> - if the base grid geometry has no extent, no "grid to CRS" transform,
or no CRS (unless <code>slice­Point</code> has no CRS neither, in which case the CRS are assumed the same).</dd>
<dd><code><a href="IllegalGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Illegal­Grid­Geometry­Exception</a></code> - if an error occurred while converting the point coordinates to grid coordinates.</dd>
<dd><code><a href="../PointOutsideCoverageException.html" title="class in org.apache.sis.coverage">Point­Outside­Coverage­Exception</a></code> - if the given point is outside the grid extent.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="sliceByRatio(double,int...)">
<h3>sliceByRatio</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridDerivation.html" title="class in org.apache.sis.coverage.grid">GridDerivation</a></span>&nbsp;<span class="element-name">sliceByRatio</span><wbr><span class="parameters">(double&nbsp;sliceRatio,
int...&nbsp;dimensionsToKeep)</span></div>
<div class="block">Requests a grid geometry for a slice at the given relative position.
The relative position is specified by a ratio between 0 and 1 where 0 maps to <a href="GridExtent.html#getLow(int)">low</a>
grid coordinates, 1 maps to <a href="GridExtent.html#getHigh(int)">high grid coordinates</a> and 0.5 maps to the median position.
The slicing is applied on all dimensions except the specified dimensions to keep.
<div class="note"><b>Example:</b>
given a <var>n</var>-dimensional cube, the following call creates a slice of the two first dimensions
(numbered 0 and 1, typically the dimensions of <var>x</var> and <var>y</var> axes)
located at the center (ratio 0.5) of all other dimensions (typically <var>z</var> and/or <var>t</var> axes):
<blockquote><pre>gridGeometry.<b>derive</b>().<b>sliceByRatio</b>(0.5, 0, 1).<b>build</b>();</pre></blockquote>
</div></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>slice­Ratio</code> - the ratio to apply on all grid dimensions except the ones to keep.</dd>
<dd><code>dimensions­To­Keep</code> - the grid dimension to keep unchanged.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method call chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="IncompleteGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Incomplete­Grid­Geometry­Exception</a></code> - if the base grid geometry has no extent.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if a <code>dimensions­To­Keep</code> value is out of bounds.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="build()">
<h3>build</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">GridGeometry</a></span>&nbsp;<span class="element-name">build</span>()</div>
<div class="block">Builds a grid geometry with the configuration specified by the other methods in this <code>Grid­Derivation</code> class.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the modified grid geometry. May be the <a href="#base"><code>base</code></a> grid geometry if no change apply.</dd>
<dt>Throws:</dt>
<dd><code><a href="IllegalGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Illegal­Grid­Geometry­Exception</a></code> - if the grid geometry cannot be computed
because of arguments given to a <code>subgrid(…)</code> or other methods.</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="#getIntersection()"><code>get­Intersection()</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getIntersection()">
<h3>getIntersection</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a></span>&nbsp;<span class="element-name">getIntersection</span>()</div>
<div class="block">Returns the extent of the modified grid geometry, ignoring subsampling or changes in resolution.
This is the intersection of the <a href="#base"><code>base</code></a> grid geometry with the (grid or geospatial) envelope
given to a <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(…)</code></a> method,
expanded by the <a href="#margin(int...)">specified margin</a> (if any)
and potentially with some <a href="GridExtent.html#getSize(int)">grid sizes</a> set to 1
if a <a href="#slice(org.opengis.geometry.DirectPosition)"><code>slice(…)</code></a> method has been invoked.
The returned extent is in units of the <a href="#base"><code>base</code></a> grid cells, i.e.
<a href="#getSubsampling()">subsampling</a> is ignored.
<p>This method can be invoked after <a href="#build()"><code>build()</code></a> for getting additional information.</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>intersection of grid geometry extents in units of <a href="#base"><code>base</code></a> grid cells.</dd>
<dt>Throws:</dt>
<dd><code><a href="IncompleteGridGeometryException.html" title="class in org.apache.sis.coverage.grid">Incomplete­Grid­Geometry­Exception</a></code> - if the base grid geometry has no extent.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSubsampling()">
<h3>getSubsampling</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int[]</span>&nbsp;<span class="element-name">getSubsampling</span>()</div>
<div class="block">Returns the strides for accessing cells along each axis of the base grid.
Those values define part of the conversion from <em>derived</em> grid coordinates
(<var>x</var>, <var>y</var>, <var>z</var>) to <a href="#base">base</a> grid coordinates
(<var>x′</var>, <var>y′</var>, <var>z′</var>) as below (generalize to as many dimensions as needed):
<ul>
<li><var>x′</var> = s₀⋅<var>x</var> + t₀</li>
<li><var>y′</var> = s₁⋅<var>y</var> + t₁</li>
<li><var>z′</var> = s₂⋅<var>z</var> + t₂</li>
</ul>
This method returns the {s₀, s₁, s₂} values while <a href="#getSubsamplingOffsets()"><code>get­Subsampling­Offsets()</code></a>
returns the {t₀, t₁, t₂} values. All subsampling values are strictly positive integers.
<div class="note"><b>Application to iterations</b><br>
Iteration over <code>area­Of­Interest</code> grid coordinates with a stride Δ<var>x</var>=1
corresponds to an iteration in <a href="#base"><code>base</code></a> grid coordinates with a stride of Δ<var>x′</var>=s₀,
a stride Δ<var>y</var>=1 corresponds to a stride Δ<var>y′</var>=s₁, <i>etc.</i></div>
This method can be invoked after <a href="#build()"><code>build()</code></a> for getting additional information.
If <a href="#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)"><code>subgrid(Grid­Extent, int...)</code></a> has been invoked, then this method returns the
values that were given in the <code>subsampling</code> argument.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>an <em>estimation</em> of the strides for accessing cells along each axis of <a href="#base"><code>base</code></a> grid.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if the subsampling factors are not integers. It may happen if the derived
grid has been constructed by a call to <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a>.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="#getSubsamplingOffsets()"><code>get­Subsampling­Offsets()</code></a></li>
<li><a href="#subgrid(org.apache.sis.coverage.grid.GridGeometry)"><code>subgrid(Grid­Geometry)</code></a></li>
<li><a href="#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)"><code>subgrid(Grid­Extent, int...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSubsamplingOffsets()">
<h3>getSubsamplingOffsets</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int[]</span>&nbsp;<span class="element-name">getSubsamplingOffsets</span>()</div>
<div class="block">Returns the offsets to be subtracted from pixel coordinates before subsampling.
In a conversion from <em>derived</em> grid to <a href="#base">base</a> grid coordinates
(the opposite direction of subsampling), the offset is the value to add after
multiplication by the subsampling factor. It may be negative.
<p>This method can be invoked after <a href="#build()"><code>build()</code></a> for getting additional information.</p></div>
<dl class="notes">
<dt>Returns:</dt>
<dd>conversion from the new grid to the original grid specified to the constructor.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if the subsampling offsets are not integers. It may happen if the
derived grid has been constructed by a call to <a href="#subgrid(org.opengis.geometry.Envelope,double...)"><code>subgrid(Envelope, double...)</code></a>.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="see-list-long">
<li><a href="#getSubsampling()"><code>get­Subsampling()</code></a></li>
<li><a href="#subgrid(org.apache.sis.coverage.grid.GridGeometry)"><code>subgrid(Grid­Geometry)</code></a></li>
<li><a href="#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)"><code>subgrid(Grid­Extent, int...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toString()">
<h3>toString</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">toString</span>()</div>
<div class="block">Returns a string representation of this <code>Grid­Derivation</code> for debugging purpose.
The returned string is implementation dependent and may change in any future version.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">to­String</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
<dt>Returns:</dt>
<dd>a string representation of this <code>Grid­Derivation</code> for debugging purpose.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2010&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>