Hi List,
I'm new using geotools and I have a problem obtaing a FeatureSource whith
Datastore method getFeatureSource.
I'm using PostGres 8.3.1 database with PostGIS extension 1.3.
I want to apply a bbox filter to a table of my database, here is my code
(works fine with Oracle Spatial):

*DataStore ds = DataStoreFinder.getDataStore(parameters);
try{

            FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2( null
);
            featureSource = ds.getFeatureSource(typeName); ///---> HERE
FAILS

            ReferencedEnvelope bbox = new ReferencedEnvelope( x1,y1, x2, y2,
crs );
            Filter filter = ff.bbox(geom,x1,y1, x2, y2, "EPSG:23030");

            DefaultQuery query = new DefaultQuery();
            query.setTypeName(typeName);
            query.setFilter(filter);

            FeatureCollection collection = featureSource.getFeatures(query);
            FeatureIterator iterator = collection.features();
}catch........*

The error is:

java.lang.NoSuchMethodError:
org.geotools.data.jdbc.JDBCFeatureSource$JDBCQueryCapabilities.<init>(Lorg/geotools/data/jdbc/JDBCFeatureSource;Lorg/opengis/feature/simple/SimpleFeatureType;)V

And here is my pom.xml:

.....
*        <dependency>
             <groupId>postgresql</groupId>
             <artifactId>postgresql</artifactId>
             <version>8.3-603.jdbc3</version>
        </dependency>
         <dependency>
           <groupId>org.geotools</groupId>
           <artifactId>gt-postgis</artifactId>
           <version>2.5.3</version>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-api</artifactId>
            <version>2.5.3</version>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-oracle-spatial</artifactId>
            <version>2.5-RC1</version>
        </dependency>*
....

Any idea where is the problem? This code works fine with oracle spatial, but
not using postgis.
Thanks!
------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to