You will have to be more specific about what Polygon class you are using. I
suppose you are importing the com.vividsolutions.jts.geom.Polygon class and
the java.awt.Polygon class, correct? If so, you have to make sure you are
passing the correct Polygon class by using it's full name.
com.vividsolutions.jts.geom.Polygon.class instead Polygon.class
Laura Díaz-3 wrote:
>
> Hi list,
> sorry for duplicated email, i think i posted it before to the wrong list:
>
> i am facing some problems when i try to create new polygon features out
> of a java polygon, this is my code:
>
> Feature feature = null;
> Geometry geom = null;
> geom = convertToJTSGeometry(poly, toWorld);
> try{
> AttributeType attr =
> AttributeTypeFactory.newAttributeType("the_geom", Polygon.class);
> FeatureTypeBuilder ftBuilder =
> FeatureTypeBuilder.newInstance("ez");
> ftBuilder.addType(attr);
> type = ftBuilder.getFeatureType();
> feature = type.create(new Object[]{geom});
> }
> catch(Exception e) {
> throw e;
> }
> An Exception raises in feature = type.create(new Object[]{geom});
> IllegalAttribute: java.awt.Polygon , but got
> com.vividsolutions.jts.geom.Polygon
>
> any ideas?
>
> thanks in advance,
>
> Laura
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
--
View this message in context:
http://www.nabble.com/Geotools%2C-JTS-and-the-North-Pole-tp14674535p14920575.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users