|
|||||||||||
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.ReprojectFeatureResults
ReprojectFeatureReader provides a reprojection for FeatureTypes.
ReprojectFeatureResults is a wrapper used to reproject GeometryAttributes to a user supplied CoordinateReferenceSystem from the original CoordinateReferenceSystem supplied by the original FeatureResults.
Example Use:
ReprojectFeatureResults results =
new ReprojectFeatureResults( originalResults, reprojectCS );
CoordinateReferenceSystem originalCS =
originalResults.getFeatureType().getDefaultGeometry().getCoordinateSystem();
CoordinateReferenceSystem newCS =
results.getFeatureType().getDefaultGeometry().getCoordinateSystem();
assertEquals( reprojectCS, newCS );
Nested Class Summary |
Nested classes inherited from class org.geotools.feature.Feature |
Feature.NULL |
Constructor Summary | |
ReprojectFeatureResults(FeatureResults results,
org.opengis.referencing.crs.CoordinateReferenceSystem destinationCS)
Creates a new reprojecting feature results |
Method Summary | |
FeatureCollection |
collection()
Convert this set of results to a FeatureCollection. |
com.vividsolutions.jts.geom.Envelope |
getBounds()
This method computes reprojected bounds the hard way, but computing them feature by feature. |
int |
getCount()
Returns the number of Features in this FeatureResults. |
FeatureResults |
getOrigin()
Returns the feature results wrapped by this reprojecting feature results |
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. |
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 ReprojectFeatureResults(FeatureResults results, org.opengis.referencing.crs.CoordinateReferenceSystem destinationCS) throws java.io.IOException, SchemaException, org.opengis.referencing.operation.TransformException, org.opengis.referencing.operation.OperationNotFoundException, java.util.NoSuchElementException, org.opengis.referencing.FactoryException
results
- destinationCS
-
java.io.IOException
SchemaException
org.opengis.referencing.operation.TransformException
org.opengis.referencing.FactoryException
java.util.NoSuchElementException
org.opengis.referencing.operation.OperationNotFoundException
CannotCreateTransformException
java.lang.NullPointerException
- DOCUMENT ME!
java.lang.IllegalArgumentException
Method Detail |
public FeatureType getSchema()
FeatureResults
Please 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 FeatureResults
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()
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 |