blob: 0d957392fb46517d18977481bf8981ecfdf2b8ad [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.4) on Fri Sep 20 12:10:30 CEST 2019 -->
<title>PixelTranslation (Apache SIS 1.0 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="dc.created" content="2019-09-20">
<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="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="PixelTranslation (Apache SIS 1.0 API)";
}
}
catch(err) {
}
//-->
var data = {"i0":9,"i1":9,"i2":9,"i3":10,"i4":9,"i5":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";
var useModuleDirectories = false;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PixelTranslation.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<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="subNavList">
<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>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.coverage.grid</a></div>
<h2 title="Class PixelTranslation" class="title">Class PixelTranslation</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../../util/Static.html" title="class in org.apache.sis.util">Static</a></li>
<li>
<ul class="inheritance">
<li>PixelTranslation</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></code></dd>
</dl>
<hr>
<pre>public final class <span class="typeNameLabel">PixelTranslation</span>
extends <a href="../../util/Static.html" title="class in org.apache.sis.util">Static</a>
implements <a href="https://docs.oracle.com/javase/8/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io" class="externalLink">Serializable</a></pre>
<div class="block">The translation to apply for different values of <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><code>Pixel­Orientation</code></a> or <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink"><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/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink"><code>Math­Transform</code></a> instance.
<div class="note"><b>Example:</b>
if the following code snippet, <code>grid­To­CRS</code> is an <a href="https://docs.oracle.com/javase/8/docs/api/java/awt/geom/AffineTransform.html?is-external=true" title="class or interface in java.awt.geom" class="externalLink"><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/metadata/spatial/PixelOrientation.html?is-external=true#CENTER" title="class or interface in org.opengis.metadata.spatial" class="externalLink">center</a>,
while the <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="externalLink">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:
<blockquote><pre><font color="green">final</font> AffineTransform gridToCRS = ...;
<font color="green">final</font> PixelOrientation current = PixelOrientation.CENTER;
<font color="green">final</font> PixelOrientation desired = PixelOrientation.UPPER_LEFT;
<i><font color="gray">// Switch the transform from 'current' to 'desired' convention.</font></i>
<font color="green">final</font> PixelTranslation source = <b>getPixelTranslation</b>(current);
<font color="green">final</font> PixelTranslation target = <b>getPixelTranslation</b>(desired);
gridToCRS.<b>translate</b>(target.dx - source.dx,
target.dy - source.dy);</pre></blockquote>
</div></div>
<dl>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.0</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink"><code>Pixel­In­Cell</code></a>,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><code>Pixel­Orientation</code></a>,
<a href="../../../../../serialized-form.html#org.apache.sis.coverage.grid.PixelTranslation">Serialized Form</a></dd>
<p><font size="-1">Defined in the <code>sis-feature</code> module</font></p>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#dx">dx</a></span></code></th>
<td class="colLast">
<div class="block">The translation among the <var>x</var> axis relative to pixel center.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#dy">dy</a></span></code></th>
<td class="colLast">
<div class="block">The translation among the <var>y</var> axis relative to pixel center.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#orientation">orientation</a></span></code></th>
<td class="colLast">
<div class="block">The pixel orientation for this translation.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>static <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPixelOrientation(org.opengis.referencing.datum.PixelInCell)">getPixelOrientation</a></span>&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink">PixelInCell</a>&nbsp;anchor)</code></th>
<td class="colLast">
<div class="block">Returns the pixel orientation which is equivalent to the given <code>Pixel­In­Cell</code> code.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static <a href="PixelTranslation.html" title="class in org.apache.sis.coverage.grid">PixelTranslation</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPixelTranslation(org.opengis.metadata.spatial.PixelOrientation)">getPixelTranslation</a></span>&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a>&nbsp;anchor)</code></th>
<td class="colLast">
<div class="block">Returns the specified position relative to the pixel center.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPixelTranslation(org.opengis.referencing.datum.PixelInCell)">getPixelTranslation</a></span>&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink">PixelInCell</a>&nbsp;anchor)</code></th>
<td class="colLast">
<div class="block">Returns the position relative to the cell center.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns a string representation of this pixel translation.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>static <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#translate(org.opengis.referencing.operation.MathTransform,org.opengis.metadata.spatial.PixelOrientation,org.opengis.metadata.spatial.PixelOrientation,int,int)">translate</a></span>&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a>&nbsp;gridToCRS,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a>&nbsp;current,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a>&nbsp;desired,
int&nbsp;xDimension,
int&nbsp;yDimension)</code></th>
<td class="colLast">
<div class="block">Converts a math transform from a "pixel orientation" convention to another "pixel orientation" convention.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>static <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#translate(org.opengis.referencing.operation.MathTransform,org.opengis.referencing.datum.PixelInCell,org.opengis.referencing.datum.PixelInCell)">translate</a></span>&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a>&nbsp;gridToCRS,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink">PixelInCell</a>&nbsp;current,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink">PixelInCell</a>&nbsp;desired)</code></th>
<td class="colLast">
<div class="block">Converts a math transform from a "pixel in cell" convention to another "pixel in cell" convention.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">get­Class</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hash­Code</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notify­All</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="orientation">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>orientation</h4>
<pre>public final&nbsp;<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a> orientation</pre>
<div class="block">The pixel orientation for this translation.
Most common values are <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><code>Pixel­Orientation​.UPPER_LEFT</code></a> and <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true#CENTER" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><code>Pixel­Orientation​.CENTER</code></a>.</div>
</li>
</ul>
<a id="dx">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dx</h4>
<pre>public final&nbsp;double dx</pre>
<div class="block">The translation among the <var>x</var> axis relative to pixel center.
The value is typically −½, 0 or +½.</div>
</li>
</ul>
<a id="dy">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>dy</h4>
<pre>public final&nbsp;double dy</pre>
<div class="block">The translation among the <var>y</var> axis relative to pixel center.
The value is typically −½, 0 or +½.</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getPixelOrientation(org.opengis.referencing.datum.PixelInCell)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPixelOrientation</h4>
<pre class="methodSignature">public static&nbsp;<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a>&nbsp;getPixelOrientation&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink">PixelInCell</a>&nbsp;anchor)</pre>
<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/referencing/datum/PixelInCell.html?is-external=true#CELL_CENTER" title="class or interface in org.opengis.referencing.datum" class="externalLink"><code>CELL_CENTER</code></a></td><td><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true#CENTER" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><code>CENTER</code></a></td></tr>
<tr><td><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true#CELL_CORNER" title="class or interface in org.opengis.referencing.datum" class="externalLink"><code>CELL_CORNER</code></a></td><td><a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><code>UPPER_LEFT</code></a></td></tr>
<tr><td><code>null</code></td><td><code>null</code></td></tr>
</table></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>anchor</code> - the <code>Pixel­In­Cell</code> code, or <code>null</code>.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the corresponding pixel orientation, or <code>null</code> if the argument was null.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</a></code> - if the given <code>anchor</code> is not a known code list value.</dd>
</dl>
</li>
</ul>
<a id="getPixelTranslation(org.opengis.referencing.datum.PixelInCell)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPixelTranslation</h4>
<pre class="methodSignature">public static&nbsp;double&nbsp;getPixelTranslation&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink">PixelInCell</a>&nbsp;anchor)</pre>
<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/referencing/datum/PixelInCell.html?is-external=true#CELL_CENTER" title="class or interface in org.opengis.referencing.datum" class="externalLink"><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/referencing/datum/PixelInCell.html?is-external=true#CELL_CORNER" title="class or interface in org.opengis.referencing.datum" class="externalLink"><code>CELL_CORNER</code></a></td><td><code>-0.5</code></td></tr>
</table></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>anchor</code> - the "pixel in cell" value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the translation for the given "pixel in cell" value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</a></code> - if the given <code>anchor</code> is not a known code list value.</dd>
</dl>
</li>
</ul>
<a id="getPixelTranslation(org.opengis.metadata.spatial.PixelOrientation)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPixelTranslation</h4>
<pre class="methodSignature">public static&nbsp;<a href="PixelTranslation.html" title="class in org.apache.sis.coverage.grid">PixelTranslation</a>&nbsp;getPixelTranslation&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a>&nbsp;anchor)</pre>
<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/metadata/spatial/PixelOrientation.html?is-external=true#CENTER" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><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/metadata/spatial/PixelOrientation.html?is-external=true#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><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/metadata/spatial/PixelOrientation.html?is-external=true#UPPER_RIGHT" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><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/metadata/spatial/PixelOrientation.html?is-external=true#LOWER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><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/metadata/spatial/PixelOrientation.html?is-external=true#LOWER_RIGHT" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><code>LOWER_RIGHT</code></a></td><td><code>+0.5</code></td><td><code>+0.5</code></td></tr>
</table></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>anchor</code> - the pixel orientation.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the position relative to the pixel center.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</a></code> - if the given <code>anchor</code> is not a known code list value.</dd>
</dl>
</li>
</ul>
<a id="translate(org.opengis.referencing.operation.MathTransform,org.opengis.referencing.datum.PixelInCell,org.opengis.referencing.datum.PixelInCell)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>translate</h4>
<pre class="methodSignature">public static&nbsp;<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a>&nbsp;translate&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a>&nbsp;gridToCRS,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink">PixelInCell</a>&nbsp;current,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true" title="class or interface in org.opengis.referencing.datum" class="externalLink">PixelInCell</a>&nbsp;desired)</pre>
<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.
<div class="note"><b>Example:</b>
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/referencing/datum/PixelInCell.html?is-external=true#CELL_CORNER" title="class or interface in org.opengis.referencing.datum" class="externalLink"><code>CELL_CORNER</code></a>, <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/datum/PixelInCell.html?is-external=true#CELL_CENTER" title="class or interface in org.opengis.referencing.datum" class="externalLink"><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>
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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></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><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</a></code> - if <code>current</code> or <code>desired</code> is not a known code list value.</dd>
</dl>
</li>
</ul>
<a id="translate(org.opengis.referencing.operation.MathTransform,org.opengis.metadata.spatial.PixelOrientation,org.opengis.metadata.spatial.PixelOrientation,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>translate</h4>
<pre class="methodSignature">public static&nbsp;<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a>&nbsp;translate&#8203;(<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/referencing/operation/MathTransform.html?is-external=true" title="class or interface in org.opengis.referencing.operation" class="externalLink">MathTransform</a>&nbsp;gridToCRS,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a>&nbsp;current,
<a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true" title="class or interface in org.opengis.metadata.spatial" class="externalLink">PixelOrientation</a>&nbsp;desired,
int&nbsp;xDimension,
int&nbsp;yDimension)</pre>
<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.
<div class="note"><b>Example:</b>
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/metadata/spatial/PixelOrientation.html?is-external=true#UPPER_LEFT" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><code>UPPER_LEFT</code></a>, <a href="http://www.geoapi.org/3.0/javadoc/org/opengis/metadata/spatial/PixelOrientation.html?is-external=true#CENTER" title="class or interface in org.opengis.metadata.spatial" class="externalLink"><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>
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.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></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><span class="returnLabel">Returns:</span></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><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang" class="externalLink">Illegal­Argument­Exception</a></code> - if <code>current</code> or <code>desired</code> is not a known code list value.</dd>
</dl>
</li>
</ul>
<a id="toString()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;toString()</pre>
<div class="block">Returns a string representation of this pixel translation.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">to­String</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PixelTranslation.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<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="subNavList">
<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>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2010&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>