|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.geotools.renderer.lite.IndexedFeatureResults
IndexedFeatureReader
| Constructor Summary | |
IndexedFeatureResults(FeatureResults results)
|
|
| Method Summary | |
FeatureCollection |
collection()
Convert this set of results to a FeatureCollection. |
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 the contents of this collection. |
FeatureReader |
reader()
Provides access to the Features, please note that FeatureReader is a blocking api. |
FeatureReader |
reader(com.vividsolutions.jts.geom.Envelope envelope)
|
void |
setQueryBounds(com.vividsolutions.jts.geom.Envelope queryBounds)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public IndexedFeatureResults(FeatureResults results)
throws java.io.IOException,
IllegalAttributeException
| Method Detail |
public FeatureType getSchema()
throws java.io.IOException
FeatureResultsPlease note that for a collection with a mixed contents the FeatureType may be degenerate (ie very generic). For many applications (like shapefiles or tables) the FeatureType can safely be used to describe all the Features in the result set.
getSchema in interface FeatureResultsjava.io.IOException - if their is a problem getting the FeatureType.FeatureResults.getSchema()
public FeatureReader reader(com.vividsolutions.jts.geom.Envelope envelope)
throws java.io.IOException
java.io.IOExceptionFeatureResults.reader()public com.vividsolutions.jts.geom.Envelope getBounds()
FeatureResults
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;
}
getBounds in interface FeatureResultsFeatureResults.getBounds()
public int getCount()
throws java.io.IOException
FeatureResults
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;
}
getCount in interface FeatureResultsjava.io.IOException - If there are problems getting the countFeatureResults.getCount()
public FeatureCollection collection()
throws java.io.IOException
FeatureResultsThis 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;
}
collection in interface FeatureResultsjava.io.IOException - If any problems occur aquiring FeaturesFeatureResults.collection()
public FeatureReader reader()
throws java.io.IOException
FeatureResults
reader in interface FeatureResultsjava.io.IOException - DOCUMENT ME!FeatureResults.reader()public void setQueryBounds(com.vividsolutions.jts.geom.Envelope queryBounds)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||