hello,

in previous releases of geotools I could use FeatureReader from a postgis
DataSource and extract Features and get the default geometry from those
feature objects.

Now the FeatureReader uses the opengis Feature and I have no clue how I can
extract Geometries from those features..anyone have any examples on how I
can do this in geotools 2.5.5 ?

Here's the relevant code:


org.opengis.filter.Filter filter = null;
FeatureReader fr = null;
Transaction transaction = null;
String[] columns = new String[]
{
   "the_geom", "mtfcc",
   "fullname"
};
            filter = CQL.toFilter("mtfcc='S1100' and fullname like 'I%-%'");
            DefaultQuery q = new DefaultQuery("roads", filter, columns);
            transaction = new DefaultTransaction();
            fr = ds.getFeatureReader(q, transaction);
            while (fr.hasNext())
            {
                Feature f = fr.next();
                //HOW TO GET A GEOMETRY OUT OF THIS FEATURE??? No more
methods "getDefaultGeometry()"
            }
            fr.close();
           .....


Thanks

Alessandro Ferrucci
-- 
Signed,
Alessandro Ferrucci
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geotools-gt2-users mailing list
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to