org.geotools.data.package.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gt-main Show documentation
Show all versions of gt-main Show documentation
The main module contains the GeoTools public interfaces that are used by
other GeoTools modules (and GeoTools applications). Where possible we make
use industry standard terms as provided by OGC and ISO standards.
The formal GeoTools public api consists of gt-metadata, jts and the gt-main module.
The main module contains the default implementations that are available provided
to other GeoTools modules using our factory system. Factories are obtained from
an appropriate FactoryFinder, giving applications a chance configure the factory
used using the Factory Hints facilities.
FilterFactory ff = CommonFactoryFinder.getFilterFactory();
Expression expr = ff.add( expression1, expression2 );
If you find yourself using implementation specific classes chances are you doing it wrong:
Expression expr = new AddImpl( expression1, expressiom2 );
Defines the DataStoreAPI via which all data is imported or exported.
All DataStores (e.g. PostGIS, Shapefile(tm), GML...) must provide
implementations of the DataStore interface and the DataStoreFactorySpi
interface. These interfaces allow new types of datastore to be plugged into
applications which use geotools without the need to modify any code.
Example:
FeatureStore postgis = new PostGisDataStore( ... );
Query all = Query.ALL;
FeatureType roadType = postgis.getFeatureType( "roads" );
// reader 1 streams over all roads
FeatureReader reader1 = postgis.getFeatureReader( roadsType, all, Transaction.AUTO_COMMIT );
// allRoads = featureResults is a prepaired query of all roads
FeatureSource roads = postgis.getFeatureSource( "roads" );
FeatureResults allRoads = roads.getFeatures( all );
// reader 2 & 3 streams over all roads in the same manner as reader 1
FeatureReader reader2 = allRoads.reader();
FeatureReader reader3 = allRoads.reader();
// bounds1 returns the bounding box of roads, may be null depending on expense
Envelope bounds1 = roads.getBounds( all );
// bounds2 returns the bounding box of roads, may actually calculate by going over the entire dataset
Envelope bounds 2 = allRoads.getBounds();
© 2015 - 2025 Weber Informatics LLC | Privacy Policy