blob: a20246c9003d8c4a53c89ffd27b4ed0065ae87da [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 -->
<title>GridExtent (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: GridExtent">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.coverage.grid.GridExtent class">
<meta name="keywords" content="getDimension()">
<meta name="keywords" content="startsAtZero()">
<meta name="keywords" content="getLow()">
<meta name="keywords" content="getHigh()">
<meta name="keywords" content="getMedian()">
<meta name="keywords" content="getRelative()">
<meta name="keywords" content="getSize()">
<meta name="keywords" content="getPointOfInterest()">
<meta name="keywords" content="getSliceCoordinates()">
<meta name="keywords" content="getSubspaceDimensions()">
<meta name="keywords" content="getLargestDimensions()">
<meta name="keywords" content="getAxisType()">
<meta name="keywords" content="withRange()">
<meta name="keywords" content="toEnvelope()">
<meta name="keywords" content="insertDimension()">
<meta name="keywords" content="selectDimensions()">
<meta name="keywords" content="expand()">
<meta name="keywords" content="resize()">
<meta name="keywords" content="subsample()">
<meta name="keywords" content="upsample()">
<meta name="keywords" content="translate()">
<meta name="keywords" content="contains()">
<meta name="keywords" content="intersect()">
<meta name="keywords" content="union()">
<meta name="keywords" content="equals()">
<meta name="keywords" content="hashCode()">
<meta name="keywords" content="toString()">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../sis.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../script-dir/jquery-ui.min.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-3.6.1.min.js"></script>
<script type="text/javascript" src="../../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="../../../../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li>Field</li>
<li><a href="#constructor-summary">Constr</a></li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li>Field</li>
<li><a href="#constructor-detail">Constr</a></li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</div>
<div class="nav-list-search"><a href="../../../../../../search.html">SEARCH</a>
<input type="text" id="search-input" disabled placeholder="Search">
<input type="reset" id="reset-button" disabled value="reset">
</div>
</div>
<!-- ========= END OF TOP NAVBAR ========= -->
<span class="skip-nav" id="skip-navbar-top"></span></nav>
</header>
<div class="flex-content">
<main role="main">
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="sub-title"><span class="module-label-in-type">Module</span>&nbsp;<a href="../../../../../module-summary.html">org.apache.sis.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 GridExtent" class="title">Class GridExtent</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">GridExtent</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code>, <code><a href="../../../../../../org.apache.sis.util/org/apache/sis/util/LenientComparable.html" title="interface in org.apache.sis.util">Lenient­Comparable</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">GridExtent</span>
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
implements <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a>, <a href="../../../../../../org.apache.sis.util/org/apache/sis/util/LenientComparable.html" title="interface in org.apache.sis.util">LenientComparable</a></span></div>
<div class="block">A range of grid coverage coordinates, also known as "grid envelope".
<code>Grid­Extent</code> are defined by low coordinates (often all zeros)
and high coordinates, <strong>inclusive</strong>.
For example, a grid with a width of 512 cells can have a low coordinate of 0 and high coordinate of 511.
<div class="note"><b>Note:</b>
The inclusiveness of high coordinates come from ISO 19123.
We follow this specification for all getters methods, but developers should keep in mind
that this is the opposite of Java2D usage where <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Rectangle.html" title="class or interface in java.awt" class="external-link"><code>Rectangle</code></a> maximal values are exclusive.</div>
<p><code>Grid­Extent</code> instances are immutable and thread-safe.
The same instance can be shared by different <a href="GridGeometry.html" title="class in org.apache.sis.coverage.grid"><code>Grid­Geometry</code></a> instances.</p>
<div class="note"><b>Upcoming API generalization:</b>
this class may implement the <code>Grid­Envelope</code> interface in a future Apache SIS version.
This is pending GeoAPI update.</div></div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../../../serialized-form.html#org.apache.sis.coverage.grid.GridExtent">Serialized Form</a></li>
</ul>
</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<li>
<section class="constructor-summary" id="constructor-summary">
<h2>Constructor Summary</h2>
<div class="caption"><span>Constructors</span></div>
<div class="summary-table two-column-summary">
<div class="table-header col-first">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(long,long)" class="member-name-link">Grid­Extent</a><wbr>(long&nbsp;width,
long&nbsp;height)</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a new grid extent for an image or matrix of the given size.</div>
</div>
<div class="col-constructor-name odd-row-color"><code><a href="#%3Cinit%3E(java.awt.Rectangle)" class="member-name-link">Grid­Extent</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Rectangle.html" title="class or interface in java.awt" class="external-link">Rectangle</a>&nbsp;bounds)</code></div>
<div class="col-last odd-row-color">
<div class="block">Creates a new grid extent for an image or matrix of the given bounds.</div>
</div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(org.opengis.metadata.spatial.DimensionNameType%5B%5D,long%5B%5D,long%5B%5D,boolean)" class="member-name-link">Grid­Extent</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">Dimension­Name­Type</a>[]&nbsp;axis­Types,
long[]&nbsp;low,
long[]&nbsp;high,
boolean&nbsp;is­High­Included)</code></div>
<div class="col-last even-row-color">
<div class="block">Constructs a new grid extent set to the specified coordinates.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#contains(long...)" class="member-name-link">contains</a><wbr>(long...&nbsp;cell)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns <code>true</code> if this extent contains the given coordinates of a grid cell.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#equals(java.lang.Object)" class="member-name-link">equals</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;object)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Compares the specified object with this grid extent for equality.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#equals(java.lang.Object,org.apache.sis.util.ComparisonMode)" class="member-name-link">equals</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;object,
<a href="../../../../../../org.apache.sis.util/org/apache/sis/util/ComparisonMode.html" title="enum class in org.apache.sis.util">Comparison­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">Compares the specified object with this grid extent for equality.</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="#expand(long...)" class="member-name-link">expand</a><wbr>(long...&nbsp;margins)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a grid extent expanded by the given amount of cells on both sides along 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="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a><wbr>&lt;<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">Dimension­Name­Type</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getAxisType(int)" class="member-name-link">get­Axis­Type</a><wbr>(int&nbsp;index)</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 type (vertical, temporal, …) of grid axis at given dimension.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final int</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDimension()" class="member-name-link">get­Dimension</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 number of dimensions.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getHigh(int)" class="member-name-link">get­High</a><wbr>(int&nbsp;index)</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 valid maximum <strong>inclusive</strong> grid coordinate along the specified dimension.</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="#getLargestDimensions(int)" class="member-name-link">get­Largest­Dimensions</a><wbr>(int&nbsp;num­Dim)</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 indices of the <code>num­Dim</code> dimensions having the largest sizes.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getLow(int)" class="member-name-link">get­Low</a><wbr>(int&nbsp;index)</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 valid minimum inclusive grid coordinate along the specified dimension.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getMedian(int)" class="member-name-link">get­Median</a><wbr>(int&nbsp;index)</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 average of low and high coordinates, rounded toward positive infinity.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPointOfInterest(org.opengis.referencing.datum.PixelInCell)" class="member-name-link">get­Point­Of­Interest</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html" title="class or interface in org.opengis.referencing.datum" class="external-link">Pixel­In­Cell</a>&nbsp;anchor)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the grid coordinates of a representative point.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRelative(int,double)" class="member-name-link">get­Relative</a><wbr>(int&nbsp;index,
double&nbsp;ratio)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a grid coordinate at the given relative position between <var>low</var> and <var>high</var>.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSize(int)" class="member-name-link">get­Size</a><wbr>(int&nbsp;index)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns the number of integer grid coordinates along the specified dimension.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSize(int,boolean)" class="member-name-link">get­Size</a><wbr>(int&nbsp;index,
boolean&nbsp;minus­One)</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 number of grid coordinates as a double precision floating point value.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/SortedMap.html" title="class or interface in java.util" class="external-link">Sorted­Map</a><wbr>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Long.html" title="class or interface in java.lang" class="external-link">Long</a>&gt;</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getSliceCoordinates()" class="member-name-link">get­Slice­Coordinates</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 grid coordinates for all dimensions where the grid has a size of 1.</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="#getSubspaceDimensions(int)" class="member-name-link">get­Subspace­Dimensions</a><wbr>(int&nbsp;num­Dim)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns indices of all dimensions where this grid extent has a size greater than 1.</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="#hashCode()" class="member-name-link">hash­Code</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 hash value for this grid extent.</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="#insertDimension(int,org.opengis.metadata.spatial.DimensionNameType,long,long,boolean)" class="member-name-link">insert­Dimension</a><wbr>(int&nbsp;index,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">Dimension­Name­Type</a>&nbsp;axis­Type,
long&nbsp;low,
long&nbsp;high,
boolean&nbsp;is­High­Included)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a new grid extent with the specified dimension inserted at the given index in this grid extent.</div>
</div>
<div class="col-first even-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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#intersect(org.apache.sis.coverage.grid.GridExtent)" class="member-name-link">intersect</a><wbr>(<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">Grid­Extent</a>&nbsp;other)</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 intersection of this grid extent with the given grid extent.</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="#resize(long...)" class="member-name-link">resize</a><wbr>(long...&nbsp;sizes)</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 size of grid extent to the given values by moving low and high coordinates.</div>
</div>
<div class="col-first even-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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#selectDimensions(int...)" class="member-name-link">select­Dimensions</a><wbr>(int...&nbsp;indices)</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 grid extent that encompass only some dimensions of this grid extent.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#startsAtZero()" class="member-name-link">starts­At­Zero</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 <code>true</code> if all low coordinates are zero.</div>
</div>
<div class="col-first even-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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#subsample(int...)" class="member-name-link">subsample</a><wbr>(int...&nbsp;periods)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Creates a new grid extent subsampled by the given amount of cells along each grid dimensions.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../../../../../../org.apache.sis.referencing/org/apache/sis/geometry/GeneralEnvelope.html" title="class in org.apache.sis.geometry">General­Envelope</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toEnvelope(org.opengis.referencing.operation.MathTransform)" class="member-name-link">to­Envelope</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Math­Transform</a>&nbsp;corner­To­CRS)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Transforms this grid extent to a "real world" envelope using the given transform.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" 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 grid extent.</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="#translate(long...)" class="member-name-link">translate</a><wbr>(long...&nbsp;translation)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns an extent translated by the given amount of cells compared to this extent.</div>
</div>
<div class="col-first even-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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#union(org.apache.sis.coverage.grid.GridExtent)" class="member-name-link">union</a><wbr>(<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">Grid­Extent</a>&nbsp;other)</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 union of this grid extent with the given grid extent.</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="#upsample(int...)" class="member-name-link">upsample</a><wbr>(int...&nbsp;periods)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Creates a new grid extent upsampled by the given amount of cells along each grid dimensions.</div>
</div>
<div class="col-first even-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 even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#withRange(int,long,long)" class="member-name-link">with­Range</a><wbr>(int&nbsp;index,
long&nbsp;low,
long&nbsp;high)</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 grid extent identical to this grid extent except for the coordinate values in the specified dimension.</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#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#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;(java.awt.Rectangle)">
<h3>GridExtent</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">GridExtent</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/Rectangle.html" title="class or interface in java.awt" class="external-link">Rectangle</a>&nbsp;bounds)</span></div>
<div class="block">Creates a new grid extent for an image or matrix of the given bounds.
The axis types are <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#COLUMN" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Dimension­Name­Type​.COLUMN</code></a> and <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#ROW" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>ROW</code></a> in that order.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>bounds</code> - the bounds to copy in the new grid extent.</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 rectangle is empty.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(long,long)">
<h3>GridExtent</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">GridExtent</span><wbr><span class="parameters">(long&nbsp;width,
long&nbsp;height)</span></div>
<div class="block">Creates a new grid extent for an image or matrix of the given size.
The low grid coordinates are zeros and the axis types are
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#COLUMN" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Dimension­Name­Type​.COLUMN</code></a> and <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#ROW" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>ROW</code></a> in that order.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>width</code> - number of pixels in each row.</dd>
<dd><code>height</code> - number of pixels in each column.</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 width or the height is not greater than zero.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="&lt;init&gt;(org.opengis.metadata.spatial.DimensionNameType[],long[],long[],boolean)">
<h3>GridExtent</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">GridExtent</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">DimensionNameType</a>[]&nbsp;axisTypes,
long[]&nbsp;low,
long[]&nbsp;high,
boolean&nbsp;isHighIncluded)</span></div>
<div class="block">Constructs a new grid extent set to the specified coordinates.
The given arrays contain a minimum (inclusive) and maximum value for each dimension of the grid coverage.
The lowest valid grid coordinates are often zero, but this is not mandatory.
As a convenience for this common case, a null <code>low</code> array means that all low coordinates are zero.
<p>An optional (nullable) <code>axis­Types</code> argument can be used for attaching a label to each grid axis.
For example if this <code>Grid­Extent</code> is four-dimensional, then the axis types may be
{<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#COLUMN" title="class or interface in org.opengis.metadata.spatial" class="external-link">column</a> (<var>x</var>),
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#ROW" title="class or interface in org.opengis.metadata.spatial" class="external-link">row</a> (<var>y</var>),
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#VERTICAL" title="class or interface in org.opengis.metadata.spatial" class="external-link">vertical</a> (<var>z</var>),
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#TIME" title="class or interface in org.opengis.metadata.spatial" class="external-link">time</a> (<var>t</var>)},
which means that the last axis is for the temporal dimension, the third axis is for the vertical dimension, <i>etc.</i>
This information is related to the "real world" coordinate reference system axes, but not necessarily in the same order;
it is caller responsibility to ensure that the grid axes are consistent with the CRS axes.
The <code>axis­Types</code> array shall not contain duplicated elements,
but may contain <code>null</code> elements if the type of some axes are unknown.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>axis­Types</code> - the type of each grid axis, or <code>null</code> if unspecified.</dd>
<dd><code>low</code> - the valid minimum grid coordinates (always inclusive), or <code>null</code> for all zeros.</dd>
<dd><code>high</code> - the valid maximum grid coordinates, inclusive or exclusive depending on the next argument.</dd>
<dd><code>is­High­Included</code> - <code>true</code> if the <code>high</code> values are inclusive (as in ISO 19123 specification),
or <code>false</code> if they are exclusive (as in Java2D usage).
This argument does not apply to <code>low</code> values, which are always inclusive.</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 coordinate value in the low part is
greater than the corresponding coordinate value in the high part.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><code>get­Low()</code></li>
<li><code>get­High()</code></li>
<li><a href="#insertDimension(int,org.opengis.metadata.spatial.DimensionNameType,long,long,boolean)"><code>insert­Dimension(int, Dimension­Name­Type, long, long, boolean)</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="getDimension()">
<h3>getDimension</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getDimension</span>()</div>
<div class="block">Returns the number of dimensions.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the number of dimensions.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="#selectDimensions(int...)"><code>select­Dimensions(int[])</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="startsAtZero()">
<h3>startsAtZero</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">startsAtZero</span>()</div>
<div class="block">Returns <code>true</code> if all low coordinates are zero.
This is a very common case since many grids start their cell numbering at zero.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>whether all low coordinates are zero.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="#translate(long...)"><code>translate(long...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getLow(int)">
<h3>getLow</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">getLow</span><wbr><span class="parameters">(int&nbsp;index)</span></div>
<div class="block">Returns the valid minimum inclusive grid coordinate along the specified dimension.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - the dimension for which to obtain the coordinate value.</dd>
<dt>Returns:</dt>
<dd>the low coordinate value at the given dimension, inclusive.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if the given index is negative or is equal or greater
than the <a href="#getDimension()">grid dimension</a>.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getHigh(int)"><code>get­High(int)</code></a></li>
<li><a href="#withRange(int,long,long)"><code>with­Range(int, long, long)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getHigh(int)">
<h3>getHigh</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">getHigh</span><wbr><span class="parameters">(int&nbsp;index)</span></div>
<div class="block">Returns the valid maximum <strong>inclusive</strong> grid coordinate along the specified dimension.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - the dimension for which to obtain the coordinate value.</dd>
<dt>Returns:</dt>
<dd>the high coordinate value at the given dimension, <strong>inclusive</strong>.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if the given index is negative or is equal or greater
than the <a href="#getDimension()">grid dimension</a>.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getLow(int)"><code>get­Low(int)</code></a></li>
<li><a href="#withRange(int,long,long)"><code>with­Range(int, long, long)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getMedian(int)">
<h3>getMedian</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">getMedian</span><wbr><span class="parameters">(int&nbsp;index)</span></div>
<div class="block">Returns the average of low and high coordinates, rounded toward positive infinity.
This method is equivalent to computing any of the following,
except that this method does not overflow even if the sum would overflow:
<ul>
<li>(<var>low</var> + <var>high</var>) / 2 rounded toward positive infinity, or</li>
<li>(<var>low</var> + <var>high</var> + 1) / 2 rounded toward negative infinity.</li>
</ul>
The two above formulas are equivalent, so the result does not depend
on whether the high coordinate should be inclusive or exclusive.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - the dimension for which to obtain the coordinate value.</dd>
<dt>Returns:</dt>
<dd>the median coordinate value at the given dimension.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if the given index is negative or is equal or greater
than the <a href="#getDimension()">grid dimension</a>.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getRelative(int,double)">
<h3>getRelative</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">getRelative</span><wbr><span class="parameters">(int&nbsp;index,
double&nbsp;ratio)</span></div>
<div class="block">Returns a grid coordinate at the given relative position between <var>low</var> and <var>high</var>.
The relative position is specified by a ratio between 0 and 1 where
0 maps to <a href="#getLow(int)">low</a> grid coordinates,
1 maps to <a href="#getHigh(int)">high grid coordinates</a> and
0.5 maps to <a href="#getMedian(int)">median grid coordinates</a>.
Ratio values outside the [0 … 1] range result in extrapolations.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - the dimension for which to obtain the interpolated coordinate.</dd>
<dd><code>ratio</code> - interpolation ratio (0 for low, 0.5 for median, 1 for high coordinate).</dd>
<dt>Returns:</dt>
<dd>the interpolated coordinate value in the given dimension.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if the given index is negative or is equal or greater
than the <a href="#getDimension()">grid dimension</a>.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if the extrapolated coordinate cannot be represented as a 64 bits integer.</dd>
<dt>Since:</dt>
<dd>1.4</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSize(int)">
<h3>getSize</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">long</span>&nbsp;<span class="element-name">getSize</span><wbr><span class="parameters">(int&nbsp;index)</span></div>
<div class="block">Returns the number of integer grid coordinates along the specified dimension.
This is equal to <code>get­High(dimension) - get­Low(dimension) + 1</code>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - the dimension for which to obtain the size.</dd>
<dt>Returns:</dt>
<dd>the number of cells along the given dimension.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if the given index is negative or is equal or greater
than the <a href="#getDimension()">grid dimension</a>.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if the size is too large for the <code>long</code> primitive type.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="#getLow(int)"><code>get­Low(int)</code></a></li>
<li><a href="#getHigh(int)"><code>get­High(int)</code></a></li>
<li><a href="#resize(long...)"><code>resize(long...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSize(int,boolean)">
<h3>getSize</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getSize</span><wbr><span class="parameters">(int&nbsp;index,
boolean&nbsp;minusOne)</span></div>
<div class="block">Returns the number of grid coordinates as a double precision floating point value.
Invoking this method is equivalent to invoking <a href="#getSize(int)"><code>get­Size(int)</code></a> and converting
the result from <code>long</code> to the <code>double</code> primitive type, except that this
method does not overflow (i.e. does not throw <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link"><code>Arithmetic­Exception</code></a>).</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - the dimension for which to obtain the size.</dd>
<dd><code>minus­One</code> - <code>true</code> for returning <var>size</var>−1 instead of <var>size</var>.</dd>
<dt>Returns:</dt>
<dd>the number of cells along the given dimension, optionally minus one.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getPointOfInterest(org.opengis.referencing.datum.PixelInCell)">
<h3>getPointOfInterest</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double[]</span>&nbsp;<span class="element-name">getPointOfInterest</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html" title="class or interface in org.opengis.referencing.datum" class="external-link">PixelInCell</a>&nbsp;anchor)</span></div>
<div class="block">Returns the grid coordinates of a representative point.
This point may be used for estimating a <a href="GridGeometry.html#getResolution(boolean)">grid resolution</a>.
The default implementation returns the median (or center) coordinates of this grid extent,
but subclasses can override this method if another point is considered more representative.
<p>The <code>anchor</code> argument tells <a href="GridGeometry.html#getGridToCRS(org.opengis.referencing.datum.PixelInCell)">which transform</a>
the caller intend to use for converting the grid coordinates to "real world" coordinates.
With the default implementation, the coordinate values returned with <code>CELL_CORNER</code>
are 0.5 cell units higher than the coordinate values returned with <code>CELL_CENTER</code>.
Subclasses are free to ignore this argument.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>anchor</code> - the convention to be used for conversion to "real world" coordinates.</dd>
<dt>Returns:</dt>
<dd>the grid coordinates of a representative point.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSliceCoordinates()">
<h3>getSliceCoordinates</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/SortedMap.html" title="class or interface in java.util" class="external-link">SortedMap</a>&lt;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Long.html" title="class or interface in java.lang" class="external-link">Long</a>&gt;</span>&nbsp;<span class="element-name">getSliceCoordinates</span>()</div>
<div class="block">Returns the grid coordinates for all dimensions where the grid has a size of 1.
Keys are dimensions as values from 0 inclusive to <a href="#getDimension()"><code>get­Dimension()</code></a> exclusive.
Values are the <a href="#getLow(int)">low</a> and <a href="#getHigh(int)">high</a> coordinates
(which are equal) in the associated dimension.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>grid coordinates for all dimensions where the grid has a size of 1.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="GridCoverage.Evaluator.html#setDefaultSlice(java.util.Map)"><code>Grid­Coverage​.Evaluator​.set­Default­Slice(Map)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getSubspaceDimensions(int)">
<h3>getSubspaceDimensions</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int[]</span>&nbsp;<span class="element-name">getSubspaceDimensions</span><wbr><span class="parameters">(int&nbsp;numDim)</span></div>
<div class="block">Returns indices of all dimensions where this grid extent has a size greater than 1.
This method can be used for getting the grid extent of a slice with <code>num­Dim</code>
dimensions from a <var>n</var>-dimensional cube where <code>num­Dim</code><var>n</var>.
<h4 id="example-heading">Example</h4>
suppose that we want to get a two-dimensional slice (<var>y</var>,<var>z</var>) in
a four-dimensional data cube (<var>x</var>,<var>y</var>,<var>z</var>,<var>t</var>).
The first step is to specify the <var>x</var> and <var>t</var> coordinates of the slice.
In this example we set <var>x</var> to 5 and <var>t</var> to 8.
<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">GridGeometry grid = ...; // Geometry of the (x,y,z,t) grid.
GridGeometry slice4D = grid.slice(new GeneralDirectPosition(5, NaN, NaN, 8));
</code></pre>
</div>
Above code created a slice at the requested position, but that slice still have 4 dimensions.
It is a "slice" because the <var>x</var> and <var>t</var> dimensions of <code>slice4D</code> have only one cell.
If a two-dimensional slice is desired, then above operations can be completed as below.
In this example, the result of <code>get­Subspace­Dimensions(2)</code> call will be {1,2}.
<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">int[] subDimensions = slice4D.getExtent().getSubspaceDimensions(2);
GridGeometry slice2D = slice4D.selectDimensions(subDimensions);
</code></pre>
</div>
Note that in this example, it would have been more efficient to execute <code>grid​.select­Dimensions(1,2)</code> directly.
This <code>get­Subspace­Dimensions(int)</code> method is more useful for inferring a <code>slice2D</code> from a <code>slice4D</code>
which has been created elsewhere, or when we do not really want the <code>slice2D</code> but only its dimension indices.
<h4 id="number-of-dimensions-heading">Number of dimensions</h4>
This method returns exactly <code>num­Dim</code> indices. If there is more than <code>num­Dim</code> dimensions having
a <a href="#getSize(int)">size</a> greater than 1, then a <a href="../SubspaceNotSpecifiedException.html" title="class in org.apache.sis.coverage"><code>Subspace­Not­Specified­Exception</code></a> is thrown.
If there is less than <code>num­Dim</code> dimensions having a size greater than 1, then the returned list of
dimensions is completed with some dimensions of size 1, starting with the first dimensions in this grid
extent, until there is exactly <code>num­Dim</code> dimensions. If this grid extent does not have at least
<code>num­Dim</code> dimensions, then a <a href="../CannotEvaluateException.html" title="class in org.apache.sis.coverage"><code>Cannot­Evaluate­Exception</code></a> is thrown.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>num­Dim</code> - number of dimensions of the sub-space.</dd>
<dt>Returns:</dt>
<dd>indices of sub-space dimensions, in increasing order in an array of length <code>num­Dim</code>.</dd>
<dt>Throws:</dt>
<dd><code><a href="../SubspaceNotSpecifiedException.html" title="class in org.apache.sis.coverage">Subspace­Not­Specified­Exception</a></code> - if there is more than <code>num­Dim</code> dimensions having a size greater than 1.</dd>
<dd><code><a href="../CannotEvaluateException.html" title="class in org.apache.sis.coverage">Cannot­Evaluate­Exception</a></code> - if this grid extent does not have at least <code>num­Dim</code> dimensions.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getLargestDimensions(int)">
<h3>getLargestDimensions</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int[]</span>&nbsp;<span class="element-name">getLargestDimensions</span><wbr><span class="parameters">(int&nbsp;numDim)</span></div>
<div class="block">Returns the indices of the <code>num­Dim</code> dimensions having the largest sizes.
This method can be used as an alternative to <a href="#getSubspaceDimensions(int)"><code>get­Subspace­Dimensions(int)</code></a>
when it is acceptable that the omitted dimensions have sizes larger than 1 cell.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>num­Dim</code> - number of dimensions of the sub-space.</dd>
<dt>Returns:</dt>
<dd>indices of the <code>num­Dim</code> dimensions having the largest sizes, in increasing order.</dd>
<dt>Throws:</dt>
<dd><code><a href="../CannotEvaluateException.html" title="class in org.apache.sis.coverage">Cannot­Evaluate­Exception</a></code> - if this grid extent does not have at least <code>num­Dim</code> dimensions.</dd>
<dt>Since:</dt>
<dd>1.4</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getAxisType(int)">
<h3>getAxisType</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Optional.html" title="class or interface in java.util" class="external-link">Optional</a>&lt;<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">DimensionNameType</a>&gt;</span>&nbsp;<span class="element-name">getAxisType</span><wbr><span class="parameters">(int&nbsp;index)</span></div>
<div class="block">Returns the type (vertical, temporal, …) of grid axis at given dimension.
This information is provided because the grid axis type cannot always be inferred from the context.
Some examples are:
<ul>
<li><code>get­Axis­Type(0)</code> may return <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#COLUMN" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Dimension­Name­Type​.COLUMN</code></a>,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#TRACK" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>TRACK</code></a> or <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#LINE" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>LINE</code></a>.</li>
<li><code>get­Axis­Type(1)</code> may return <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#ROW" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Dimension­Name­Type​.ROW</code></a>,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#CROSS_TRACK" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>CROSS_TRACK</code></a> or <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#SAMPLE" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>SAMPLE</code></a>.</li>
<li><code>get­Axis­Type(2)</code> may return <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#VERTICAL" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Dimension­Name­Type​.VERTICAL</code></a>.</li>
<li><code>get­Axis­Type(3)</code> may return <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html#TIME" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Dimension­Name­Type​.TIME</code></a>.</li>
</ul>
Above are only examples; there are no constraints on axis order. In particular grid axes do not need to be in the same
order than the corresponding <a href="GridGeometry.html#getCoordinateReferenceSystem()">coordinate reference system</a> axes.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - the dimension for which to obtain the axis type.</dd>
<dt>Returns:</dt>
<dd>the axis type at the given dimension. May be absent if the type is unknown.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if the given index is negative or is equal or greater
than the <a href="#getDimension()">grid dimension</a>.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="withRange(int,long,long)">
<h3>withRange</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">withRange</span><wbr><span class="parameters">(int&nbsp;index,
long&nbsp;low,
long&nbsp;high)</span></div>
<div class="block">Returns a grid extent identical to this grid extent except for the coordinate values in the specified dimension.
This grid extent is not modified.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - the dimension for which to set the coordinate values.</dd>
<dd><code>low</code> - the low coordinate value at the given dimension, inclusive.</dd>
<dd><code>high</code> - the high coordinate value at the given dimension, <strong>inclusive</strong>.</dd>
<dt>Returns:</dt>
<dd>a grid extent with the specified coordinate values, or <code>this</code> if values are unchanged.</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 low coordinate value is greater than the high coordinate value.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="#getLow(int)"><code>get­Low(int)</code></a></li>
<li><a href="#getHigh(int)"><code>get­High(int)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toEnvelope(org.opengis.referencing.operation.MathTransform)">
<h3>toEnvelope</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../../../../../../org.apache.sis.referencing/org/apache/sis/geometry/GeneralEnvelope.html" title="class in org.apache.sis.geometry">GeneralEnvelope</a></span>&nbsp;<span class="element-name">toEnvelope</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link">MathTransform</a>&nbsp;cornerToCRS)</span>
throws <span class="exceptions"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">TransformException</a></span></div>
<div class="block">Transforms this grid extent to a "real world" envelope using the given transform.
The transform shall map <em>cell corner</em> to real world coordinates.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>corner­To­CRS</code> - a transform from <em>cell corners</em> to real world coordinates.</dd>
<dt>Returns:</dt>
<dd>this grid extent in real world coordinates.</dd>
<dt>Throws:</dt>
<dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/TransformException.html" title="class or interface in org.opengis.referencing.operation" class="external-link">Transform­Exception</a></code> - if the envelope cannot be computed with the given transform.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="GridGeometry.html#getEnvelope()"><code>Grid­Geometry​.get­Envelope()</code></a></li>
<li><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html#CELL_CORNER" title="class or interface in org.opengis.referencing.datum" class="external-link"><code>Pixel­In­Cell​.CELL_CORNER</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="insertDimension(int,org.opengis.metadata.spatial.DimensionNameType,long,long,boolean)">
<h3>insertDimension</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">insertDimension</span><wbr><span class="parameters">(int&nbsp;index,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/DimensionNameType.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">DimensionNameType</a>&nbsp;axisType,
long&nbsp;low,
long&nbsp;high,
boolean&nbsp;isHighIncluded)</span></div>
<div class="block">Returns a new grid extent with the specified dimension inserted at the given index in this grid extent.
To append a new dimension after all existing dimensions, set <code>index</code> to <a href="#getDimension()"><code>get­Dimension()</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>index</code> - where to insert the new dimension, from 0 to <a href="#getDimension()"><code>get­Dimension()</code></a> inclusive.</dd>
<dd><code>axis­Type</code> - the type of the grid axis to add, or <code>null</code> if unspecified.</dd>
<dd><code>low</code> - the valid minimum grid coordinate (always inclusive).</dd>
<dd><code>high</code> - the valid maximum grid coordinate, inclusive or exclusive depending on the next argument.</dd>
<dd><code>is­High­Included</code> - <code>true</code> if the <code>high</code> value is inclusive (as in ISO 19123 specification),
or <code>false</code> if it is exclusive (as in Java2D usage).
This argument does not apply to <code>low</code> value, which is always inclusive.</dd>
<dt>Returns:</dt>
<dd>a new grid extent with the specified dimension added.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if the given index is negative or greater than the <a href="#getDimension()">grid dimension</a>.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the low coordinate value is greater than the high coordinate value.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="#selectDimensions(int...)"><code>select­Dimensions(int...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="selectDimensions(int...)">
<h3>selectDimensions</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">selectDimensions</span><wbr><span class="parameters">(int...&nbsp;indices)</span></div>
<div class="block">Returns a grid extent that encompass only some dimensions of this grid extent.
This method copies the specified dimensions of this grid extent into a new grid extent.
The given dimensions must be in strictly ascending order without duplicated values.
The number of dimensions of the sub grid extent will be <code>indices​.length</code>.
<p>This method performs a <cite>dimensionality reduction</cite> and can be used as the converse
of <a href="#insertDimension(int,org.opengis.metadata.spatial.DimensionNameType,long,long,boolean)"><code>insert­Dimension(…)</code></a>.
This method cannot be used for changing dimension order.</p></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>indices</code> - the dimensions to select, in strictly increasing order.</dd>
<dt>Returns:</dt>
<dd>the sub-envelope, or <code>this</code> if the given array contains all dimensions of this grid extent.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IndexOutOfBoundsException.html" title="class or interface in java.lang" class="external-link">Index­Out­Of­Bounds­Exception</a></code> - if an index is out of bounds.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getSubspaceDimensions(int)"><code>get­Subspace­Dimensions(int)</code></a></li>
<li><a href="GridGeometry.html#selectDimensions(int...)"><code>Grid­Geometry​.select­Dimensions(int...)</code></a></li>
<li><a href="DimensionalityReduction.html#apply(org.apache.sis.coverage.grid.GridExtent)"><code>Dimensionality­Reduction​.apply(Grid­Extent)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="expand(long...)">
<h3>expand</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">expand</span><wbr><span class="parameters">(long...&nbsp;margins)</span></div>
<div class="block">Returns a grid extent expanded by the given amount of cells on both sides along each dimension.
This method adds the given margins to the <a href="#getHigh(int)">high coordinates</a>
and subtracts the same margins from the <a href="#getLow(int)">low coordinates</a>.
If a negative margin is supplied, the extent size decreases accordingly.
<h4 id="number-of-arguments-heading">Number of arguments</h4>
The <code>margins</code> array length should be equal to the <a href="#getDimension()">number of dimensions</a>.
If the array is shorter, missing values default to 0 (i.e. sizes in unspecified dimensions are unchanged).
If the array is longer, extraneous values are ignored.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>margins</code> - amount of cells to add or subtract on both sides for each dimension.</dd>
<dt>Returns:</dt>
<dd>a grid extent expanded by the given amount, or <code>this</code> if there is no change.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if expanding this extent by the given margins overflows <code>long</code> capacity.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="GridDerivation.html#margin(int...)"><code>Grid­Derivation​.margin(int...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="resize(long...)">
<h3>resize</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">resize</span><wbr><span class="parameters">(long...&nbsp;sizes)</span></div>
<div class="block">Sets the size of grid extent to the given values by moving low and high coordinates.
This method modifies grid coordinates as if they were multiplied by
<var>(given size)</var> / <var>(<a href="#getSize(int)">current size</a>)</var>,
rounded toward zero and with the value farthest from zero adjusted by ±1 for having a size
exactly equals to the specified value.
In the common case where the <a href="#getLow(int)">low value</a> is zero,
this is equivalent to setting the <a href="#getHigh(int)">high value</a> to <code>size</code> - 1.
<h4 id="number-of-arguments-heading1">Number of arguments</h4>
The <code>sizes</code> array length should be equal to the <a href="#getDimension()">number of dimensions</a>.
If the array is shorter, sizes in unspecified dimensions are unchanged.
If the array is longer, extraneous values are ignored.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>sizes</code> - the new grid sizes for each dimension.</dd>
<dt>Returns:</dt>
<dd>a grid extent having the given sizes, or <code>this</code> if there is no change.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if resizing this extent to the given size overflows <code>long</code> capacity.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#getSize(int)"><code>get­Size(int)</code></a></li>
<li><a href="GridDerivation.html#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)"><code>Grid­Derivation​.subgrid(Grid­Extent, int...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="subsample(int...)">
<h3>subsample</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">subsample</span><wbr><span class="parameters">(int...&nbsp;periods)</span></div>
<div class="block">Creates a new grid extent subsampled by the given amount of cells along each grid dimensions.
This method divides <a href="#getLow(int)">low coordinates</a> and <a href="#getSize(int)">grid sizes</a>
by the given periods, rounding toward zero. The <a href="#getHigh(int)">high coordinates</a> are adjusted
accordingly (this is often equivalent to dividing high coordinates by the periods too, but a difference
of one cell may exist).
<h4 id="usage-note-heading">Usage note</h4>
If the "real world" envelope computed from grid extent needs to stay approximately the same, then the
<a href="GridGeometry.html#getGridToCRS(org.opengis.referencing.datum.PixelInCell)">grid to CRS</a> transform needs to compensate the subsampling with
a pre-multiplication of each grid coordinates by <code>periods</code>.
However, the envelope computed that way may become <em>larger</em> after subsampling, not smaller.
This effect can be understood intuitively if we consider that cells become larger after subsampling,
which implies that accurate representation of the same envelope may require fractional cells on some
grid borders.
<p>This method does not reduce the number of dimensions of the grid extent.
For dimensionality reduction, see <a href="#selectDimensions(int...)"><code>select­Dimensions(int[])</code></a>.</p>
<h4 id="number-of-arguments-heading2">Number of arguments</h4>
The <code>periods</code> array length should be equal to the <a href="#getDimension()">number of dimensions</a>.
If the array is shorter, missing values default to 1 (i.e. samplings in unspecified dimensions are unchanged).
If the array is longer, extraneous values are ignored.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>periods</code> - the subsampling. Length shall be equal to the number of dimension and all values shall be greater than zero.</dd>
<dt>Returns:</dt>
<dd>the subsampled extent, or <code>this</code> if subsampling results in the same extent.</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 period is not greater than zero.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="GridDerivation.html#subgrid(org.apache.sis.coverage.grid.GridExtent,int...)"><code>Grid­Derivation​.subgrid(Grid­Extent, int...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="upsample(int...)">
<h3>upsample</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">upsample</span><wbr><span class="parameters">(int...&nbsp;periods)</span></div>
<div class="block">Creates a new grid extent upsampled by the given amount of cells along each grid dimensions.
This method multiplies <a href="#getLow(int)">low</a> and <a href="#getHigh(int)">high</a> coordinates
by the given periods.
This method does not change the number of dimensions of the grid extent.
<h4 id="number-of-arguments-heading3">Number of arguments</h4>
The <code>periods</code> array length should be equal to the <a href="#getDimension()">number of dimensions</a>.
If the array is shorter, missing values default to 1 (i.e. samplings in unspecified dimensions are unchanged).
If the array is longer, extraneous values are ignored.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>periods</code> - the upsampling. Length shall be equal to the number of dimension and all values shall be greater than zero.</dd>
<dt>Returns:</dt>
<dd>the upsampled extent, or <code>this</code> if upsampling results in the same extent.</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 period is not greater than zero.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if the upsampled extent overflows the <code>long</code> capacity.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="GridGeometry.html#upsample(int...)"><code>Grid­Geometry​.upsample(int...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="translate(long...)">
<h3>translate</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">translate</span><wbr><span class="parameters">(long...&nbsp;translation)</span></div>
<div class="block">Returns an extent translated by the given amount of cells compared to this extent.
The returned extent has the same <a href="#getSize(int)">size</a> than this extent,
i.e. both low and high grid coordinates are displaced by the same amount of cells.
<h4 id="example-heading1">Example</h4>
For an extent (x: [0…10], y: [2…4], z: [0…1]) and a translation {-2, 2},
the resulting extent would be (x: [-2…8], y: [4…6], z: [0…1]).
<h4 id="number-of-arguments-heading4">Number of arguments</h4>
The <code>translation</code> array length should be equal to the <a href="#getDimension()">number of dimensions</a>.
If the array is shorter, missing values default to 0 (i.e. no translation in unspecified dimensions).
If the array is longer, extraneous values are ignored.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>translation</code> - translation to apply on each axis in order.</dd>
<dt>Returns:</dt>
<dd>a grid extent whose coordinates (both low and high ones) have been translated by given amounts.
If the given translation is a no-op (no value or only 0 ones), then this extent is returned as is.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArithmeticException.html" title="class or interface in java.lang" class="external-link">Arithmetic­Exception</a></code> - if the translation results in coordinates that overflow 64-bits integer.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="#startsAtZero()"><code>starts­At­Zero()</code></a></li>
<li><a href="GridGeometry.html#shiftGrid(long...)"><code>Grid­Geometry​.shift­Grid(long...)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="contains(long...)">
<h3>contains</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">contains</span><wbr><span class="parameters">(long...&nbsp;cell)</span></div>
<div class="block">Returns <code>true</code> if this extent contains the given coordinates of a grid cell.
A grid coordinate is considered inside the grid extent if its value is between
<a href="#getLow(int)"><code>low</code></a> and <a href="#getHigh(int)"><code>high</code></a> bounds, inclusive.
<h4 id="number-of-arguments-heading5">Number of arguments</h4>
The <code>cell</code> array length should be equal to the <a href="#getDimension()">number of dimensions</a>.
If the array is shorter, missing coordinate values are considered inside the extent.
If the array is longer, extraneous coordinate values are ignored.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>cell</code> - grid coordinates of a cell to check for inclusion.</dd>
<dt>Returns:</dt>
<dd>whether the given grid coordinates are inside this extent.</dd>
<dt>Since:</dt>
<dd>1.2</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="intersect(org.apache.sis.coverage.grid.GridExtent)">
<h3>intersect</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">intersect</span><wbr><span class="parameters">(<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a>&nbsp;other)</span></div>
<div class="block">Returns the intersection of this grid extent with the given grid extent.
The given extent shall have the same number of dimensions than this extent.
The <a href="#getAxisType(int)">axis types</a> (vertical, temporal, …) must
be the same in all dimensions, ignoring types that are absent.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>other</code> - the grid to intersect with.</dd>
<dt>Returns:</dt>
<dd>the intersection result. May be one of the existing instances.</dd>
<dt>Throws:</dt>
<dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/MismatchedDimensionException.html" title="class or interface in org.opengis.geometry" class="external-link">Mismatched­Dimension­Exception</a></code> - if the two extents do not have the same number of dimensions.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if axis types are specified but inconsistent in at least one dimension.</dd>
<dd><code><a href="DisjointExtentException.html" title="class in org.apache.sis.coverage.grid">Disjoint­Extent­Exception</a></code> - if the given extent does not intersect this extent.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="union(org.apache.sis.coverage.grid.GridExtent)">
<h3>union</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">union</span><wbr><span class="parameters">(<a href="GridExtent.html" title="class in org.apache.sis.coverage.grid">GridExtent</a>&nbsp;other)</span></div>
<div class="block">Returns the union of this grid extent with the given grid extent.
The given extent shall have the same number of dimensions than this extent.
The <a href="#getAxisType(int)">axis types</a> (vertical, temporal, …) must
be the same in all dimensions, ignoring types that are absent.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>other</code> - the grid to combine with.</dd>
<dt>Returns:</dt>
<dd>the union result. May be one of the existing instances.</dd>
<dt>Throws:</dt>
<dd><code><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/MismatchedDimensionException.html" title="class or interface in org.opengis.geometry" class="external-link">Mismatched­Dimension­Exception</a></code> - if the two extents do not have the same number of dimensions.</dd>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if axis types are specified but inconsistent in at least one dimension.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="equals(java.lang.Object)">
<h3>equals</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;object)</span></div>
<div class="block">Compares the specified object with this grid extent for equality.
This method delegates to <code>equals(object, Comparison­Mode​.STRICT)</code>.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../../../../../../org.apache.sis.util/org/apache/sis/util/LenientComparable.html#equals(java.lang.Object)">equals</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../org.apache.sis.util/org/apache/sis/util/LenientComparable.html" title="interface in org.apache.sis.util">Lenient­Comparable</a></code></dd>
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
<dt>Parameters:</dt>
<dd><code>object</code> - the object to compare with this grid extent for equality.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given object is equal to this grid extent.</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><a href="../../../../../../org.apache.sis.util/org/apache/sis/util/ComparisonMode.html#STRICT"><code>Comparison­Mode​.STRICT</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="equals(java.lang.Object,org.apache.sis.util.ComparisonMode)">
<h3>equals</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">boolean</span>&nbsp;<span class="element-name">equals</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>&nbsp;object,
<a href="../../../../../../org.apache.sis.util/org/apache/sis/util/ComparisonMode.html" title="enum class in org.apache.sis.util">ComparisonMode</a>&nbsp;mode)</span></div>
<div class="block">Compares the specified object with this grid extent for equality.
If the mode is <a href="../../../../../../org.apache.sis.util/org/apache/sis/util/ComparisonMode.html#IGNORE_METADATA"><code>Comparison­Mode​.IGNORE_METADATA</code></a> or more flexible,
then the <a href="#getAxisType(int)">axis types</a> are ignored.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../../../../../../org.apache.sis.util/org/apache/sis/util/LenientComparable.html#equals(java.lang.Object,org.apache.sis.util.ComparisonMode)">equals</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../org.apache.sis.util/org/apache/sis/util/LenientComparable.html" title="interface in org.apache.sis.util">Lenient­Comparable</a></code></dd>
<dt>Parameters:</dt>
<dd><code>object</code> - the object to compare with this grid extent for equality.</dd>
<dd><code>mode</code> - the strictness level of the comparison.</dd>
<dt>Returns:</dt>
<dd><code>true</code> if the given object is equal to this grid extent.</dd>
<dt>Since:</dt>
<dd>1.1</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list-long">
<li><a href="../../../../../../org.apache.sis.util/org/apache/sis/util/Utilities.html#deepEquals(java.lang.Object,java.lang.Object,org.apache.sis.util.ComparisonMode)"><code>Utilities​.deep­Equals(Object, Object, Comparison­Mode)</code></a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="hashCode()">
<h3>hashCode</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">hashCode</span>()</div>
<div class="block">Returns a hash value for this grid extent. This value needs not to remain
consistent between different implementations of the same class.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
<dt>Returns:</dt>
<dd>a hash value for this grid extent.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="toString()">
<h3>toString</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">toString</span>()</div>
<div class="block">Returns a string representation of this grid extent. The returned string
is implementation dependent and is provided for debugging purposes only.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">to­String</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></code></dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
</div>
</div>
</body>
</html>