blob: 050bc0085c7cc3cdacce39d827b99608e4fec23a [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (19) -->
<title>GeohashReferenceSystem.Coder (Apache SIS 1.3 API)</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="declaration: package: org.apache.sis.referencing.gazetteer, class: GeohashReferenceSystem, class: Coder">
<meta name="generator" content="javadoc/ClassWriterImpl">
<meta name="keywords" content="org.apache.sis.referencing.gazetteer.GeohashReferenceSystem.Coder class">
<meta name="keywords" content="getReferenceSystem()">
<meta name="keywords" content="getHashLength()">
<meta name="keywords" content="setHashLength()">
<meta name="keywords" content="getPrecision()">
<meta name="keywords" content="setPrecision()">
<meta name="keywords" content="encode()">
<meta name="keywords" content="decode()">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../sis.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../script-dir/jquery-ui.min.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery-ui.overrides.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-3.6.0.min.js"></script>
<script type="text/javascript" src="../../../../../script-dir/jquery-ui.min.js"></script>
</head>
<body class="class-declaration-page">
<script type="text/javascript">var pathtoroot = "../../../../../";
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="flex-box">
<header role="banner" class="flex-header">
<nav role="navigation">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span><span class="nav-bar-toggle-icon">&nbsp;</span></button>
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="nav-bar-cell1-rev">Class</li>
<li><a href="class-use/GeohashReferenceSystem.Coder.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html#class">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Summary:</p>
<ul>
<li>Nested</li>
<li>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="package-label-in-type">Package</span>&nbsp;<a href="package-summary.html">org.apache.sis.referencing.gazetteer</a></div>
<h1 title="Class GeohashReferenceSystem.Coder" class="title">Class GeohashReferenceSystem.Coder</h1>
</div>
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
<div class="inheritance"><a href="ReferencingByIdentifiers.Coder.html" title="class in org.apache.sis.referencing.gazetteer">ReferencingByIdentifiers.Coder</a>
<div class="inheritance">Coder</div>
</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>Enclosing class:</dt>
<dd><code><a href="GeohashReferenceSystem.html" title="class in org.apache.sis.referencing.gazetteer">Geohash­Reference­System</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">GeohashReferenceSystem.Coder</span>
<span class="extends-implements">extends <a href="ReferencingByIdentifiers.Coder.html" title="class in org.apache.sis.referencing.gazetteer">ReferencingByIdentifiers.Coder</a></span></div>
<div class="block">Conversions between direct positions and geohashes. Each <code>Coder</code> instance can read codes
at arbitrary precision, but formats at the <a href="#setHashLength(int)">specified precision</a>.
The same <code>Coder</code> instance can be reused for reading or writing many geohashes.
<h2>Immutability and thread safety</h2>
This class is <strong>not</strong> thread-safe. A new instance must be created for each thread,
or synchronization must be applied by the caller.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.8</dd>
<p><font size="-1">Defined in the <code>sis-referencing-by-identifiers</code> module</font></p>
</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 three-column-summary">
<div class="table-header col-first">Modifier</div>
<div class="table-header col-second">Constructor</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><code>protected </code></div>
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Coder</a>()</code></div>
<div class="col-last even-row-color">
<div class="block">Creates a new geohash coder/decoder initialized to the default precision.</div>
</div>
</div>
</section>
</li>
<!-- ========== METHOD SUMMARY =========== -->
<li>
<section class="method-summary" id="method-summary">
<h2>Method Summary</h2>
<div id="method-summary-table">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
<div id="method-summary-table.tabpanel" role="tabpanel">
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
<div class="table-header col-first">Modifier and Type</div>
<div class="table-header col-second">Method</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="AbstractLocation.html" title="class in org.apache.sis.referencing.gazetteer">Abstract­Location</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#decode(java.lang.CharSequence)" class="member-name-link">decode</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">Char­Sequence</a>&nbsp;geohash)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Decodes the given geohash into a latitude and a longitude.</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/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#encode(double,double)" class="member-name-link">encode</a><wbr>(double&nbsp;φ,
double&nbsp;λ)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Encodes the given latitude and longitude into a geohash.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#encode(org.opengis.geometry.DirectPosition)" class="member-name-link">encode</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">Direct­Position</a>&nbsp;position)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Encodes the given position into a geohash.</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/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#encode(org.opengis.geometry.DirectPosition,javax.measure.Quantity)" class="member-name-link">encode</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">Direct­Position</a>&nbsp;position,
<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a>&lt;?&gt;&nbsp;precision)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Encodes the given position into a geohash with the given precision.</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="#getHashLength()" class="member-name-link">get­Hash­Length</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 length of geohashes strings to be encoded by the <a href="#encode(org.opengis.geometry.DirectPosition)"><code>encode(Direct­Position)</code></a> method.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a>&lt;<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/quantity/Length.html" title="class or interface in javax.measure.quantity" class="external-link">Length</a>&gt;</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPrecision(org.opengis.geometry.DirectPosition)" class="member-name-link">get­Precision</a><wbr>(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">Direct­Position</a>&nbsp;position)</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 approximate precision of the geohashes formatted by this coder.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>final <a href="GeohashReferenceSystem.html" title="class in org.apache.sis.referencing.gazetteer">Geohash­Reference­System</a></code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getReferenceSystem()" class="member-name-link">get­Reference­System</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 reference system for which GeoHash identifiers will be encoded or decoded.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setHashLength(int)" class="member-name-link">set­Hash­Length</a><wbr>(int&nbsp;length)</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 length of geohashes strings to be encoded by the <a href="#encode(org.opengis.geometry.DirectPosition)"><code>encode(Direct­Position)</code></a> method.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPrecision(javax.measure.Quantity,org.opengis.geometry.DirectPosition)" class="member-name-link">set­Precision</a><wbr>(<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a>&lt;?&gt;&nbsp;precision,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">Direct­Position</a>&nbsp;position)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Sets the desired precision of the identifiers formatted by this coder.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-Object">Methods inherited from class&nbsp;<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
<code><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">get­Class</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hash­Code</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notify­All</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">to­String</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
</section>
</li>
</ul>
</section>
<section class="details">
<ul class="details-list">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<li>
<section class="constructor-details" id="constructor-detail">
<h2>Constructor Details</h2>
<ul class="member-list">
<li>
<section class="detail" id="&lt;init&gt;()">
<h3>Coder</h3>
<div class="member-signature"><span class="modifiers">protected</span>&nbsp;<span class="element-name">Coder</span>()</div>
<div class="block">Creates a new geohash coder/decoder initialized to the default precision.</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="getReferenceSystem()">
<h3>getReferenceSystem</h3>
<div class="member-signature"><span class="modifiers">public final</span>&nbsp;<span class="return-type"><a href="GeohashReferenceSystem.html" title="class in org.apache.sis.referencing.gazetteer">GeohashReferenceSystem</a></span>&nbsp;<span class="element-name">getReferenceSystem</span>()</div>
<div class="block">Returns the reference system for which GeoHash identifiers will be encoded or decoded.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ReferencingByIdentifiers.Coder.html#getReferenceSystem()">get­Reference­System</a></code>&nbsp;in class&nbsp;<code><a href="ReferencingByIdentifiers.Coder.html" title="class in org.apache.sis.referencing.gazetteer">Referencing­By­Identifiers​.Coder</a></code></dd>
<dt>Returns:</dt>
<dd>the enclosing reference system.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getHashLength()">
<h3>getHashLength</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">getHashLength</span>()</div>
<div class="block">Returns the length of geohashes strings to be encoded by the <a href="#encode(org.opengis.geometry.DirectPosition)"><code>encode(Direct­Position)</code></a> method.
The default value for <a href="GeohashReferenceSystem.Format.html#BASE32"><code>Geohash­Reference­System​.Format​.BASE32</code></a> is 12.</div>
<dl class="notes">
<dt>Returns:</dt>
<dd>the length of geohashes strings.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setHashLength(int)">
<h3>setHashLength</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setHashLength</span><wbr><span class="parameters">(int&nbsp;length)</span></div>
<div class="block">Sets the length of geohashes strings to be encoded by the <a href="#encode(org.opengis.geometry.DirectPosition)"><code>encode(Direct­Position)</code></a> method.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>length</code> - the new length of geohashes strings.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="getPrecision(org.opengis.geometry.DirectPosition)">
<h3>getPrecision</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a>&lt;<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/quantity/Length.html" title="class or interface in javax.measure.quantity" class="external-link">Length</a>&gt;</span>&nbsp;<span class="element-name">getPrecision</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">DirectPosition</a>&nbsp;position)</span></div>
<div class="block">Returns an approximate precision of the geohashes formatted by this coder.
Values are in units of ellipsoid axis length (typically metres). If the location is unspecified,
then this method returns a value for the "worst case" scenario, which is at equator.
The actual precision is sometimes (but not always) better for coordinates closer to a pole.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ReferencingByIdentifiers.Coder.html#getPrecision(org.opengis.geometry.DirectPosition)">get­Precision</a></code>&nbsp;in class&nbsp;<code><a href="ReferencingByIdentifiers.Coder.html" title="class in org.apache.sis.referencing.gazetteer">Referencing­By­Identifiers​.Coder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>position</code> - where to evaluate the precision, or <code>null</code> for equator.</dd>
<dt>Returns:</dt>
<dd>approximate precision of formatted geohashes.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="setPrecision(javax.measure.Quantity,org.opengis.geometry.DirectPosition)">
<h3>setPrecision</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">setPrecision</span><wbr><span class="parameters">(<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a>&lt;?&gt;&nbsp;precision,
<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">DirectPosition</a>&nbsp;position)</span>
throws <span class="exceptions"><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/IncommensurableException.html" title="class or interface in javax.measure" class="external-link">IncommensurableException</a></span></div>
<div class="block">Sets the desired precision of the identifiers formatted by this coder.
The given value is converted to a string length.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ReferencingByIdentifiers.Coder.html#setPrecision(javax.measure.Quantity,org.opengis.geometry.DirectPosition)">set­Precision</a></code>&nbsp;in class&nbsp;<code><a href="ReferencingByIdentifiers.Coder.html" title="class in org.apache.sis.referencing.gazetteer">Referencing­By­Identifiers​.Coder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>precision</code> - the desired precision in a linear or angular unit.</dd>
<dd><code>position</code> - location where the specified precision is desired, or <code>null</code> for the equator.</dd>
<dt>Throws:</dt>
<dd><code><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/IncommensurableException.html" title="class or interface in javax.measure" class="external-link">Incommensurable­Exception</a></code> - if the given precision does not use linear or angular units.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="encode(double,double)">
<h3>encode</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">encode</span><wbr><span class="parameters">(double&nbsp;φ,
double&nbsp;λ)</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">Encodes the given latitude and longitude into a geohash.
This method does <strong>not</strong> take in account the axis order and units of the coordinate
reference system (CRS) given to the <a href="GeohashReferenceSystem.html" title="class in org.apache.sis.referencing.gazetteer"><code>Geohash­Reference­System</code></a> constructor. For geohashing of
coordinates in different CRS, use <a href="#encode(org.opengis.geometry.DirectPosition)"><code>encode(Direct­Position)</code></a> instead.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>φ</code> - latitude to encode, as decimal degrees in the [-90 … 90]° range.</dd>
<dd><code>λ</code> - longitude to encode, as decimal degrees in the [-180 … 180]° range.</dd>
<dt>Returns:</dt>
<dd>geohash encoding of the given longitude and latitude.</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 an error occurred while formatting the given coordinate.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="encode(org.opengis.geometry.DirectPosition)">
<h3>encode</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">encode</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">DirectPosition</a>&nbsp;position)</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">Encodes the given position into a geohash. The default implementation transforms the given position
to the coordinate reference system expected by the enclosing <a href="GeohashReferenceSystem.html" title="class in org.apache.sis.referencing.gazetteer"><code>Geohash­Reference­System</code></a>, then
delegates to <a href="#encode(double,double)"><code>encode(double, double)</code></a>.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ReferencingByIdentifiers.Coder.html#encode(org.opengis.geometry.DirectPosition)">encode</a></code>&nbsp;in class&nbsp;<code><a href="ReferencingByIdentifiers.Coder.html" title="class in org.apache.sis.referencing.gazetteer">Referencing­By­Identifiers​.Coder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>position</code> - the coordinate to encode.</dd>
<dt>Returns:</dt>
<dd>geohash encoding of the given position.</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 an error occurred while transforming the given coordinate to a geohash reference.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="encode(org.opengis.geometry.DirectPosition,javax.measure.Quantity)">
<h3>encode</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span>&nbsp;<span class="element-name">encode</span><wbr><span class="parameters">(<a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/geometry/DirectPosition.html" title="class or interface in org.opengis.geometry" class="external-link">DirectPosition</a>&nbsp;position,
<a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/Quantity.html" title="class or interface in javax.measure" class="external-link">Quantity</a>&lt;?&gt;&nbsp;precision)</span>
throws <span class="exceptions"><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/IncommensurableException.html" title="class or interface in javax.measure" class="external-link">IncommensurableException</a>,
<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">Encodes the given position into a geohash with the given precision.
This is equivalent to invoking <a href="#setPrecision(javax.measure.Quantity,org.opengis.geometry.DirectPosition)"><code>set­Precision(Quantity, Direct­Position)</code></a>
before <a href="#encode(org.opengis.geometry.DirectPosition)"><code>encode(Direct­Position)</code></a>, except that it is potentially more efficient.</div>
<dl class="notes">
<dt>Overrides:</dt>
<dd><code><a href="ReferencingByIdentifiers.Coder.html#encode(org.opengis.geometry.DirectPosition,javax.measure.Quantity)">encode</a></code>&nbsp;in class&nbsp;<code><a href="ReferencingByIdentifiers.Coder.html" title="class in org.apache.sis.referencing.gazetteer">Referencing­By­Identifiers​.Coder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>position</code> - the coordinate to encode.</dd>
<dd><code>precision</code> - the desired precision in a linear or angular unit.</dd>
<dt>Returns:</dt>
<dd>geohash encoding of the given position.</dd>
<dt>Throws:</dt>
<dd><code><a href="http://unitsofmeasurement.github.io/unit-api/site/apidocs/javax/measure/IncommensurableException.html" title="class or interface in javax.measure" class="external-link">Incommensurable­Exception</a></code> - if the given precision does not use linear or angular units.</dd>
<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 an error occurred while transforming the given coordinate to a geohash reference.</dd>
<dt>Since:</dt>
<dd>1.3</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="decode(java.lang.CharSequence)">
<h3>decode</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="AbstractLocation.html" title="class in org.apache.sis.referencing.gazetteer">AbstractLocation</a></span>&nbsp;<span class="element-name">decode</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/lang/CharSequence.html" title="class or interface in java.lang" class="external-link">CharSequence</a>&nbsp;geohash)</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">Decodes the given geohash into a latitude and a longitude.
The axis order depends on the coordinate reference system of the enclosing <a href="GeohashReferenceSystem.html" title="class in org.apache.sis.referencing.gazetteer"><code>Geohash­Reference­System</code></a>.
<div class="warning"><b>Upcoming API change — generalization</b><br>
in a future SIS version, the type of returned element may be generalized
to the <code>org​.opengis​.referencing​.gazetteer​.Location</code> interface.
This change is pending GeoAPI revision.</div></div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="ReferencingByIdentifiers.Coder.html#decode(java.lang.CharSequence)">decode</a></code>&nbsp;in class&nbsp;<code><a href="ReferencingByIdentifiers.Coder.html" title="class in org.apache.sis.referencing.gazetteer">Referencing­By­Identifiers​.Coder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>geohash</code> - geohash string to decode.</dd>
<dt>Returns:</dt>
<dd>a new geographic coordinate for the given geohash.</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 an error occurred while parsing the given string.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2010&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>