Java Doc for Query.java in  » GIS » GeoTools-2.4.1 » org » geotools » data » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » GeoTools 2.4.1 » org.geotools.data 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.geotools.data.Query

All known Subclasses:   org.geotools.data.FIDSQuery,  org.geotools.data.ALLQuery,  org.geotools.data.DefaultQuery,
Query
public interface Query (Code)
Encapsulates a data request.

The query object is used by the FeatureSource.getFeatures(Query) to encapsulate a request. For this use it the FeatureSource.getSchema().getTypeName() should match the one provided by the Query, or the Query should not provide one.

Suggested Extensions (Jody):

  • Transient CoordianteSystem override done getCoordianteSystem()
  • Transient Geometry reproject to an alternate CoordinateSystem - done getCoordinateSystemReproject()
  • Consider Namespace, FeatueType name override - not done considered evil
  • DataStore.getFeatureReader( Query, Transaction )
  • DataStore.getView( Query ) - prototype in AbstractDataStore (not really ready for primetime, see Expr)

author:
   Chris Holmes
version:
   $Id: Query.java 26489 2007-08-08 15:36:02Z aaime $


Field Summary
final  QueryALL
     Implements a query that will fetch all features from a datasource.
final  String[]ALL_NAMES
     Ask for all properties when used with setPropertyNames.
final static  intDEFAULT_MAX
     So getMaxFeatures does not return null we use a very large number.
final  QueryFIDS
     Implements a query that will fetch all the FeatureIDs from a datasource.
final  String[]NO_NAMES
     Ask for no properties when used with setPropertyNames.
final static  URINO_NAMESPACE
    


Method Summary
 CoordinateReferenceSystemgetCoordinateSystem()
     Specifies the coordinate system that the features being queried are in.

This denotes a request to Temporarily to override the coordinate system contained in the FeatureSource being queried.

 CoordinateReferenceSystemgetCoordinateSystemReproject()
     Request data reprojection.
 FiltergetFilter()
     The Filter can be used to define constraints on a query.
 StringgetHandle()
     The handle attribute is included to allow a client to associate a mnemonic name to the Query request.
 HintsgetHints()
     Specifies some hints to drive the query execution and results build-up.
 intgetMaxFeatures()
     The optional maxFeatures can be used to limit the number of features that a query request retrieves.
 URIgetNamespace()
     The namespace attribute is used to indicate the namespace of the schema being represented.
 String[]getPropertyNames()
     The properties array is used to specify the attributes that should be selected for the return feature collection.
  • ALL_NAMES: null
    If no properties are specified (getProperties returns ALL_NAMES or null) then the full schema should be used (all attributes).
  • NO_NAMES: new String[0]
    If getProperties returns an array of size 0, then the datasource should return features with no attributes, only their ids.

The available properties can be determined with a getSchema call from the DataSource interface.

 SortBy[]getSortBy()
     SortBy results according to indicated property and order.

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.

The SortBy's are ment to be applied in order:
  • SortBy( year, ascending )
  • SortBy( month, decsending )
Would produce something like:

 [year=2002 month=4],[year=2002 month=3],[year=2002 month=2],
 [year=2002 month=1],[year=2003 month=12],[year=2002 month=4],
 

SortBy should be considered at the same level of abstraction as Filter, and like Filter you may sort using properties not listed in getPropertyNames.

At a technical level the interface SortBy2 is used to indicate the additional requirements of a GeoTools implementation.

 StringgetTypeName()
     The typeName attribute is used to indicate the name of the feature type to be queried.
 StringgetVersion()
     From WFS Spec: The version attribute is included in order to accommodate systems that support feature versioning.
 booleanretrieveAllProperties()
     Convenience method to determine if the query should use the full schema (all properties) of the data source for the features returned.

Field Detail
ALL
final Query ALL(Code)
Implements a query that will fetch all features from a datasource. This query should retrieve all properties, with no maxFeatures, no filtering, and the default featureType.



ALL_NAMES
final String[] ALL_NAMES(Code)
Ask for all properties when used with setPropertyNames.



DEFAULT_MAX
final static int DEFAULT_MAX(Code)
So getMaxFeatures does not return null we use a very large number.



FIDS
final Query FIDS(Code)
Implements a query that will fetch all the FeatureIDs from a datasource. This query should retrive no properties, with no maxFeatures, no filtering, and the a featureType with no attribtues.



NO_NAMES
final String[] NO_NAMES(Code)
Ask for no properties when used with setPropertyNames.

Note the query will still return a result - limited to FeatureIDs.




NO_NAMESPACE
final static URI NO_NAMESPACE(Code)
TODO: should this be ANY_URI





Method Detail
getCoordinateSystem
CoordinateReferenceSystem getCoordinateSystem()(Code)
Specifies the coordinate system that the features being queried are in.

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.

This change is not persistant at all, indeed it is only for the Features returned by this Query. If used in conjunction with Query.getCoordinateSystemReproject() the reprojection will occur from Query.getCoordinateSystem() to Query.getCoordinateSystemReproject() .

The coordinate system to be returned for Features from thisQuery (override the set coordinate system).



getCoordinateSystemReproject
CoordinateReferenceSystem getCoordinateSystemReproject()(Code)
Request data reprojection.

Gets the coordinate System to reproject the data contained in the backend datastore to.

If the DataStore can optimize the reprojection it should, if not then a decorator on the reader should perform the reprojection on the fly.

If the datastore has the wrong CS then Query.getCoordinateSystem() should be set to the CS to be used, this will perform the reprojection on that.

The coordinate system that Features from the datasource shouldbe reprojected to.



getFilter
Filter getFilter()(Code)
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. The filter that defines constraints on the query.



getHandle
String getHandle()(Code)
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. the mnemonic name of the query request.



getHints
Hints getHints()(Code)
Specifies some hints to drive the query execution and results build-up. Hints examples can be the GeometryFactory to be used, a generalization distance to be applied right in the data store, to data store specific things such as the fetch size to be used in JDBC queries. The set of hints supported can be fetched by calling . Depending on the actual values of the hints, the data store is free to ignore them. No mechanism is in place, at the moment, to figure out which hints where actually used during the query execution. the Hints the data store should try to use when executing the query(eventually empty but never null).



getMaxFeatures
int getMaxFeatures()(Code)
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.

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.

the max features the getFeature call should return.



getNamespace
URI getNamespace()(Code)
The namespace attribute is used to indicate the namespace of the schema being represented. the gml namespace of the feature type to be returned with thisquery



getPropertyNames
String[] getPropertyNames()(Code)
The properties array is used to specify the attributes that should be selected for the return feature collection.
  • ALL_NAMES: null
    If no properties are specified (getProperties returns ALL_NAMES or null) then the full schema should be used (all attributes).
  • NO_NAMES: new String[0]
    If getProperties returns an array of size 0, then the datasource should return features with no attributes, only their ids.

The available properties can be determined with a getSchema call from the DataSource interface. A datasource can use Query.retrieveAllProperties() 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)

If properties that are not part of the datasource's schema are requested then the datasource shall throw an exception.

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.

the attributes to be used in the returned FeatureCollection.



getSortBy
SortBy[] getSortBy()(Code)
SortBy results according to indicated property and order.

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.

The SortBy's are ment to be applied in order:
  • SortBy( year, ascending )
  • SortBy( month, decsending )
Would produce something like:

 [year=2002 month=4],[year=2002 month=3],[year=2002 month=2],
 [year=2002 month=1],[year=2003 month=12],[year=2002 month=4],
 

SortBy should be considered at the same level of abstraction as Filter, and like Filter you may sort using properties not listed in getPropertyNames.

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.

SortBy array or order of application



getTypeName
String getTypeName()(Code)
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. the name of the feature type to be returned with this query.



getVersion
String getVersion()(Code)
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. the version of the feature to return, or null for latest.



retrieveAllProperties
boolean retrieveAllProperties()(Code)
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. if all datasource attributes should be included in the schema ofthe returned FeatureCollection.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.