📄 arcsdedatastore.html
字号:
<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> - DOCUMENT ME!<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - DOCUMENT ME!<DD><CODE><A HREF="../../../../org/geotools/data/DataSourceException.html" title="class in org.geotools.data">DataSourceException</A></CODE> - DOCUMENT ME!</DL></DD></DL><HR><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> schema) 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="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../../org/geotools/data/AbstractDataStore.html" title="class in org.geotools.data">AbstractDataStore</A></CODE></B></DD><DD>Subclass should implement to provide writing support.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/data/DataStore.html#createSchema(org.geotools.feature.FeatureType)">createSchema</A></CODE> in interface <CODE><A HREF="../../../../org/geotools/data/DataStore.html" title="interface in org.geotools.data">DataStore</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/geotools/data/AbstractDataStore.html#createSchema(org.geotools.feature.FeatureType)">createSchema</A></CODE> in class <CODE><A HREF="../../../../org/geotools/data/AbstractDataStore.html" title="class in org.geotools.data">AbstractDataStore</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>schema</CODE> - Requested 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> - Subclass may throw IOException<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE></DL></DD></DL><HR><A NAME="createSchema(org.geotools.feature.FeatureType, java.lang.String)"><!-- --></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, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> configKeyword) 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="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></PRE><DL><DD>Creates the given featuretype in the underlying ArcSDE database. <p> The common use case to create an ArcSDE layer is to setup the SeTable object with all the non-geometry attributes first, then create the SeLayer and set the geometry column name and its properties. This approach brings a nice problem, since we need to create the attributes in exactly the same order as specified in the passed FeatureType, which means that the geometry attribute needs not to be the last one. </p> <p> To avoid this, the following workaround is performed: instead of creating the schema as described above, we will first create the SeTable with a single, temporary column, since it is not possible to create a table without columns. The, we will iterate over the AttributeTypes and add them as they appear using <code>SeTable.addColumn(SeColumnDefinition)</code>. But if we found that the current AttributeType is geometric, instead of adding the column we just create the SeLayer object. This way, the geometric attribute is inserted at the end, and then we keep iterating and adding the rest of the columns. Finally, the first column is removed, since it was temporal (note that I advertise it, it is a _workaround_). </p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>featureType</CODE> - the feature type containing the name, attributes and coordinate reference system of the new ArcSDE layer.<DD><CODE>configKeyword</CODE> - the ArcSDE configuration keyword to use. If left null, the "DEFAULTS" keyword will be used.<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> - see <code>throws DataSourceException</code> bellow<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalArgumentException.html" title="class or interface in java.lang">IllegalArgumentException</A></CODE> - if the passed feature type does not contains at least one geometric attribute, or if the type name contains '.' (dots).<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/NullPointerException.html" title="class or interface in java.lang">NullPointerException</A></CODE> - if <code>featureType</code> is <code>null</code><DD><CODE><A HREF="../../../../org/geotools/data/DataSourceException.html" title="class in org.geotools.data">DataSourceException</A></CODE> - if there is <b>not an available (free) connection </b> to the ArcSDE instance(in that case maybe you need to increase the maximun number of connections for the connection pool), or an SeException exception is catched while creating the feature type at the ArcSDE instance (e.g. a table with that name already exists).</DL></DD></DL><HR><A NAME="getFeatureReader(java.lang.String)"><!-- --></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) 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>DOCUMENT ME!<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/data/AbstractDataStore.html#getFeatureReader(java.lang.String)">getFeatureReader</A></CODE> in class <CODE><A HREF="../../../../org/geotools/data/AbstractDataStore.html" title="class in org.geotools.data">AbstractDataStore</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>typeName</CODE> - DOCUMENT ME!<DT><B>Returns:</B><DD>DOCUMENT ME!<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> - DOCUMENT ME!</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></p><P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../../org/geotools/data/AbstractDataStore.html#getFeatureReader(java.lang.String, org.geotools.data.Query)">getFeatureReader</A></CODE> in class <CODE><A HREF="../../../../org/geotools/data/AbstractDataStore.html" title="class in org.geotools.data">AbstractDataStore</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>typeName</CODE> - DOCUMENT ME!<DD><CODE>query</CODE> - DOCUMENT ME!<DT><B>Returns:</B><DD>DOCUMENT ME!<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> - DOCUMENT ME!<DD><CODE><A HREF="../../../../org/geotools/data/DataSourceException.html" title="class in org.geotools.data">DataSourceException</A></CODE> - DOCUMENT ME!</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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -