blob: 7bb958bde1a63a8ef4e790b8b90558c01a7f8f10 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 -->
<title>GridCoverageBuilder (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: GridCoverageBuilder">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.coverage.grid.GridCoverageBuilder class">
<meta name="keywords" content="setDomain()">
<meta name="keywords" content="setRanges()">
<meta name="keywords" content="addRange()">
<meta name="keywords" content="setValues()">
<meta name="keywords" content="flipGridAxis()">
<meta name="keywords" content="addImageProperty()">
<meta name="keywords" content="build()">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../sis.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../script-dir/jquery-ui.min.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="../../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li>Field</li>
<li><a href="#constructor-summary">Constr</a></li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li><a href="#constructor-detail">Constr</a></li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><a href="../../../../../../search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="module-label-in-type">Module</span>&nbsp;<a href="../../../../../module-summary.html">org.apache.sis.feature</a></div>
<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 GridCoverageBuilder" class="title">Class GridCoverageBuilder</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">GridCoverageBuilder</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">GridCoverageBuilder</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></span></div>
<div class="block">Helper class for the creation of <a href="GridCoverage.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Coverage</code></a> instances.
A grid coverage is a function described by three parts:
<ul>
<li>A <cite>domain</cite>, which describes the input values (e.g. geographic coordinates).</li>
<li>One or more <cite>ranges</cite>, which describe the output values that the coverage can produce.</li>
<li>The actual values, distributed on a regular grid.</li>
</ul>
Each of those parts can be set by a <code>set­Domain(…)</code>, <code>set­Ranges(…)</code> or <code>set­Values(…)</code> method.
Those methods are overloaded with many variants accepting different kind of arguments. For example, values can
be specified as a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/RenderedImage.html" title="class or interface in java.awt.image" class="external-link"><code>Rendered­Image</code></a>, a <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/Raster.html" title="class or interface in java.awt.image" class="external-link"><code>Raster</code></a> or some other types.
<h2 id="example-heading">Example</h2>
The easiest way to create a <a href="GridCoverage.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Coverage</code></a> from a matrix of values is to set the values in a
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/WritableRaster.html" title="class or interface in java.awt.image" class="external-link"><code>Writable­Raster</code></a> and to specify the domain as an <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"><code>Envelope</code></a>:
<div class="snippet-container"><button class="copy snippet-copy" aria-label="Copy snippet" onclick="copySnippet(this)"><span data-copied="Copied!">Copy</span><img src="../../../../../../copy.svg" alt="Copy snippet"></button>
<pre class="snippet"><code class="language-java"> public GridCoverage createCoverage() {
WritableRaster data = Raster.createBandedRaster(DataBuffer.TYPE_USHORT, width, height, numBands, null);
for (int y=0; y&lt;height; y++) {
for (int x=0; x&lt;width; x++) {
int value = ...; // Compute a value here.
data.setSample(x, y, 0, value); // Set value in the first band.
}
}
var builder = new GridCoverageBuilder();
builder.setValues(data).flixAxis(1);
Envelope domain = ...; // Specify here the "real world" coordinates.
return builder.setDomain(domain).build();
}
</code></pre>
</div>
<h2 id="limitations-heading">Limitations</h2>
Current implementation creates only two-dimensional coverages.
A future version may extend this builder API for creating <var>n</var>-dimensional coverages.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="GridCoverage2D.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Coverage2D</code></a></li>
<li><a href="../SampleDimension.Builder.html" title="class in org.apache.sis.coverage"><code>Sample­Dimension​.Builder</code></a></li>
</ul>
</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Grid­Coverage­Builder</a>()</code></div>
<div class="col-last even-row-color">
<div class="block">Creates an initially empty builder.</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="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addImageProperty(java.lang.String,java.lang.Object)" class="member-name-link">add­Image­Property</a><wbr>(<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>&nbsp;key,
<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>&nbsp;value)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds a value associated to an image property.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addRange(org.apache.sis.coverage.SampleDimension)" class="member-name-link">add­Range</a><wbr>(<a href="../SampleDimension.html" title="class in org.apache.sis.coverage">Sample­Dimension</a>&nbsp;band)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Adds a sample dimension for one band.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverage.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage</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">Creates the grid coverage from the domain, ranges and values given to setter methods.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#flipGridAxis(int)" class="member-name-link">flip­Grid­Axis</a><wbr>(int&nbsp;dimension)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Reverses axis direction in the specified grid dimension.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setDomain(org.apache.sis.coverage.grid.GridGeometry)" class="member-name-link">set­Domain</a><wbr>(<a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">Grid­Geometry</a>&nbsp;grid)</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 domain envelope (including its CRS) and/or the transform from grid indices to domain coordinates.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setDomain(org.opengis.geometry.Envelope)" class="member-name-link">set­Domain</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;domain)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the domain as an enclosing envelope (including its CRS).</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setRanges(java.util.Collection)" class="member-name-link">set­Ranges</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a>&lt;? extends <a href="../SampleDimension.html" title="class in org.apache.sis.coverage">Sample­Dimension</a>&gt;&nbsp;bands)</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 sample dimensions for all bands.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setRanges(org.apache.sis.coverage.SampleDimension...)" class="member-name-link">set­Ranges</a><wbr>(<a href="../SampleDimension.html" title="class in org.apache.sis.coverage">Sample­Dimension</a>...&nbsp;bands)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the sample dimensions for all bands.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setValues(java.awt.image.DataBuffer,java.awt.Dimension)" class="member-name-link">set­Values</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/DataBuffer.html" title="class or interface in java.awt.image" class="external-link">Data­Buffer</a>&nbsp;data,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Dimension.html" title="class or interface in java.awt" class="external-link">Dimension</a>&nbsp;size)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets a two-dimensional slice of sample values as a Java2D data buffer.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setValues(java.awt.image.Raster)" class="member-name-link">set­Values</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/Raster.html" title="class or interface in java.awt.image" class="external-link">Raster</a>&nbsp;data)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets a two-dimensional slice of sample values as a raster.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">Grid­Coverage­Builder</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setValues(java.awt.image.RenderedImage)" class="member-name-link">set­Values</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/RenderedImage.html" title="class or interface in java.awt.image" class="external-link">Rendered­Image</a>&nbsp;data)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets a two-dimensional slice of sample values as a rendered image.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">get­Class</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">to­String</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;()">
<h3>GridCoverageBuilder</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">GridCoverageBuilder</span>()</div>
<div class="block">Creates an initially empty builder.</div>
</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="setDomain(org.apache.sis.coverage.grid.GridGeometry)">
<h3>setDomain</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">setDomain</span><wbr><span class="parameters">(<a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid">GridGeometry</a>&nbsp;grid)</span></div>
<div class="block">Sets the domain envelope (including its CRS) and/or the transform from grid indices to domain coordinates.
The given <code>Grid­Geometry</code> does not need to contain a <a href="GridExtent.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Extent</code></a> because that extent will be
computed automatically if needed. However if an extent is present, then it must be consistent with the
size of data given to <code>set­Values(…)</code> method (will be verified at <a href="#build()"><code>build()</code></a> time).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>grid</code> - the new grid geometry, or <code>null</code> for removing previous domain setting.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setDomain(org.opengis.geometry.Envelope)">
<h3>setDomain</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">setDomain</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;domain)</span></div>
<div class="block">Sets the domain as an enclosing envelope (including its CRS).
The given envelope should contain all pixel area. For example, the
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/Envelope.html#getLowerCorner()" title="class or interface in org.opengis.geometry" class="external-link">envelope lower corner</a> should locate the lower-left
(or upper-left, depending on <var>y</var> axis orientation) pixel corner, not pixel center.
If the given envelope contains a CRS, then that CRS will be the coverage CRS.
A transform from grid indices to domain coordinates will be created automatically.
That transform will map grid dimensions to envelope dimensions in the same order
(i.e. the matrix representation of the affine transform will be diagonal,
ignoring the translation column).
<h4 id="axis-directions-heading">Axis directions</h4>
By default grid indices increase in the same direction than domain coordinates.
When applied to images with pixels located by (<var>column</var>, <var>row</var>) indices,
it means that by default row indices in the image are increasing toward up if the <var>y</var>
coordinates in the coverage domain (e.g. latitude values) are also increasing toward up.
It often results in images flipped vertically, because popular image formats such as PNG
use row indices increasing in the opposite direction (toward down).
This effect can be compensated by invoking <code><a href="#flipGridAxis(int)">flip­Grid­Axis</a>(1)</code>.
<p><code>Grid­Coverage­Builder</code> provides method only for flipping axes.
If more sophisticated operations is desired (for example a rotation),
then <a href="#setDomain(org.apache.sis.coverage.grid.GridGeometry)"><code>set­Domain(Grid­Geometry)</code></a> should be used instead of this method.</p>
<h5 id="design-note-heading">Design note</h5>
<code>Grid­Coverage­Builder</code> does not flip the <var>y</var> axis by default because not all
file formats have row indices increasing toward down. A counter-example is the netCDF format.
Even if we consider that the majority of images have <var>y</var> axis flipped, things become
less obvious when considering data in more than two dimensions. Having the same default policy
(no flipping) for all dimensions make problem analysis easier.
<h4 id="default-implementation-heading">Default implementation</h4>
The default implementation creates a new <a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Geometry</code></a> from the given envelope
then invokes <a href="#setDomain(org.apache.sis.coverage.grid.GridGeometry)"><code>set­Domain(Grid­Geometry)</code></a>. Subclasses can override that later method
as a single overriding point for all domain settings.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>domain</code> - envelope of the coverage domain together with its CRS,
or <code>null</code> for removing previous domain setting.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#flipGridAxis(int)"><code>flip­Grid­Axis(int)</code></a></li>
<li><a href="GridGeometry.html#%3Cinit%3E(org.apache.sis.coverage.grid.GridExtent,org.opengis.geometry.Envelope,org.apache.sis.coverage.grid.GridOrientation)"><code>Grid­Geometry(Grid­Extent, Envelope, Grid­Orientation)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setRanges(java.util.Collection)">
<h3>setRanges</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">setRanges</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Collection.html" title="class or interface in java.util" class="external-link">Collection</a>&lt;? extends <a href="../SampleDimension.html" title="class in org.apache.sis.coverage">SampleDimension</a>&gt;&nbsp;bands)</span></div>
<div class="block">Sets the sample dimensions for all bands.
The list size must be equal to the number of bands in the data specified to
<code>set­Values(…)</code> method (it will be verified at <a href="#build()"><code>build()</code></a> time).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>bands</code> - the new sample dimensions, or <code>null</code> for removing previous range setting.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given list is empty.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../SampleDimension.Builder.html" title="class in org.apache.sis.coverage"><code>Sample­Dimension​.Builder</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setRanges(org.apache.sis.coverage.SampleDimension...)">
<h3>setRanges</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">setRanges</span><wbr><span class="parameters">(<a href="../SampleDimension.html" title="class in org.apache.sis.coverage">SampleDimension</a>...&nbsp;bands)</span></div>
<div class="block">Sets the sample dimensions for all bands.
The array length must be equal to the number of bands in the data specified to
<code>set­Values(…)</code> method (it will be verified at <a href="#build()"><code>build()</code></a> time).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>bands</code> - the new sample dimensions, or <code>null</code> for removing previous range setting.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given array is empty.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../SampleDimension.Builder.html" title="class in org.apache.sis.coverage"><code>Sample­Dimension​.Builder</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addRange(org.apache.sis.coverage.SampleDimension)">
<h3>addRange</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">addRange</span><wbr><span class="parameters">(<a href="../SampleDimension.html" title="class in org.apache.sis.coverage">SampleDimension</a>&nbsp;band)</span></div>
<div class="block">Adds a sample dimension for one band. This method can be invoked repeatedly until the number of
sample dimensions is equal to the number of bands in the data specified to <code>set­Values(…)</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>band</code> - the sample dimension to add.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../SampleDimension.Builder.html" title="class in org.apache.sis.coverage"><code>Sample­Dimension​.Builder</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setValues(java.awt.image.RenderedImage)">
<h3>setValues</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">setValues</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/RenderedImage.html" title="class or interface in java.awt.image" class="external-link">RenderedImage</a>&nbsp;data)</span></div>
<div class="block">Sets a two-dimensional slice of sample values as a rendered image.
If <a href="#setRanges(org.apache.sis.coverage.SampleDimension...)">sample dimensions are specified</a>,
then the <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/SampleModel.html#getNumBands()" title="class or interface in java.awt.image" class="external-link">number of bands</a>
must be equal to the number of sample dimensions.
<p><b>Note:</b> row indices in an image are usually increasing down, while geographic coordinates
are usually increasing up. Consequently, the <code><a href="#flipGridAxis(int)">flip­Grid­Axis</a>(1)</code>
method may need to be invoked after this method.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>data</code> - the rendered image to be wrapped in a <code>Grid­Coverage</code>. Cannot be <code>null</code>.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/BufferedImage.html" title="class or interface in java.awt.image" class="external-link"><code>Buffered­Image</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setValues(java.awt.image.Raster)">
<h3>setValues</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">setValues</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/Raster.html" title="class or interface in java.awt.image" class="external-link">Raster</a>&nbsp;data)</span></div>
<div class="block">Sets a two-dimensional slice of sample values as a raster.
If <a href="#setRanges(org.apache.sis.coverage.SampleDimension...)">sample dimensions are specified</a>,
then the <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/Raster.html#getNumBands()" title="class or interface in java.awt.image" class="external-link">number of bands</a> must be equal to the
number of sample dimensions.
<p><b>Note:</b> row indices in a raster are usually increasing down, while geographic coordinates
are usually increasing up. Consequently, the <code><a href="#flipGridAxis(int)">flip­Grid­Axis</a>(1)</code>
method may need to be invoked after this method.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>data</code> - the raster to be wrapped in a <code>Grid­Coverage</code>. Cannot be <code>null</code>.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/Raster.html#createBandedRaster(int,int,int,int,java.awt.Point)" title="class or interface in java.awt.image" class="external-link"><code>Raster​.create­Banded­Raster(int, int, int, int, Point)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setValues(java.awt.image.DataBuffer,java.awt.Dimension)">
<h3>setValues</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">setValues</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/DataBuffer.html" title="class or interface in java.awt.image" class="external-link">DataBuffer</a>&nbsp;data,
<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Dimension.html" title="class or interface in java.awt" class="external-link">Dimension</a>&nbsp;size)</span></div>
<div class="block">Sets a two-dimensional slice of sample values as a Java2D data buffer.
The <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/DataBuffer.html#getNumBanks()" title="class or interface in java.awt.image" class="external-link">number of banks</a> will be the number of bands in the image.
If <a href="#setRanges(org.apache.sis.coverage.SampleDimension...)">sample dimensions are specified</a>, then the number of
bands must be equal to the number of sample dimensions.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>data</code> - the data buffer to be wrapped in a <code>Grid­Coverage</code>. Cannot be <code>null</code>.</dd>
<dd><code>size</code> - the image size in pixels, or <code>null</code> if unspecified. If null, then the image
size will be taken from the <a href="GridGeometry.html#getExtent()">grid extent</a>.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if <code>width</code> or <code>height</code> is negative or equals to zero.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="flipGridAxis(int)">
<h3>flipGridAxis</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">flipGridAxis</span><wbr><span class="parameters">(int&nbsp;dimension)</span></div>
<div class="block">Reverses axis direction in the specified grid dimension.
For example if grid indices are (<var>column</var>, <var>row</var>),
then <code>flip­Grid­Axis(1)</code> will reverse the direction of rows axis.
Invoking this method a second time for the same dimension will cancel the flipping.
<p>When building coverage with a <a href="#setDomain(org.opengis.geometry.Envelope)">domain specified by an envelope</a>
(i.e. with no explicit <cite>grid to CRS</cite> transform), the default <code>Grid­Coverage­Builder</code>
behavior is to create a <a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Geometry</code></a> with grid indices increasing in the same direction than
domain coordinates. This method allows to reverse direction for an axis.
The most typical usage is to reverse the direction of the <var>y</var> axis in images.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>dimension</code> - index of the dimension in the grid to reverse direction.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#setDomain(org.opengis.geometry.Envelope)"><code>set­Domain(Envelope)</code></a></li>
<li><a href="GridOrientation.html#flipGridAxis(int)"><code>Grid­Orientation​.flip­Grid­Axis(int)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="addImageProperty(java.lang.String,java.lang.Object)">
<h3>addImageProperty</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="GridCoverageBuilder.html" title="class in org.apache.sis.coverage.grid">GridCoverageBuilder</a></span>&nbsp;<span class="element-name">addImageProperty</span><wbr><span class="parameters">(<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>&nbsp;key,
<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>&nbsp;value)</span></div>
<div class="block">Adds a value associated to an image property. This method can be invoked only once for each <code>key</code>.
Those properties will be given to the <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/image/RenderedImage.html" title="class or interface in java.awt.image" class="external-link"><code>Rendered­Image</code></a> created by the <a href="#build()"><code>build()</code></a> method.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>key</code> - key of the property to set.</dd>
<dd><code>value</code> - value to associate to the given key.</dd>
<dt>Returns:</dt>
<dd><code>this</code> for method invocation chaining.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if a value is already associated to the given key.</dd>
<dt>Since:</dt>
<dd>1.1</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="GridCoverage.html" title="class in org.apache.sis.coverage.grid">GridCoverage</a></span>&nbsp;<span class="element-name">build</span>()
throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">IllegalStateException</a></span></div>
<div class="block">Creates the grid coverage from the domain, ranges and values given to setter methods.
The returned coverage is often a <a href="GridCoverage2D.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Coverage2D</code></a> instance, but not necessarily.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>grid coverage created from specified domain, ranges and sample values.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalStateException.html" title="class or interface in java.lang" class="external-link">Illegal­State­Exception</a></code> - if some properties are inconsistent, for example
<a href="GridGeometry.html#getExtent()">grid extent</a> not matching image size or
<a href="#setRanges(org.apache.sis.coverage.SampleDimension...)">number of sample dimensions</a> not matching
the number of bands. This exception often wraps an <a href="IllegalGridGeometryException.html" title="class in org.apache.sis.coverage.grid"><code>Illegal­Grid­Geometry­Exception</code></a>,
<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"><code>Illegal­Argument­Exception</code></a> or <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link"><code>Null­Pointer­Exception</code></a>.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>