subfeaturecollection.html

来自「Geotools是一个开源的Java GIS工具包,可利用它来开发符合标准的地理」· HTML 代码 · 共 1,160 行 · 第 1/5 页

HTML
1,160 行
字号
 </p> <p> GML 3.x: gml:AbstractFeatureCollectionType decends from gml:BoundedFeatureType: <ul> <li>metaDataProperty 0..* <li>description 0..1 <li>name 0..* <li>boundedBy 1..1 (required) <li>location 0..1 </ul> The value of the boundedBy attribute should be derived from the contents of the collection. </p> <h3>Implementation Notes</h3> <p> There is a difference between getFeatureType() and getSchema(), getSchema is named for historical reasons and reprensets the LCD FeatureType that best represents the contents of this collection. <ul> <li>The degenerate case returns the "_Feature" FeatureType, where the onlything known is that the contents are Features. <li>For a collection backed by a shapefiles (or database tables) the     FeatureType returned by getSchema() will complete describe each and every child in the collection. <li>For mixed content FeatureCollections you will need to check the FeatureType     of each Feature as it is retrived from the collection </ul> </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/feature/FeatureCollection.html#getFeatureType()">getFeatureType</A></CODE> in interface <CODE><A HREF="../../../../org/geotools/feature/FeatureCollection.html" title="interface in org.geotools.feature">FeatureCollection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>A reference to this collections type</DL></DD></DL><HR><A NAME="features()"><!-- --></A><H3>features</H3><PRE>public <A HREF="../../../../org/geotools/feature/FeatureIterator.html" title="interface in org.geotools.feature">FeatureIterator</A> <B>features</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/geotools/feature/FeatureCollection.html" title="interface in org.geotools.feature">FeatureCollection</A></CODE></B></DD><DD>Obtain a FeatureIterator of the Features within this collection. <p> The implementation of Collection must adhere to the rules of fail-fast concurrent modification. In addition (to allow for resource backed collections, the <code>close( Iterator )</code> method must be called. <p> This is almost equivalent to: <ul> <li>a Type-Safe call to: <code>getAttribute(getFeatureType().getAttributeType(0).getName()).iterator();</code>. <li>A Java 5:<code>Iterator&lt;Feature&gt;</code> </ul> </p> Example (safe) use:<pre><code> FeatureIterator iterator=collection.features(); try {     while( iterator.hasNext()  ){          Feature feature = iterator.next();          System.out.println( feature.getID() );     } } finally {     collection.close( iterator ); } </code></pre> </p> <p> GML Note: The contents of this iterator are considered to be defined by <b>featureMember</b> tags (and/or the single allowed <b>FeatureMembers</b> tag). Please see getFeatureType for more details. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/feature/FeatureCollection.html#features()">features</A></CODE> in interface <CODE><A HREF="../../../../org/geotools/feature/FeatureCollection.html" title="interface in org.geotools.feature">FeatureCollection</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>A FeatureIterator.</DL></DD></DL><HR><A NAME="closeIterator(java.util.Iterator)"><!-- --></A><H3>closeIterator</H3><PRE>public void <B>closeIterator</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A>&nbsp;iterator)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../../org/geotools/feature/collection/AbstractResourceCollection.html" title="class in org.geotools.feature.collection">AbstractResourceCollection</A></CODE></B></DD><DD>Please override to cleanup after your own iterators, and any used resources. <p> As an example if the iterator was working off a File then the inputstream should be closed. </p> <p> Subclass must call super.close( close ) to allow the list of open iterators to be adjusted. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/feature/collection/AbstractResourceCollection.html#closeIterator(java.util.Iterator)">closeIterator</A></CODE> in class <CODE><A HREF="../../../../org/geotools/feature/collection/AbstractResourceCollection.html" title="class in org.geotools.feature.collection">AbstractResourceCollection</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>iterator</CODE> - Iterator, will not be <code>null</code></DL></DD></DL><HR><A NAME="close(org.geotools.feature.FeatureIterator)"><!-- --></A><H3>close</H3><PRE>public void <B>close</B>(<A HREF="../../../../org/geotools/feature/FeatureIterator.html" title="interface in org.geotools.feature">FeatureIterator</A>&nbsp;close)</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/geotools/feature/FeatureCollection.html" title="interface in org.geotools.feature">FeatureCollection</A></CODE></B></DD><DD>Clean up any resources assocaited with this iterator in a manner similar to JDO collections. <p> You must be sure to allow null values, this is because in a try/finally block client code may not be sure if they have actualy succeed in assign a value to an iterator they wish to ensure is closed. By permiting null as an api we prevent a null check in lots of finally statements. </p> <p> Note: Because of FeatureReader using an interator internally, there is only one implementation of this method that makes any sense:<pre><code> <b>public void</b> close( FeatureIterator iterator) {     <b>if</b>( iterator != null ) iterator.close(); } </code></pre> </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/feature/FeatureCollection.html#close(org.geotools.feature.FeatureIterator)">close</A></CODE> in interface <CODE><A HREF="../../../../org/geotools/feature/FeatureCollection.html" title="interface in org.geotools.feature">FeatureCollection</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="getID()"><!-- --></A><H3>getID</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>getID</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></B></DD><DD>Gets the unique feature ID for this feature.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/feature/Feature.html#getID()">getID</A></CODE> in interface <CODE><A HREF="../../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>Unique identifier for this feature.</DL></DD></DL><HR><A NAME="getBounds()"><!-- --></A><H3>getBounds</H3><PRE>public <A HREF="http://www.jump-project.org/docs/jts/1.7/api/com/vividsolutions/jts/geom/Envelope.html" title="class or interface in com.vividsolutions.jts.geom">Envelope</A> <B>getBounds</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/geotools/data/FeatureResults.html" title="interface in org.geotools.data">FeatureResults</A></CODE></B></DD><DD>Returns the bounding box of this FeatureResults. <p> This opperation may be expensive. Consider <code>FeatureSource.getBounds( Query )</code> as an alternative. </p> This method is logically the same as: <pre> <code> <b>public</b> Envelope getBounds() <b>throws</b> IOException {     Envelope newBBox = <b>new</b> Envelope();     Envelope internal;     Feature feature;     <b>for</b> (FeatureReader r = reader(); r.hasNext();) {         feature = r.next();         internal = feature.getDefaultGeometry().getEnvelopeInternal();         newBBox.expandToInclude(internal);     }     <b>return</b> newBBox; } </code> </pre><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/data/FeatureResults.html#getBounds()">getBounds</A></CODE> in interface <CODE><A HREF="../../../../org/geotools/data/FeatureResults.html" title="interface in org.geotools.data">FeatureResults</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>Bounding box of this FeatureResults, or an empty Envelope</DL></DD></DL><HR><A NAME="getDefaultGeometry()"><!-- --></A><H3>getDefaultGeometry</H3><PRE>public <A HREF="http://www.jump-project.org/docs/jts/1.7/api/com/vividsolutions/jts/geom/Geometry.html" title="class or interface in com.vividsolutions.jts.geom">Geometry</A> <B>getDefaultGeometry</B>()</PRE><DL><DD><B>Description copied from interface: <CODE><A HREF="../../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></B></DD><DD>Gets the default geometry for this feature. <p> This method will return <code>null</code> if no DefaultGeometry has been defined by the schema. </p><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../../org/geotools/feature/Feature.html#getDefaultGeometry()">getDefaultGeometry</A></CODE> in interface <CODE><A HREF="../../../../org/geotools/feature/Feature.html" title="interface in org.geotools.feature">Feature</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>Default geometry for this feature, or <code>null</code></DL></DD></DL><HR><A NAME="setDefaultGeometry(com.vividsolutions.jts.geom.Geometry)"><!-- --></A><H3>setDefaultGeometry</H3><PRE>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?