📄 datastore.html
字号:
Retrieves a list of of the available FeatureTypes. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/geotools/data/FeatureSource.html" title="interface in org.geotools.data">FeatureSource</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/data/DataStore.html#getView(org.geotools.data.Query)">getView</A></B>(<A HREF="../../../org/geotools/data/Query.html" title="interface in org.geotools.data">Query</A> query)</CODE><BR> Access a FeatureSource for Query providing a high-level API. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/geotools/data/DataStore.html#updateSchema(java.lang.String, org.geotools.feature.FeatureType)">updateSchema</A></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/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A> featureType)</CODE><BR> Used to force namespace and CS info into a persistent change. </TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="createSchema(org.geotools.feature.FeatureType)"><!-- --></A><H3>createSchema</H3><PRE>public void <B>createSchema</B>(<A HREF="../../../org/geotools/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A> featureType) 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>Creates storage for a new <code>featureType</code>. <p> The provided <code>featureType</code> we be accessable by the typeName provided by featureType.getTypeName(). </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>featureType</CODE> - FetureType to add to DataStore<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 featureType cannot be created</DL></DD></DL><HR><A NAME="updateSchema(java.lang.String, org.geotools.feature.FeatureType)"><!-- --></A><H3>updateSchema</H3><PRE>public void <B>updateSchema</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/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A> featureType) 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>Used to force namespace and CS info into a persistent change. <p> The provided featureType should completely cover the existing schema. All attributes should be accounted for and the typeName should match. </p> <p> Suggestions: </p> <ul> <li>Sean - don't do this</li> <li>Jody - Just allow changes to metadata: CS, namespace, and others</li> <li>James - Allow change/addition of attribtues</li> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>typeName</CODE> - <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="getTypeNames()"><!-- --></A><H3>getTypeNames</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] <B>getTypeNames</B>() 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>Retrieves a list of of the available FeatureTypes. <p> This is simply a list of the FeatureType names as aquiring the actual FeatureType schemas may be expensive. </p> <p> Warning: this list may not be unique - the types may be in separate namespaces. </p> <p> If you need to worry about such things please consider the use of the Catalog and CatalogEntry interface - many DataStores support this. getTypeNames is really a convience method for a Catalog.iterator() where the name of each entry is returned. </p><P><DD><DL><DT><B>Returns:</B><DD>typeNames for available FeatureTypes.<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="getSchema(java.lang.String)"><!-- --></A><H3>getSchema</H3><PRE>public <A HREF="../../../org/geotools/feature/FeatureType.html" title="interface in org.geotools.feature">FeatureType</A> <B>getSchema</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>Retrieve FeatureType metadata by <code>typeName</code>. <p> Retrieves the Schema information as a FeatureType object. </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>typeName</CODE> - typeName of requested FeatureType<DT><B>Returns:</B><DD>FeatureType for the provided 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> - If typeName cannot be found</DL></DD></DL><HR><A NAME="getView(org.geotools.data.Query)"><!-- --></A><H3>getView</H3><PRE>public <A HREF="../../../org/geotools/data/FeatureSource.html" title="interface in org.geotools.data">FeatureSource</A> <B>getView</B>(<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>, <A HREF="../../../org/geotools/feature/SchemaException.html" title="class in org.geotools.feature">SchemaException</A></PRE><DL><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>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>Access a FeatureSource for typeName providing a high-level API. <p> The resulting FeatureSource may implment more functionality: </p> <pre><code> FeatureSource fsource = dataStore.getFeatureSource( "roads" ); FeatureStore fstore = null; if( fsource instanceof FeatureLocking ){ fstore = (FeatureStore) fs; } else { System.out.println("We do not have write access to roads"); } </code> </pre><P><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></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>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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -