|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Highlevel API for Features from a specific Query.
The can opperate as as a kind of Prepaired Query. It is a Query that knows enough information to be rerun. We may wish to rename this class as QueryResults.
Differences from FeatureCollection:
Ideas:
Method Summary | |
FeatureCollection |
collection()
Provides a stop-gap bridge to our existing Renderers. |
com.vividsolutions.jts.geom.Envelope |
getBounds()
Returns the bounding box of this FeatureResults. |
int |
getCount()
Returns the number of Features in this FeatureResults. |
FeatureType |
getSchema()
Returns the FeatureType of this FeatureResuls. |
FeatureReader |
reader()
Provides access to the Features, please note that FeatureReader is a blocking api. |
Method Detail |
public FeatureType getSchema() throws java.io.IOException
java.io.IOException
- if their is a problem getting the FeatureType.public FeatureReader reader() throws java.io.IOException
java.io.IOException
public com.vividsolutions.jts.geom.Envelope getBounds() throws java.io.IOException
This opperation may be expensive. Consider
FeatureSource.getBounds( Query )
as an alternative.
public Envelope getBounds() throws IOException {
Envelope newBBox = new Envelope();
Envelope internal;
Feature feature;
for (FeatureReader r = reader(); r.hasNext();) {
feature = r.next();
internal = feature.getDefaultGeometry().getEnvelopeInternal();
newBBox.expandToInclude(internal);
}
return newBBox;
}
java.io.IOException
public int getCount() throws java.io.IOException
This opperation may be expensive. Consider FeatureSource.getCount(
Query )
as an alternative.
public int getCount() throws IOException {
int count = 0;
for (FeatureReader r = reader(); r.hasNext(); count++) {
r.next();
}
return count;
}
java.io.IOException
- If there are problems getting the countpublic FeatureCollection collection() throws java.io.IOException
This method is logically the same as:
public FeatureCollection collection() throws IOException {
FeatureCollection collection = FeatureCollections.newCollection()
for (FeatureReader r = reader(); r.hasNext();) {
collection.add( r.next() );
}
return collection;
}
java.io.IOException
- If any problems occur aquiring Features
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |