📄 query.html
字号:
<P><DL></DL></DL><HR><A NAME="NO_NAMES"><!-- --></A><H3>NO_NAMES</H3><PRE>public static final <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>NO_NAMES</B></PRE><DL><DD>Ask for no properties when used with setPropertyNames. <p> Note the query will still return a result - limited to FeatureIDs. </p><P><DL></DL></DL><HR><A NAME="ALL_NAMES"><!-- --></A><H3>ALL_NAMES</H3><PRE>public static final <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>ALL_NAMES</B></PRE><DL><DD>Ask for all properties when used with setPropertyNames.<P><DL></DL></DL><!-- ========= 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="getPropertyNames()"><!-- --></A><H3>getPropertyNames</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>getPropertyNames</B>()</PRE><DL><DD>The properties array is used to specify the attributes that should be selected for the return feature collection. <ul> <li> ALL_NAMES: <code>null</code><br> If no properties are specified (getProperties returns ALL_NAMES or null) then the full schema should be used (all attributes). </li> <li> NO_NAMES: <code>new String[0]</code><br> If getProperties returns an array of size 0, then the datasource should return features with no attributes, only their ids. </li> </ul> <p> The available properties can be determined with a getSchema call from the DataSource interface. A datasource can use <A HREF="../../../org/geotools/data/Query.html#retrieveAllProperties()"><CODE>retrieveAllProperties()</CODE></A> as a shortcut to determine if all its available properties should be returned (same as checking to see if getProperties is ALL_NAMES, but clearer) </p> <p> If properties that are not part of the datasource's schema are requested then the datasource shall throw an exception. </p> <p> This replaces our funky setSchema method of retrieving select properties. It makes it easier to understand how to get certain properties out of the datasource, instead of having users get the schema and then compose a new schema using the attributes that they want. The old way had problems because one couldn't have multiple object reuse the same datasource object, since some other object could come along and change its schema, and would then return the wrong properties. </p><P><DD><DL><DT><B>Returns:</B><DD>the attributes to be used in the returned FeatureCollection.<DT><B>'TODO:'</B></DT> <DD>REVISIT: make a FidProperties object, instead of an array size 0. I think Query.FIDS fills this role to some degree. Query.FIDS.equals( filter ) would meet this need?</DD></DL></DD></DL><HR><A NAME="retrieveAllProperties()"><!-- --></A><H3>retrieveAllProperties</H3><PRE>public boolean <B>retrieveAllProperties</B>()</PRE><DL><DD>Convenience method to determine if the query should use the full schema (all properties) of the data source for the features returned. This method is equivalent to if (query.getProperties() == null), but allows for more clarity on the part of datasource implementors, so they do not need to examine and use null values. All Query implementations should return true for this function if getProperties returns null.<P><DD><DL><DT><B>Returns:</B><DD>if all datasource attributes should be included in the schema of the returned FeatureCollection.</DL></DD></DL><HR><A NAME="getMaxFeatures()"><!-- --></A><H3>getMaxFeatures</H3><PRE>public int <B>getMaxFeatures</B>()</PRE><DL><DD>The optional maxFeatures can be used to limit the number of features that a query request retrieves. If no maxFeatures is specified then all features should be returned. <p> This is the only method that is not directly out of the Query element in the WFS spec. It is instead a part of a GetFeature request, which can hold one or more queries. But each of those in turn will need a maxFeatures, so it is needed here. </p><P><DD><DL><DT><B>Returns:</B><DD>the max features the getFeature call should return.</DL></DD></DL><HR><A NAME="getFilter()"><!-- --></A><H3>getFilter</H3><PRE>public <A HREF="../../../org/geotools/filter/Filter.html" title="interface in org.geotools.filter">Filter</A> <B>getFilter</B>()</PRE><DL><DD>The Filter can be used to define constraints on a query. If no Filter is present then the query is unconstrained and all feature instances should be retrieved.<P><DD><DL><DT><B>Returns:</B><DD>The filter that defines constraints on the query.</DL></DD></DL><HR><A NAME="getTypeName()"><!-- --></A><H3>getTypeName</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>getTypeName</B>()</PRE><DL><DD>The typeName attribute is used to indicate the name of the feature type to be queried. If no typename is specified, then the default typeName should be returned from the dataStore. If the datasstore only supports one feature type then this part of the query may be ignored.<P><DD><DL><DT><B>Returns:</B><DD>the name of the feature type to be returned with this query.</DL></DD></DL><HR><A NAME="getNamespace()"><!-- --></A><H3>getNamespace</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/net/URI.html" title="class or interface in java.net">URI</A> <B>getNamespace</B>()</PRE><DL><DD>The namespace attribute is used to indicate the namespace of the schema being represented.<P><DD><DL><DT><B>Returns:</B><DD>the gml namespace of the feature type to be returned with this query</DL></DD></DL><HR><A NAME="getHandle()"><!-- --></A><H3>getHandle</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>getHandle</B>()</PRE><DL><DD>The handle attribute is included to allow a client to associate a mnemonic name to the Query request. The purpose of the handle attribute is to provide an error handling mechanism for locating a statement that might fail.<P><DD><DL><DT><B>Returns:</B><DD>the mnemonic name of the query request.</DL></DD></DL><HR><A NAME="getVersion()"><!-- --></A><H3>getVersion</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>getVersion</B>()</PRE><DL><DD>From WFS Spec: The version attribute is included in order to accommodate systems that support feature versioning. A value of ALL indicates that all versions of a feature should be fetched. Otherwise an integer, n, can be specified to return the n th version of a feature. The version numbers start at '1' which is the oldest version. If a version value larger than the largest version is specified then the latest version is return. The default action shall be for the query to return the latest version. Systems that do not support versioning can ignore the parameter and return the only version that they have.<P><DD><DL><DT><B>Returns:</B><DD>the version of the feature to return, or null for latest.</DL></DD></DL><HR><A NAME="getCoordinateSystem()"><!-- --></A><H3>getCoordinateSystem</H3><PRE>public CoordinateReferenceSystem <B>getCoordinateSystem</B>()</PRE><DL><DD>Temporarily override the coordinate system. <p> This denotes a request to Temporarily to override the coordinate system contained in the FeatureSource being queried. The same coordinate values will be used, but the features created will appear in this Coordinate System. </p> <p> This change is not persistant at all, indeed it is only for the Features returned by this Query. It may be used in conjunction with the reprojection Coordinate System, but this one will always be used first, the reprojection CS will perform its operation on this cs. </p><P><DD><DL><DT><B>Returns:</B><DD>The coordinate system to be returned for Features from this Query (override the set coordinate system).</DL></DD></DL><HR><A NAME="getCoordinateSystemReproject()"><!-- --></A><H3>getCoordinateSystemReproject</H3><PRE>public CoordinateReferenceSystem <B>getCoordinateSystemReproject</B>()</PRE><DL><DD>Request data reprojection. <p> Gets the coordinate System to reproject the data contained in the backend datastore to. </p> <p> If the DataStore can optimize the reprojection it should, if not then a decorator on the reader should perform the reprojection on the fly. </p> <p> If the datastore has the wrong CS then getOverrideCS() should be set to the CS to be used, this will perform the reprojection on that. </p><P><DD><DL><DT><B>Returns:</B><DD>The coordinate system that Features from the datasource should be reprojected to.</DL></DD></DL><HR><A NAME="getSortBy()"><!-- --></A><H3>getSortBy</H3><PRE>public SortBy[] <B>getSortBy</B>()</PRE><DL><DD>SortBy results according to indicated property and order. <p> SortBy is part of the Filter 1.1 specification, it is referenced by WFS1.1 and Catalog 2.0.x specifications and is used to organize results. </p> The SortBy's are ment to be applied in order: <ul> <li>SortBy( year, ascending ) <li>SortBy( month, decsending ) </ul> Would produce something like: <pre><code> [year=2002 month=4],[year=2002 month=3],[year=2002 month=2], [year=2002 month=1],[year=2003 month=12],[year=2002 month=4], </code></pre> </p> <p> SortBy should be considered at the same level of abstraction as Filter, and like Filter you may sort using properties not listed in getPropertyNames. </p> <p> At a technical level the interface SortBy2 is used to indicate the additional requirements of a GeoTools implementation. The pure WFS 1.1 specification itself is limited to SortBy. </p><P><DD><DL><DT><B>Returns:</B><DD>SortBy array or order of application</DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Query.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/geotools/data/LockingManager.html" title="interface in org.geotools.data"><B>PREV CLASS</B></A> <A HREF="../../../org/geotools/data/Repository.html" title="interface in org.geotools.data"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="Query.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR>Copyright © 1996-2007 <a href="http://www.geotools.org">Geotools</a>. All Rights Reserved.</BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -