Please note this code has been ported to JTS 1.7.x ; we have not found 
time to remove this original code yet :-)

My guess is that a mismatch between your elmInfo and you ordinates; ie 
the elmInfo describes how many ordinates are used to represent when 
point, and the ordinate array must be a multiple of that.

your ordinates has 10 entries; so I better hope you are using two 
numbers for each point ...
javadoc:
http://javadoc.geotools.fr/2.2/org/geotools/data/oracle/sdo/SDO.html#elemInfo(com.vividsolutions.jts.geom.Geometry)

1 = offset starts at one (okay cool)
1003 = etype describes ordiante array (1003 represents a simple polygon 
ring in counter clockwise order..)
1 = describes how ordiantes are interpreted,

EType (ie 1003) definition from these javadocs:
http://javadoc.geotools.fr/2.2/src-html/org/geotools/data/oracle/sdo/SDO.html#line.590

So that checks out - lets look at your GTYPE
http://javadoc.geotools.fr/2.2/org/geotools/data/oracle/sdo/SDO.html#D(com.vividsolutions.jts.geom.Geometry)

So your gtype tells me you use 3 ordinates for each point, that does not 
match with your number of ordinates (ie 10) problem solved your database 
is whacked!

The only other thing I can think of is a conflict between your 
representation of point (ie 15, 20) and elemInfo+ordinates - I do not 
think you can do both at the same time (ie point is *only* used as a 
database optimization for representing points)

Have fun,
Jody

> I am testing some functionality: I am trying to convert an SDO 
> geometry to JTS, but the method = SDO.create (GeometryFactory gf, int 
> GTYPE, int SRID, double [] point, int [] elemInfo, double [] 
> ordinates) is throwing a ArithmeticException error! the message is /by 
> zero ..... why is this happening?
>
>  
> The values is:
> GTYPE = 3
> SRID = 29182
> point = [0]15.0 ; [1]20.0
> elemInfo = [0]1 ; [1] 1003; [2] 1
> ordinates = {15.,20.,15.,25.,20.,25.,20.,20.,15.,20. }
>  
> and my method is simple:
>  
>   private Geometry toGeometry(int GTYPE,int SRID,double[] POINT, int[] 
> ELEMINFO,double[] ORDINATES)
>   {   
>         return SDO.create( new GeometryFactory(),
>                                    GTYPE,
>                                   SRID,
>                                    POINT,
>                                   ELEMINFO,
>                                    ORDINATES );
>   }
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ------------------------------------------------------------------------
>
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to