No, I think the ClassCastException indicates that Suneesh does not have 
a Geometry.

On 05/10/09 16:15, Jody Garnett wrote:
> You found a geometry Suneesh - GeoTools uses the JTS Geometry class.
>
> Jody
>
>
> On Mon, Oct 5, 2009 at 6:54 PM, suneesh 
> kumar<[email protected]<mailto:[email protected]>>  wrote:
> Hello,
>
> I am trying to extract geometry of feature by iterating  FeatureCollection.
>
> My code is this :
> feature.getDefaultGeometryProperty().getValue()
>
> But it is giving the following error :
>
> java.lang.ClassCastException: org.geotools.feature.DefaultFeature$1 cannot be 
> cast to com.vividsolutions.jts.geom.Geometry
>          at 
> org.geotools.feature.DefaultFeature.getDefaultGeometry(DefaultFeature.java:365)
>          at 
> org.geotools.feature.DefaultFeature.getDefaultGeometry(DefaultFeature.java:67)
>          at 
> org.geotools.feature.simple.SimpleFeatureImpl.getDefaultGeometryProperty(SimpleFeatureImpl.java:240)
>
>
> How can I etract geometry from a feature collection? I am using the 
> Geotools2.6
>
> Thanks in advance.
> Sunish.
>
>
>
> ________________________________
> Keep up with people you care about with Yahoo! India Mail. Learn 
> how<http://in.rd.yahoo.com/tagline_galaxy_1/*http://in.overview.mail.yahoo.com/connectmore>.
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]<mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
>


-- 
Ben Caradoc-Davies <[email protected]>
Software Engineer, CSIRO Earth Science and Resource Engineering
Australian Resources Research Centre
26 Dick Perry Ave, Kensington WA 6151, Australia

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to