|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.data.store.DataFeatureCollection org.geotools.data.crs.ForceCoordinateSystemFeatureResults
ForceCoordinateSystemFeatureResults provides a CoordinateReferenceSystem for FeatureTypes.
ForceCoordinateSystemFeatureReader is a wrapper used to force GeometryAttributes to a user supplied CoordinateReferenceSystem rather then the default supplied by the DataStore.
Example Use:
ForceCoordinateSystemFeatureResults results =
new ForceCoordinateSystemFeatureResults( originalResults, forceCS );
CoordinateReferenceSystem originalCS =
originalResults.getFeatureType().getDefaultGeometry().getCoordinateSystem();
CoordinateReferenceSystem newCS =
reader.getFeatureType().getDefaultGeometry().getCoordinateSystem();
assertEquals( forceCS, newCS );
Nested Class Summary |
Nested classes inherited from class org.geotools.feature.Feature |
Feature.NULL |
Constructor Summary | |
ForceCoordinateSystemFeatureResults(FeatureResults results,
org.opengis.referencing.crs.CoordinateReferenceSystem forcedCS)
|
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. |
FeatureResults |
getOrigin()
Returns the feature results wrapped by this ForceCoordinateSystemFeatureResults |
FeatureType |
getSchema()
The schema for the child features of this collection. |
FeatureReader |
reader()
Provides access to the Features, please note that FeatureReader is a blocking api. |
Methods inherited from class org.geotools.data.store.DataFeatureCollection |
accepts, add, addAll, addListener, clear, close, close, closeIterator, contains, containsAll, features, fireChange, fireChange, fireChange, getAttribute, getAttribute, getAttributes, getDefaultGeometry, getFeatureType, getID, getNumberOfAttributes, getParent, isEmpty, iterator, openIteartor, purge, remove, removeAll, removeListener, retainAll, setAttribute, setAttribute, setDefaultGeometry, setParent, size, sort, sort, subCollection, toArray, toArray, writer |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Collection |
equals, hashCode |
Constructor Detail |
public ForceCoordinateSystemFeatureResults(FeatureResults results, org.opengis.referencing.crs.CoordinateReferenceSystem forcedCS) throws java.io.IOException, SchemaException
Method Detail |
public FeatureType getSchema()
FeatureCollection
There is a difference between getFeatureType() and getSchema()represents the LCD FeatureType that best represents the contents of this collection.
The method getSchema() is named for compatability with the geotools 2.0 API. In the Geotools 2.2 time frame we should be able to replace this method with a careful check of getFeatureType() and its attributes.
getSchema
in interface FeatureCollection
getSchema
in class DataFeatureCollection
FeatureResults.getSchema()
public FeatureReader reader() throws java.io.IOException
FeatureResults
reader
in interface FeatureResults
reader
in class DataFeatureCollection
java.io.IOException
FeatureResults.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 FeatureResults
getBounds
in class DataFeatureCollection
FeatureResults.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 FeatureResults
getCount
in class DataFeatureCollection
java.io.IOException
FeatureResults.getCount()
public FeatureCollection collection() throws java.io.IOException
FeatureResults
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;
}
collection
in interface FeatureResults
collection
in class DataFeatureCollection
java.io.IOException
FeatureResults.collection()
public FeatureResults getOrigin()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |