📄 abstractdatastore.html
字号:
<A HREF="../../../org/geotools/feature/SchemaException.html" title="class in org.geotools.feature">SchemaException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../org/geotools/data/DataStore.html" title="interface in org.geotools.data">DataStore</A></CODE></B></DD><DD>Access a FeatureSource for Query providing a high-level API. <p> The provided Query does not need to completely cover the existing schema for Query.getTypeName(). The result will mostly likely only be a FeatureSource and probably wont' allow write access by the FeatureStore method. </p> <p> By using Query we allow support for reprojection, in addition to overriding the CoordinateSystem used by the native FeatureType. </p> <p> We may wish to limit this method to only support Queries using Filter.ALL. </p> <p> Update - GeoServer has an elegatent implementation of this functionality that we could steal. GeoServerFeatureSource, GeoServerFeatureStore and GeoServerFeatureLocking serve as a working prototype. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/DataStore.html#getView(org.geotools.data.Query)">getView</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/DataStore.html" title="interface in org.geotools.data">DataStore</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>query</CODE> - Query.getTypeName() locates FeatureType being viewed<DT><B>Returns:</B><DD>FeatureSource providing opperations for featureType<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - If FeatureSource is not available<DD><CODE><A HREF="../../../org/geotools/feature/SchemaException.html" title="class in org.geotools.feature">SchemaException</A></CODE> - If fetureType is not covered by existing schema</DL></DD></DL><HR><A NAME="getFeatureSource(java.lang.String)"><!-- --></A><H3>getFeatureSource</H3><PRE>public <A HREF="../../../org/geotools/data/FeatureSource.html" title="interface in org.geotools.data">FeatureSource</A> <B>getFeatureSource</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> typeName) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>Default implementation based on getFeatureReader and getFeatureWriter. <p> We should be able to optimize this to only get the RowSet once </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/DataStore.html#getFeatureSource(java.lang.String)">getFeatureSource</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/DataStore.html" title="interface in org.geotools.data">DataStore</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>typeName</CODE> - <DT><B>Returns:</B><DD>FeatureSource (or subclass) providing opperations for typeName<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../org/geotools/data/DataStore.html#getFeatureSource(java.lang.String)"><CODE>DataStore.getFeatureSource(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="getFeatureReader(org.geotools.data.Query, org.geotools.data.Transaction)"><!-- --></A><H3>getFeatureReader</H3><PRE>public <A HREF="../../../org/geotools/data/FeatureReader.html" title="interface in org.geotools.data">FeatureReader</A> <B>getFeatureReader</B>(<A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A> query, <A HREF="../../../org/geotools/data/Transaction.html" title="interface in org.geotools.data">Transaction</A> transaction) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../org/geotools/data/DataStore.html" title="interface in org.geotools.data">DataStore</A></CODE></B></DD><DD>Access a FeatureReader providing access to Feature information. <p> <b>Filter</b> is used as a low-level indication of constraints. (Implementations may resort to using a FilteredFeatureReader, or provide their own optimizations) </p> <p> <b>FeatureType</b> provides a template for the returned FeatureReader </p> <ul> <li> featureType.getTypeName(): used by JDBC as the table reference to query against. Shapefile reader may need to store a lookup to the required filename. </li> <li> featureType.getAttributeTypes(): describes the requested content. This may be a subset of the complete FeatureType defined by the DataStore. </li> <li> getType.getNamespace(): describes the requested namespace for the results (may be different then the one used internally) </li> </ul> <p> <b>Transaction</b> to externalize DataStore state on a per Transaction basis. The most common example is a JDBC datastore saving a Connection for use across several FeatureReader requests. Similarly a Shapefile reader may wish to redirect FeatureReader requests to a alternate filename over the course of a Transaction. </p> <p> <b>Notes For Implementing DataStore</b> </p> <p> Subclasses may need to retrieve additional attributes, beyond those requested by featureType.getAttributeTypes(), in order to correctly apply the <code>filter</code>.<br> These Additional <b>attribtues</b> should be not be returned by FeatureReader. Subclasses may use ReTypeFeatureReader to aid in acomplishing this. </p> <p> Helper classes for implementing a FeatureReader (in order): </p> <ul> <li> DefaultFeatureReader - basic support for creating a FeatureReader for an AttributeReader </li> <li> FilteringFeatureReader - filtering support </li> <li> DiffFeatureReader - In-Process Transaction Support (see TransactionStateDiff) </li> <li> ReTypeFeatureReader - Feature Type schema manipulation of namesspace and attribute type subsets </li> <li> EmptyFeatureReader - provides no content for Filter.ALL optimizations </li> </ul> <p> Sample use (not optimized): </p> <pre><code> if (filter == Filter.ALL) { return new EmptyFeatureReader(featureType); } String typeName = featureType.getTypeName(); FeatureType schema = getSchema( typeName ); FeatureReader reader = new DefaultFeatureReader( getAttributeReaders(), schema ); if (filter != Filter.NONE) { reader = new FilteringFeatureReader(reader, filter); } if (transaction != Transaction.AUTO_COMMIT) { Map diff = state(transaction).diff(typeName); reader = new DiffFeatureReader(reader, diff); } if (!featureType.equals(reader.getFeatureType())) { reader = new ReTypeFeatureReader(reader, featureType); } return reader </code></pre> <p> Locking support does not need to be provided for FeatureReaders. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../org/geotools/data/DataStore.html#getFeatureReader(org.geotools.data.Query, org.geotools.data.Transaction)">getFeatureReader</A></CODE> in interface <CODE><A HREF="../../../org/geotools/data/DataStore.html" title="interface in org.geotools.data">DataStore</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>query</CODE> - Requested form of the returned Features and the filter used to constraints the results<DD><CODE>transaction</CODE> - Transaction this query opperates against<DT><B>Returns:</B><DD>FeatureReader Allows Sequential Processing of featureType<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL></DD></DL><HR><A NAME="getFeatureReader(java.lang.String, org.geotools.data.Query)"><!-- --></A><H3>getFeatureReader</H3><PRE>protected <A HREF="../../../org/geotools/data/FeatureReader.html" title="interface in org.geotools.data">FeatureReader</A> <B>getFeatureReader</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> typeName, <A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A> query) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD>GR: this method is called from inside getFeatureReader(Query ,Transaction ) to allow subclasses return an optimized FeatureReader wich supports the filter and attributes truncation specified in <code>query</code> <p> A subclass that supports the creation of such an optimized FeatureReader shold override this method. Otherwise, it just returns <code>getFeatureReader(typeName)</code> <p><P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE></DL></DD></DL><HR><A NAME="getUnsupportedFilter(java.lang.String, org.geotools.filter.Filter)"><!-- --></A><H3>getUnsupportedFilter</H3><PRE>protected <A HREF="../../../org/geotools/filter/Filter.html" title="interface in org.geotools.filter">Filter</A> <B>getUnsupportedFilter</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> typeName, <A HREF="../../../org/geotools/filter/Filter.html" title="interface in org.geotools.filter">Filter</A> filter)</PRE><DL><DD>GR: if a subclass supports filtering, it should override this method to return the unsupported part of the passed filter, so a FilteringFeatureReader will be constructed upon it. Otherwise it will just return the same filter. <p> If the complete filter is supported, the subclass must return <code>Filter.NONE</code> </p><P><DD><DL></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getFeatureWriter(java.lang.String, org.geotools.filter.Filter, org.geotools.data.Transaction)"><!-- --></A><H3>getFeatureWriter</H3><PRE>public <A HREF="../../../org/geotools/data/FeatureWriter.html" title="interface in org.geotools.data">FeatureWriter</A> <B>getFeatureWriter</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> typeName, <A HREF="../../../org/geotools/filter/Filter.html" title="interface in org.geotools.filter">Filter</A> filter, <A HREF="../../../org/geotools/data/Transaction.html" title="interface in org.geotools.data">Transaction</A> transaction) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../org/geotools/data/DataStore.html" title="interface in org.geotools.data">DataStore</A></CODE></B></DD><DD>Access FeatureWriter for modification of existing DataStore contents. <p> To limit FeatureWriter to the FeatureTypes defined by this DataStore, typeName is used to indicate FeatureType. The resulting feature writer will allow modifications against the same FeatureType provided by getSchema( typeName )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -