blob: 227e5e4c84256fe74d53f9fd7ac911d47db882cd [file] [log] [blame]
<!DOCTYPE HTML>
<html lang="en">
<head>
<!-- Generated by javadoc (19) -->
<title>org.apache.sis.storage.sql (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.storage.sql">
<meta name="generator" content="javadoc/PackageWriterImpl">
<meta name="keywords" content="org.apache.sis.storage.sql 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">
<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="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 class="nav-bar-cell1-rev">Package</li>
<li>Class</li>
<li><a href="package-use.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#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">
<h1 title="Package org.apache.sis.storage.sql" class="title">Package org.apache.sis.storage.sql</h1>
</div>
<hr>
<div class="package-signature">package <span class="element-name">org.apache.sis.storage.sql</span></div>
<section class="package-description" id="package-description">
<div class="block">Data store capable to read and create features from a JDBC connection to a database.
<a href="SQLStore.html" title="class in org.apache.sis.storage.sql"><code>SQLStore</code></a> takes a one or more tables at construction time.
Each enumerated table is represented by a <code>Feature­Type</code>.
Each row in those table represents a <code>Feature</code> instance.
Each relation defined by a foreigner key is represented by an <code>Feature­Association­Role</code>
to another feature (with transitive dependencies automatically resolved), and the other columns are represented
by <code>Attribute­Type</code>.
<p>The storage of spatial features in SQL databases is described by the
<a href="https://www.ogc.org/standards/sfs">OGC Simple feature access - Part 2: SQL option</a>
international standard, also known as ISO 19125-2. Implementation of geometric types and operations must
be provided by the database (sometimes through an extension, for example PostGIS on PostgreSQL databases).
This Java package uses those provided types and operations.</p>
<h2>Performance tips</h2>
<p>A subset of features can be obtained by applying filters on the stream returned by
<a href="../FeatureSet.html#features(boolean)"><code>Feature­Set​.features(boolean)</code></a>.
While the filter can be any <a href="https://docs.oracle.com/en/java/javase/16/docs/api/java.base/java/util/function/Predicate.html" title="class or interface in java.util.function" class="external-link"><code>Predicate</code></a>,
performances will be much better if they are instances of <a href="../../filter/Filter.html" title="interface in org.apache.sis.filter"><code>Filter</code></a>
because Apache SIS will know how to translate some of them to SQL statements.</p>
<p>In filter expressions like <code>ST_Intersects(A,B)</code> where the <var>A</var> and <var>B</var> parameters are
two sub-expressions evaluating to geometry values, if one of those expressions is a literal, then that literal
should be <var>B</var>. The reason is because the SQLMM standard requires us to project <var>B</var> in the
Coordinate Reference System of <var>A</var>. If <var>B</var> is a literal, Apache SIS can do this transformation
only once before to start the filtering process instead of every time that the filter needs to be evaluated.</p>
<h2>Limitations</h2>
<ul>
<li>Current implementation does not scan the <code>"GEOMETRY_COLUMNS"</code> (from Simple Feature Access)
or <code>"gpkg_content"</code> (from GeoPackage) tables for a default list of feature tables.</li>
<li>Current implementation does not yet map geometric objects (e.g. PostGIS types).</li>
<li>If a parent feature contains association to other features, those other features are created
at the same time than the parent feature (no lazy instantiation yet).</li>
</ul></div>
<dl class="notes">
<dt>Since:</dt>
<dd>1.0</dd>
<p><font size="-1">Defined in the <code>sis-sqlstore</code> module</font></p>
</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 two-column-summary">
<div class="table-header col-first">Package</div>
<div class="table-header col-last">Description</div>
<div class="col-first even-row-color"><a href="../package-summary.html">org.apache.sis.storage</a></div>
<div class="col-last even-row-color">
<div class="block"><a href="../DataStore.html" title="class in org.apache.sis.storage">Data store</a> base types for retrieving and saving geospatial data
in various storage formats.</div>
</div>
</div>
</div>
</li>
<li>
<div id="class-summary">
<div class="caption"><span>Classes</span></div>
<div class="summary-table two-column-summary">
<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="ResourceDefinition.html" title="class in org.apache.sis.storage.sql">ResourceDefinition</a></div>
<div class="col-last even-row-color class-summary class-summary-tab2">
<div class="block">Definition of a resource (table, view or query) to include in a <a href="SQLStore.html" title="class in org.apache.sis.storage.sql"><code>SQLStore</code></a>.</div>
</div>
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="SQLStore.html" title="class in org.apache.sis.storage.sql">SQLStore</a></div>
<div class="col-last odd-row-color class-summary class-summary-tab2">
<div class="block">A data store capable to read and create features from a spatial database.</div>
</div>
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="SQLStoreProvider.html" title="class in org.apache.sis.storage.sql">SQLStoreProvider</a></div>
<div class="col-last even-row-color class-summary class-summary-tab2">
<div class="block">Provider of <code>SQLStore</code> instances.</div>
</div>
</div>
</div>
</li>
</ul>
</section>
</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>