blob: 90431862f704c2a03bfde86be88694edd96e9bd1 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (21) on Thu Oct 05 19:54:57 CEST 2023 -->
<title>org.apache.sis.referencing (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.referencing, package: org.apache.sis.referencing">
<meta name="generator" content="javadoc/PackageWriterImpl">
<meta name="keywords" content="org.apache.sis.referencing package">
<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="package-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 class="nav-bar-cell1-rev">Package</li>
<li>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#package">Help</a></li>
</ul>
<ul class="sub-nav-list-small">
<li>
<p>Package:</p>
<ul>
<li><a href="#package-description">Description</a></li>
<li><a href="#related-package-summary">Related Packages</a></li>
<li><a href="#class-summary">Classes and Interfaces</a></li>
</ul>
</li>
</ul>
</div>
<div class="sub-nav">
<div id="navbar-sub-list">
<ul class="sub-nav-list">
<li>Package:&nbsp;</li>
<li><a href="#package-description">Description</a>&nbsp;|&nbsp;</li>
<li><a href="#related-package-summary">Related Packages</a>&nbsp;|&nbsp;</li>
<li><a href="#class-summary">Classes and Interfaces</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">
<div class="header">
<div class="sub-title"><span class="module-label-in-package">Module</span>&nbsp;<a href="../../../../module-summary.html">org.apache.sis.referencing</a></div>
<h1 title="Package org.apache.sis.referencing" class="title">Package org.apache.sis.referencing</h1>
</div>
<hr>
<div class="package-signature">package <span class="element-name">org.apache.sis.referencing</span></div>
<section class="package-description" id="package-description">
<div class="block">Base classes for reference systems used for general positioning.
An explanation for this package is provided in the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/package-summary.html" class="external-link">OpenGIS® javadoc</a>.
The remaining discussion on this page is specific to the SIS implementation.
<p>The most commonly used kinds of Reference Systems in Apache SIS are the <cite>Coordinate Reference Systems</cite>
(CRS), which handle coordinates of arbitrary dimensions. The SIS implementations can handle 2D and 3D coordinates,
as well as 4D, 5D, <i>etc</i>. Another less-frequently used kind of Reference System uses labels instead, as in
postal address. This package is the root for both kinds, with an emphasis on the one for coordinates.
The two kinds of referencing system are implemented in the following packages:</p>
<ul>
<li><a href="crs/package-summary.html"><code>org​.apache​.sis​.referencing​.crs</code></a> for <cite>referencing by coordinates</cite> (ISO 19111)</li>
<li><a href="../../../../../org.apache.sis.referencing.gazetteer/org/apache/sis/referencing/gazetteer/package-summary.html"><code>org​.apache​.sis​.referencing​.gazetteer</code></a> for <cite>referencing by geographic identifiers</cite>
(ISO 19112), together with the linking from geographic identifiers to coordinates.</li>
</ul>
<h2 id="fetching-geodetic-object-instances-heading">Fetching geodetic object instances</h2>
Geodetic objects can be instantiated either
<a href="factory/GeodeticObjectFactory.html" title="class in org.apache.sis.referencing.factory">directly by specifying all information to a factory method or constructor</a>, or
<a href="factory/GeodeticAuthorityFactory.html" title="class in org.apache.sis.referencing.factory">indirectly by specifying the identifier of an entry in a database</a>.
In particular, the <a href="https://epsg.org/">EPSG</a> database provides definitions for many geodetic objects,
and Apache SIS provides convenience shortcuts for some of them in the
<a href="CommonCRS.html" title="enum class in org.apache.sis.referencing"><code>Common­CRS</code></a> enumerations. Other convenience methods are
<a href="CRS.html#forCode(java.lang.String)"><code>CRS​.for­Code(String)</code></a>,
<a href="CRS.html#fromWKT(java.lang.String)"><code>CRS​.from­WKT(String)</code></a> and
<a href="CRS.html#fromXML(java.lang.String)"><code>CRS​.from­XML(String)</code></a>
<h2 id="usage-example-heading">Usage example</h2>
The following example projects a (<var>latitude</var>, <var>longitude</var>) coordinate to
a <cite>Universal Transverse Mercator</cite> projection in the zone of the coordinate:
<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">GeographicCRS source = CommonCRS.WGS84.geographic();
ProjectedCRS target = CommonCRS.WGS84.UTM(20, 30); // 20°N 30°E (watch out axis order!)
CoordinateOperation operation = CRS.findOperation(source, target, null);
if (CRS.getLinearAccuracy(operation) &gt; 100) {
// If the accuracy is coarser than 100 metres (or any other threshold at application choice)
// maybe the operation is not suitable. Decide here what to do (throw an exception, etc).
}
MathTransform mt = operation.getMathTransform();
DirectPosition position = new DirectPosition2D(20, 30); // 20°N 30°E (watch out axis order!)
position = mt.transform(position, position);
System.out.println(position);
</code></pre>
</div>
<h2 id="the-epsg-database-heading">The EPSG database</h2>
The EPSG geodetic parameter dataset is a structured database required to:
<ul>
<li>define <a href="crs/AbstractCRS.html" title="class in org.apache.sis.referencing.crs">Coordinate Reference Systems</a>
(CRS) such that coordinates describe positions unambiguously;</li>
<li>define <a href="operation/AbstractCoordinateOperation.html" title="class in org.apache.sis.referencing.operation">Coordinate Operations</a>
that allow coordinates to be changed from one CRS to another CRS.</li>
</ul>
Various programmatic elements in Apache SIS have a relationship with EPSG entries, including:
<ul>
<li>classes or methods implementing a specific coordinate operation method;</li>
<li>enumeration constants representing some specific CRS;</li>
<li>fields containing parameter values.</li>
</ul>
Relationship with EPSG has two components documented in the javadoc: the object type and the EPSG code.
The <var>type</var> specifies which <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/AuthorityFactory.html" title="class or interface in org.opengis.referencing" class="external-link"><code>Authority­Factory</code></a> method to invoke, while
the <var>code</var> specifies the argument value to give to that method in order to get the EPSG object.
For example, the <a href="CommonCRS.html#WGS84"><code>Common­CRS​.WGS84</code></a> documentation said that object
of type <cite>geodetic datum</cite> is associated to code <code>EPSG:6326</code>.
This means that the EPSG object could be obtained by the following code:
<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">DatumAuthorityFactory factory = ...; // TODO: document how to obtain an EPSG factory.
GeodeticDatum datum = factory.createGeodeticDatum("6326");
</code></pre>
</div>
The EPSG objects can also be inspected online on the <a href="https://epsg.org/">EPSG repository</a> web site.</div>
<dl class="notes">
<dt>Since:</dt>
<dd>0.4</dd>
</dl>
</section>
<section class="summary">
<ul class="summary-list">
<li>
<div id="related-package-summary">
<div class="caption"><span>Related Packages</span></div>
<div class="summary-table three-column-summary">
<div class="table-header col-first">Module</div>
<div class="table-header col-second">Package</div>
<div class="table-header col-last">Description</div>
<div class="col-plain even-row-color"><a href="../../../../module-summary.html">org.apache.sis.referencing</a></div>
<div class="col-first even-row-color"><a href="crs/package-summary.html">org.apache.sis.referencing.crs</a></div>
<div class="col-last even-row-color">
<div class="block">Coordinate Reference System (CRS) definitions as coordinate systems related to the earth through datum.</div>
</div>
<div class="col-plain odd-row-color"><a href="../../../../module-summary.html">org.apache.sis.referencing</a></div>
<div class="col-first odd-row-color"><a href="cs/package-summary.html">org.apache.sis.referencing.cs</a></div>
<div class="col-last odd-row-color">
<div class="block">Coordinate System (CS) definitions as the set of coordinate system axes that spans the coordinate space.</div>
</div>
<div class="col-plain even-row-color"><a href="../../../../module-summary.html">org.apache.sis.referencing</a></div>
<div class="col-first even-row-color"><a href="datum/package-summary.html">org.apache.sis.referencing.datum</a></div>
<div class="col-last even-row-color">
<div class="block">Relationship of a <code>Coordinate­System</code> (an abstract mathematical entity) to the earth or other system.</div>
</div>
<div class="col-plain odd-row-color"><a href="../../../../module-summary.html">org.apache.sis.referencing</a></div>
<div class="col-first odd-row-color"><a href="factory/package-summary.html">org.apache.sis.referencing.factory</a></div>
<div class="col-last odd-row-color">
<div class="block">Creates Coordinate Reference System (CRS) objects from given properties or authority codes.</div>
</div>
<div class="col-plain even-row-color"><a href="../../../../../org.apache.sis.referencing.gazetteer/module-summary.html">org.apache.sis.referencing.gazetteer</a></div>
<div class="col-first even-row-color"><a href="../../../../../org.apache.sis.referencing.gazetteer/org/apache/sis/referencing/gazetteer/package-summary.html">org.apache.sis.referencing.gazetteer</a></div>
<div class="col-last even-row-color">
<div class="block">Mapping between geographic identifiers (addresses, grid indexes…) and locations (descriptions, coordinates…).</div>
</div>
<div class="col-plain odd-row-color"><a href="../../../../module-summary.html">org.apache.sis.referencing</a></div>
<div class="col-first odd-row-color"><a href="operation/package-summary.html">org.apache.sis.referencing.operation</a></div>
<div class="col-last odd-row-color">
<div class="block">Relationship between any two <a href="crs/AbstractCRS.html" title="class in org.apache.sis.referencing.crs">Coordinate Reference Systems</a> (CRS).</div>
</div>
</div>
</div>
</li>
<li>
<div id="class-summary">
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="class-summary-tab0" role="tab" aria-selected="true" aria-controls="class-summary.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('class-summary', 'class-summary', 2)" class="active-table-tab">All Classes and Interfaces</button><button id="class-summary-tab2" role="tab" aria-selected="false" aria-controls="class-summary.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('class-summary', 'class-summary-tab2', 2)" class="table-tab">Classes</button><button id="class-summary-tab3" role="tab" aria-selected="false" aria-controls="class-summary.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('class-summary', 'class-summary-tab3', 2)" class="table-tab">Enum Classes</button><button id="class-summary-tab5" role="tab" aria-selected="false" aria-controls="class-summary.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('class-summary', 'class-summary-tab5', 2)" class="table-tab">Exception Classes</button></div>
<div id="class-summary.tabpanel" role="tabpanel">
<div class="summary-table two-column-summary" aria-labelledby="class-summary-tab0">
<div class="table-header col-first">Class</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="AbstractIdentifiedObject.html" title="class in org.apache.sis.referencing">AbstractIdentifiedObject</a></div>
<div class="col-last even-row-color class-summary class-summary-tab2">
<div class="block">Base class for objects identified by a name or a code.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="AbstractReferenceSystem.html" title="class in org.apache.sis.referencing">AbstractReferenceSystem</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab2">
<div class="block">Description of a spatial and temporal reference system used by a dataset.</div>
</div>
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="Builder.html" title="class in org.apache.sis.referencing">Builder</a>&lt;B extends <a href="Builder.html" title="class in org.apache.sis.referencing">Builder</a>&lt;B&gt;&gt;</div>
<div class="col-last even-row-color class-summary class-summary-tab2">
<div class="block">Base class of builders for various kinds of <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/IdentifiedObject.html" title="class or interface in org.opengis.referencing" class="external-link"><code>Identified­Object</code></a>.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab3"><a href="CommonCRS.html" title="enum class in org.apache.sis.referencing">CommonCRS</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab3">
<div class="block">Frequently-used geodetic CRS and datum that are guaranteed to be available in SIS.</div>
</div>
<div class="col-first even-row-color class-summary class-summary-tab3"><a href="CommonCRS.Engineering.html" title="enum class in org.apache.sis.referencing">CommonCRS.Engineering</a></div>
<div class="col-last even-row-color class-summary class-summary-tab3">
<div class="block">Frequently-used engineering CRS and datum that are guaranteed to be available in SIS.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab3"><a href="CommonCRS.Temporal.html" title="enum class in org.apache.sis.referencing">CommonCRS.Temporal</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab3">
<div class="block">Frequently-used temporal CRS and datum that are guaranteed to be available in SIS.</div>
</div>
<div class="col-first even-row-color class-summary class-summary-tab3"><a href="CommonCRS.Vertical.html" title="enum class in org.apache.sis.referencing">CommonCRS.Vertical</a></div>
<div class="col-last even-row-color class-summary class-summary-tab3">
<div class="block">Frequently-used vertical CRS and datum that are guaranteed to be available in SIS.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="CRS.html" title="class in org.apache.sis.referencing">CRS</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab2">
<div class="block">Static methods working on <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/crs/CoordinateReferenceSystem.html" title="class or interface in org.opengis.referencing.crs" class="external-link">Coordinate Reference Systems</a>.</div>
</div>
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="DefaultObjectDomain.html" title="class in org.apache.sis.referencing">DefaultObjectDomain</a></div>
<div class="col-last even-row-color class-summary class-summary-tab2">
<div class="block">Scope and domain of validity of a CRS-related object.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="GeodeticCalculator.html" title="class in org.apache.sis.referencing">GeodeticCalculator</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab2">
<div class="block">Performs geodetic calculations on a sphere or an ellipsoid.</div>
</div>
<div class="col-first even-row-color class-summary class-summary-tab5"><a href="GeodeticException.html" title="class in org.apache.sis.referencing">GeodeticException</a></div>
<div class="col-last even-row-color class-summary class-summary-tab5">
<div class="block">Unchecked exception thrown when an error occurred while computing a geodetic value.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="IdentifiedObjects.html" title="class in org.apache.sis.referencing">IdentifiedObjects</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab2">
<div class="block">Utility methods working on arbitrary implementations of the <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/referencing/IdentifiedObject.html" title="class or interface in org.opengis.referencing" class="external-link"><code>Identified­Object</code></a> interface.</div>
</div>
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="ImmutableIdentifier.html" title="class in org.apache.sis.referencing">ImmutableIdentifier</a></div>
<div class="col-last even-row-color class-summary class-summary-tab2">
<div class="block">Immutable value uniquely identifying an object within a namespace, together with a version.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="NamedIdentifier.html" title="class in org.apache.sis.referencing">NamedIdentifier</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab2">
<div class="block">An identification of a CRS object which is both a <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/metadata/Identifier.html" title="class or interface in org.opengis.metadata" class="external-link"><code>Identifier</code></a> and a <a href="http://www.geoapi.org/3.0/javadoc/org.opengis.geoapi/org/opengis/util/GenericName.html" title="class or interface in org.opengis.util" class="external-link"><code>Generic­Name</code></a>.</div>
</div>
</div>
</div>
</div>
</li>
</ul>
</section>
</main>
</div>
</div>
</body>
</html>