blob: b2aff1b748c4b7b7b37b7d2a49272aa8aa1508ad [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 -->
<title>PixelTranslation (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: PixelTranslation">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.coverage.grid.PixelTranslation class">
<meta name="keywords" content="orientation">
<meta name="keywords" content="dx">
<meta name="keywords" content="dy">
<meta name="keywords" content="getPixelOrientation()">
<meta name="keywords" content="getPixelTranslation()">
<meta name="keywords" content="translate()">
<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><a href="#field-summary">Field</a></li>
<li>Constr</li>
<li><a href="#method-summary">Method</a></li>
</ul>
</li>
<li>
<p>Detail:</p>
<ul>
<li><a href="#field-detail">Field</a></li>
<li>Constr</li>
<li><a href="#method-detail">Method</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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 PixelTranslation" class="title">Class PixelTranslation</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance"><a href="../../../../../../org.apache.sis.util/org/apache/sis/util/Static.html" title="class in org.apache.sis.util">Static</a>
<div class="inheritance">PixelTranslation</div>
</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">PixelTranslation</span>
<span class="extends-implements">extends <a href="../../../../../../org.apache.sis.util/org/apache/sis/util/Static.html" title="class in org.apache.sis.util">Static</a>
implements <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></span></div>
<div class="block">The translation to apply for different values of <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Pixel­Orientation</code></a> or <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"><code>Pixel­In­Cell</code></a>.
The translation are returned by a call to one of the following static methods:
<ul>
<li><a href="#getPixelTranslation(org.opengis.metadata.spatial.PixelOrientation)"><code>get­Pixel­Translation(Pixel­Orientation)</code></a> for the two-dimensional case.</li>
<li><a href="#getPixelTranslation(org.opengis.referencing.datum.PixelInCell)"><code>get­Pixel­Translation(Pixel­In­Cell)</code></a> for the <var>n</var>-dimensional case.</li>
</ul>
This class provides also a few <code>translate(…)</code> convenience methods,
which apply the translation on a given <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link"><code>Math­Transform</code></a> instance.
<h2 id="example-heading">Example</h2>
In the following code snippet, <code>grid­To­CRS</code> is an <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/java/awt/geom/AffineTransform.html" title="class or interface in java.awt.geom" class="external-link"><code>Affine­Transform</code></a> from
<cite>grid cell</cite> coordinates (typically pixel coordinates) to some arbitrary CRS coordinates.
In this example, the transform maps pixels <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#CENTER" title="class or interface in org.opengis.metadata.spatial" class="external-link">center</a>,
while the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="external-link">upper left</a> corner is desired.
This code will switch the affine transform from the <cite>pixel center</cite> to
<cite>upper left corner</cite> convention:
<div class="snippet-container"><button class="copy snippet-copy" aria-label="Copy snippet" onclick="copySnippet(this)"><span data-copied="Copied!">Copy</span><img src="../../../../../../copy.svg" alt="Copy snippet"></button>
<pre class="snippet"><code class="language-java"> public AffineTransform getGridToPixelCorner() {
AffineTransform gridToCRS = ...;
PixelOrientation current = PixelOrientation.CENTER;
PixelOrientation desired = PixelOrientation.UPPER_LEFT;
// Switch the transform from 'current' to 'desired' convention.
PixelTranslation source = getPixelTranslation(current);
PixelTranslation target = getPixelTranslation(desired);
return gridToCRS.translate(target.dx - source.dx,
target.dy - source.dy);
}
</code></pre>
</div>
</div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
<dt>See Also:</dt>
<dd>
<ul class="tag-list">
<li><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"><code>Pixel­In­Cell</code></a></li>
<li><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Pixel­Orientation</code></a></li>
<li><a href="../../../../../../serialized-form.html#org.apache.sis.coverage.grid.PixelTranslation">Serialized Form</a></li>
</ul>
</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<!-- =========== FIELD SUMMARY =========== -->
<li>
<section class="field-summary" id="field-summary">
<h2>Field Summary</h2>
<div class="caption"><span>Fields</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Field</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>final double</code></div>
<div class="col-second even-row-color"><code><a href="#dx" class="member-name-link">dx</a></code></div>
<div class="col-last even-row-color">
<div class="block">The translation among the <var>x</var> axis relative to pixel center.</div>
</div>
<div class="col-first odd-row-color"><code>final double</code></div>
<div class="col-second odd-row-color"><code><a href="#dy" class="member-name-link">dy</a></code></div>
<div class="col-last odd-row-color">
<div class="block">The translation among the <var>y</var> axis relative to pixel center.</div>
</div>
<div class="col-first even-row-color"><code>final <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">Pixel­Orientation</a></code></div>
<div class="col-second even-row-color"><code><a href="#orientation" class="member-name-link">orientation</a></code></div>
<div class="col-last even-row-color">
<div class="block">The pixel orientation for this translation.</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-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static 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-tab1 method-summary-table-tab4"><code>static <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">Pixel­Orientation</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getPixelOrientation(org.opengis.referencing.datum.PixelInCell)" class="member-name-link">get­Pixel­Orientation</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-tab1 method-summary-table-tab4">
<div class="block">Returns the pixel orientation which is equivalent to the given <code>Pixel­In­Cell</code> code.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="PixelTranslation.html" title="class in org.apache.sis.coverage.grid">Pixel­Translation</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getPixelTranslation(org.opengis.metadata.spatial.PixelOrientation)" class="member-name-link">get­Pixel­Translation</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">Pixel­Orientation</a>&nbsp;anchor)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Returns the specified position relative to the pixel center.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static double</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getPixelTranslation(org.opengis.referencing.datum.PixelInCell)" class="member-name-link">get­Pixel­Translation</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-tab1 method-summary-table-tab4">
<div class="block">Returns the position relative to the cell center.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#toString()" class="member-name-link">to­String</a>()</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Returns a string representation of this pixel translation.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#translate(org.opengis.referencing.operation.MathTransform,org.opengis.metadata.spatial.PixelOrientation,org.opengis.metadata.spatial.PixelOrientation,int,int)" class="member-name-link">translate</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;grid­To­CRS,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">Pixel­Orientation</a>&nbsp;current,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">Pixel­Orientation</a>&nbsp;desired,
int&nbsp;x­Dimension,
int&nbsp;y­Dimension)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Converts a math transform from a "pixel orientation" convention to another "pixel orientation" convention.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <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></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#translate(org.opengis.referencing.operation.MathTransform,org.opengis.referencing.datum.PixelInCell,org.opengis.referencing.datum.PixelInCell)" class="member-name-link">translate</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;grid­To­CRS,
<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;current,
<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;desired)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Converts a math transform from a "pixel in cell" convention to another "pixel in cell" convention.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">get­Class</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Object.html#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">
<!-- ============ FIELD DETAIL =========== -->
<li>
<section class="field-details" id="field-detail">
<h2>Field Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="orientation">
<h3>orientation</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">PixelOrientation</a></span>&nbsp;<span class="element-name">orientation</span></div>
<div class="block">The pixel orientation for this translation.
Most common values are <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Pixel­Orientation​.UPPER_LEFT</code></a> and <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#CENTER" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>Pixel­Orientation​.CENTER</code></a>.</div>
</section>
</li>
<li>
<section class="detail" id="dx">
<h3>dx</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">dx</span></div>
<div class="block">The translation among the <var>x</var> axis relative to pixel center.
The value is typically −½, 0 or +½.</div>
</section>
</li>
<li>
<section class="detail" id="dy">
<h3>dy</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">dy</span></div>
<div class="block">The translation among the <var>y</var> axis relative to pixel center.
The value is typically −½, 0 or +½.</div>
</section>
</li>
</ul>
</section>
</li>
<!-- ============ METHOD DETAIL ========== -->
<li>
<section class="method-details" id="method-detail">
<h2>Method Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="getPixelOrientation(org.opengis.referencing.datum.PixelInCell)">
<h3>getPixelOrientation</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">PixelOrientation</a></span>&nbsp;<span class="element-name">getPixelOrientation</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 pixel orientation which is equivalent to the given <code>Pixel­In­Cell</code> code.
This equivalence can be used for converting <var>n</var>-dimensional parameters to the
more specific two-dimensional case. This method implements the following mapping:
<table class="sis">
<caption>Pixel orientation equivalences</caption>
<tr><th>Pixel in cell</th><th>Pixel orientation</th></tr>
<tr><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html#CELL_CENTER" title="class or interface in org.opengis.referencing.datum" class="external-link"><code>CELL_CENTER</code></a></td><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#CENTER" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>CENTER</code></a></td></tr>
<tr><td><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>CELL_CORNER</code></a></td><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>UPPER_LEFT</code></a></td></tr>
<tr><td><code>null</code></td><td><code>null</code></td></tr>
</table></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>anchor</code> - the <code>Pixel­In­Cell</code> code, or <code>null</code>.</dd>
<dt>Returns:</dt>
<dd>the corresponding pixel orientation, or <code>null</code> if the argument was null.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given <code>anchor</code> is not a known code list value.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getPixelTranslation(org.opengis.referencing.datum.PixelInCell)">
<h3>getPixelTranslation</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type">double</span>&nbsp;<span class="element-name">getPixelTranslation</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 position relative to the cell center.
This method is typically used for <var>n</var>-dimensional grids, where the number of dimension is unknown.
The translation is determined from the following table, with the same value applied to all dimensions:
<table class="sis">
<caption>Translations</caption>
<tr><th>Pixel in cell</th><th>offset</th></tr>
<tr><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html#CELL_CENTER" title="class or interface in org.opengis.referencing.datum" class="external-link"><code>CELL_CENTER</code></a></td><td><code> 0.0</code></td></tr>
<tr><td><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>CELL_CORNER</code></a></td><td><code>-0.5</code></td></tr>
</table></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>anchor</code> - the "pixel in cell" value.</dd>
<dt>Returns:</dt>
<dd>the translation for the given "pixel in cell" value.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given <code>anchor</code> is not a known code list value.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getPixelTranslation(org.opengis.metadata.spatial.PixelOrientation)">
<h3>getPixelTranslation</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="PixelTranslation.html" title="class in org.apache.sis.coverage.grid">PixelTranslation</a></span>&nbsp;<span class="element-name">getPixelTranslation</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">PixelOrientation</a>&nbsp;anchor)</span></div>
<div class="block">Returns the specified position relative to the pixel center.
This method can be used for grid restricted to 2 dimensions.
The translation vector is determined from the following table:
<table class="sis">
<caption>Translations</caption>
<tr><th>Pixel orientation</th> <th> dx </th><th> dy </th></tr>
<tr><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#CENTER" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>CENTER</code></a></td> <td><code> 0.0</code></td><td><code> 0.0</code></td></tr>
<tr><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>UPPER_LEFT</code></a></td> <td><code>-0.5</code></td><td><code>-0.5</code></td></tr>
<tr><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#UPPER_RIGHT" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>UPPER_RIGHT</code></a></td><td><code>+0.5</code></td><td><code>-0.5</code></td></tr>
<tr><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#LOWER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>LOWER_LEFT</code></a></td> <td><code>-0.5</code></td><td><code>+0.5</code></td></tr>
<tr><td><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#LOWER_RIGHT" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>LOWER_RIGHT</code></a></td><td><code>+0.5</code></td><td><code>+0.5</code></td></tr>
</table></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>anchor</code> - the pixel orientation.</dd>
<dt>Returns:</dt>
<dd>the position relative to the pixel center.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if the given <code>anchor</code> is not a known code list value.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="translate(org.opengis.referencing.operation.MathTransform,org.opengis.referencing.datum.PixelInCell,org.opengis.referencing.datum.PixelInCell)">
<h3>translate</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link">MathTransform</a></span>&nbsp;<span class="element-name">translate</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;gridToCRS,
<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;current,
<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;desired)</span></div>
<div class="block">Converts a math transform from a "pixel in cell" convention to another "pixel in cell" convention.
This method concatenates −½, 0 or +½ translations on <em>all</em> dimensions before the given transform.
If the two given conventions are the same, then this method returns the given transform unchanged.
<p>If the given <code>grid­To­CRS</code> is null, then this method ignores all other arguments and returns <code>null</code>.
Otherwise <code>current</code> and <code>desired</code> arguments must be non-null.</p>
<h4 id="example-heading1">Example</h4>
If a given <code>grid­To­CRS</code> transform was mapping the <em>cell corner</em> to "real world" coordinates, then a call to
<code>translate(grid­To­CRS, <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>CELL_CORNER</code></a>, <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/datum/PixelInCell.html#CELL_CENTER" title="class or interface in org.opengis.referencing.datum" class="external-link"><code>CELL_CENTER</code></a>)</code>
will return a new transform performing the following steps: first convert grid coordinates from <var>cell center</var>
convention (<code>desired</code>) to <var>cell corner</var> convention (<code>current</code>), then concatenate the given
<code>grid­To­CRS</code> transform which was designed for the <em>cell corner</em> convention.
The above-cited <var>cell center</var><var>cell corner</var> conversion is done by translating the grid coordinates
by +½, because the grid coordinates (0,0) relative to cell center is (½,½) relative to cell corner.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>grid­To­CRS</code> - a math transform from <cite>pixel</cite> coordinates to any CRS, or <code>null</code>.</dd>
<dd><code>current</code> - the pixel orientation of the given <code>grid­To­CRS</code> transform.</dd>
<dd><code>desired</code> - the pixel orientation of the desired transform.</dd>
<dt>Returns:</dt>
<dd>the translation from <code>current</code> to <code>desired</code>, or <code>null</code> if <code>grid­To­CRS</code> was null.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if <code>current</code> or <code>desired</code> is not a known code list value.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="translate(org.opengis.referencing.operation.MathTransform,org.opengis.metadata.spatial.PixelOrientation,org.opengis.metadata.spatial.PixelOrientation,int,int)">
<h3>translate</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/operation/MathTransform.html" title="class or interface in org.opengis.referencing.operation" class="external-link">MathTransform</a></span>&nbsp;<span class="element-name">translate</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;gridToCRS,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">PixelOrientation</a>&nbsp;current,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html" title="class or interface in org.opengis.metadata.spatial" class="external-link">PixelOrientation</a>&nbsp;desired,
int&nbsp;xDimension,
int&nbsp;yDimension)</span></div>
<div class="block">Converts a math transform from a "pixel orientation" convention to another "pixel orientation" convention.
This method concatenates −½, 0 or +½ translations on <em>two</em> dimensions before the given transform.
The given transform can have any number of input and output dimensions, but only two of them will be converted.
<p>If the given <code>grid­To­CRS</code> is null, then this method ignores all other arguments and returns <code>null</code>.
Otherwise <code>current</code> and <code>desired</code> arguments must be non-null.</p>
<h4 id="example-heading2">Example</h4>
If a given <code>grid­To­CRS</code> transform was mapping the upper-left corner to "real world" coordinates, then a call to
<code>translate(grid­To­CRS, <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>UPPER_LEFT</code></a>, <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/spatial/PixelOrientation.html#CENTER" title="class or interface in org.opengis.metadata.spatial" class="external-link"><code>CENTER</code></a>, 0, 1)</code>
will return a new transform translating grid coordinates by +0.5 before to apply the given <code>grid­To­CRS</code> transform.
See example in above <a href="#translate(org.opengis.referencing.operation.MathTransform,org.opengis.referencing.datum.PixelInCell,org.opengis.referencing.datum.PixelInCell)"><code>translate</code></a> method for more details.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>grid­To­CRS</code> - a math transform from <cite>pixel</cite> coordinates to any CRS, or <code>null</code>.</dd>
<dd><code>current</code> - the pixel orientation of the given <code>grid­To­CRS</code> transform.</dd>
<dd><code>desired</code> - the pixel orientation of the desired transform.</dd>
<dd><code>x­Dimension</code> - the dimension of <var>x</var> coordinates (pixel columns). Often 0.</dd>
<dd><code>y­Dimension</code> - the dimension of <var>y</var> coordinates (pixel rows). Often 1.</dd>
<dt>Returns:</dt>
<dd>the translation from <code>current</code> to <code>desired</code>, or <code>null</code> if <code>grid­To­CRS</code> was null.</dd>
<dt>Throws:</dt>
<dd><code><a href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">Illegal­Argument­Exception</a></code> - if <code>current</code> or <code>desired</code> is not a known code list value.</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 pixel translation.</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>