On 2 November 2012 07:08, Sugandha Naolekar <[email protected]> wrote:
> Hello!
>
>
> I am trying to perform an intersect operation with Multipolygon as a Base
> layer and MultiLineString as a Data layer.
>
> Also, please find attached code.
>
> Somehow, when I run the code, I am getting an exception that an attribute
> cannot be converted to a Geometry.
>
>
That's right it can't :-)
Look at
Geometry data_geom = (Geometry)
featureReader2.getFeatureType().getGeometryDescriptor().getType().getName();
getName() returns a string (containing the name) of the type (getType())
of the geometryDescriptor which is clearly not a geometry and so you get an
error.
In general I prefer to break lines like that down to smaller steps so you
can see the return types of each step and look at the values returned in
the debugger.
Ian
------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users