<HTML dir=ltr><HEAD><TITLE>Re: [Gvsig_usuarios] [Gvsig_english] oracle plugin crashes with point layers on oracle10.2</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16945" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText47216 dir=ltr>
<DIV dir=ltr><FONT face="Times New Roman" color=#000000>> Could we manage this inside the oracle plugin?</FONT></DIV>
<DIV dir=ltr><FONT face="Times New Roman" color=#000000>> Maybe setting Z to 0 if it's NULL. </FONT></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Ok, We'll do that.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>If a table called TABLE_NAME has a column called GEOMETRY_COLUMN with 3D points whose Z is null, you can convert them to 2D points with:</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr><FONT face="Times New Roman" color=#000000>SELECT mdsys.sdo_geometry(<BR>2001,<BR>t.GEOMETRY_COLUMN.sdo_srid,<BR>mdsys.sdo_point_type(t.GEOMETRY_COLUMN.sdo_point.X, t.GEOMETRY_COLUMN.sdo_point.Y, null),<BR>null,<BR>null)<BR>FROM<BR>TABLE_NAME t</FONT></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>(maybe we should send our emails in English only to the international list)</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Regards,</DIV>
<DIV dir=ltr><FONT face="Times New Roman" color=#000000></FONT> </DIV></DIV>
<DIV id=idSignature16596 dir=ltr>
<DIV><FONT face="Courier New" size=2><FONT face="Times New Roman" size=3>Juan Lucas Domínguez Rubio<BR></FONT>---</FONT></DIV>
<DIV><FONT face="Courier New" size=2><FONT face="Courier New" size=2><FONT face="Courier New" size=2>Prodevelop SL, Valencia (España)</FONT></DIV>
<DIV>
<DIV><FONT face="Courier New" size=2>Tlf.: 96.351.06.12 -- Fax: 96.351.09.68<BR></FONT><A href="http://www.prodevelop.es/"><FONT face="Courier New" size=2>http://www.prodevelop.es</FONT></A><BR><FONT face="Courier New" size=2>---</FONT></DIV></FONT></DIV></FONT></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>De:</B> gvsig_usuarios-bounces@listserv.gva.es en nombre de giohappy<BR><B>Enviado el:</B> jue 14/01/2010 11:28<BR><B>Para:</B> gvsig_usuarios@listserv.gva.es<BR><B>Asunto:</B> Re: [Gvsig_usuarios] [Gvsig_english] oracle plugin crashes with point layers on oracle10.2<BR></FONT><BR></DIV>
<DIV><BR>
<P><FONT size=2>Hi Juan. thanks for the reply.<BR>Sorry, I meant 3001.<BR>The problem was that, the SDO_POINT.Z set NULL. Anyway this is valid for<BR>Oracle (I checked it with its validating functions), and this is what<BR>returns when you make a get_centroid on 3003 polygons: we get a 3d point but<BR>with Z null.<BR>Could we manage this inside the oracle plugin? Maybe setting Z to 0 if it's<BR>NULL. For now we will do it inside the DB...<BR><BR>giovanni<BR><BR><BR><BR><BR><BR><BR>jldominguez wrote:<BR>><BR>> Hello, Giovanni.<BR>> <BR>> The gtype 1003 is not for points as far as I know. Do you mean 3001?<BR>> <BR>> The error happens because gvSIG finds a NULL value in the Z, so maybe<BR>> there is a contradiction in your data (the metadata says it is a 3D point<BR>> but the Z is null). Do you have any application to access the database<BR>> (for example SQLDeveloper)? If so, try to execute this:<BR>> <BR>> SELECT t.<GEOMETRY_COLUMN>.sdo_gtype, t.<GEOMETRY_COLUMN>.sdo_point FROM<BR>> <TABLE_NAME> t WHERE ROWNUM < 10<BR>> <BR>> You have to replace <GEOMETRY_COLUMN> and <TABLE_NAME> with your values.<BR>> What is the result?<BR>> <BR>> How did you create those geometries in the Oracle Database? Did you create<BR>> them with gvSIG?<BR>> <BR>> Regards,<BR>> <BR>> Juan Lucas Domínguez Rubio<BR>> ---<BR>> Prodevelop SL, Valencia (España)<BR>> Tlf.: 96.351.06.12 -- Fax: 96.351.09.68<BR>> <A href="http://www.prodevelop.es/">http://www.prodevelop.es</A> <<A href="http://www.prodevelop.es/">http://www.prodevelop.es/</A>><BR>> ---<BR>><BR>> ________________________________<BR>><BR>> De: gvsig_internacional-bounces@listserv.gva.es en nombre de G. Allegri<BR>> Enviado el: mié 13/01/2010 16:28<BR>> Para: Users and Developers mailing list; Lista de Usuarios de gvSIG<BR>> Asunto: [Gvsig_english] oracle plugin crashes with point layers on<BR>> oracle10.2<BR>><BR>><BR>><BR>> I have a point layer (gtype 1003) in oracle, version 10.2<BR>> I'm using the ojdbc14.jar from oracle client.<BR>><BR>> Linear and polygon layers load correctly, while points give<BR>> NullPointerException for every point.<BR>> Here is the expection (just on of the other similar thousands!) from log:<BR>><BR>> java.lang.NullPointerException<BR>> at<BR>> es.prodevelop.cit.gvsig.fmap.drivers.jdbc.oracle.OracleSpatialUtils.getFMapGeometrySdoPoint(OracleSpatialUtils.java:2633)<BR>> at<BR>> es.prodevelop.cit.gvsig.fmap.drivers.jdbc.oracle.OracleSpatialUtils.getFMapGeometryPoint(OracleSpatialUtils.java:2583)<BR>> at<BR>> es.prodevelop.cit.gvsig.fmap.drivers.jdbc.oracle.OracleSpatialDriver.getFMapGeometry(OracleSpatialDriver.java:587)<BR>> at<BR>> es.prodevelop.cit.gvsig.fmap.drivers.jdbc.oracle.OracleSpatialDriver.getGeometryUsing(OracleSpatialDriver.java:538)<BR>> at<BR>> es.prodevelop.cit.gvsig.fmap.drivers.jdbc.oracle.OracleSpatialFeatureIterator.next(OracleSpatialFeatureIterator.java:141)<BR>> at<BR>> com.iver.cit.gvsig.fmap.drivers.featureiterators.ReprojectWrapperFeatureIterator.next(ReprojectWrapperFeatureIterator.java:92)<BR>> at<BR>> com.iver.cit.gvsig.fmap.layers.FLyrVect._draw(FLyrVect.java:437)<BR>> at com.iver.cit.gvsig.fmap.layers.FLyrVect.draw(FLyrVect.java:631)<BR>> at<BR>> com.iver.cit.gvsig.fmap.DefaultMapContextDrawer.draw(DefaultMapContextDrawer.java:209)<BR>> at<BR>> com.iver.cit.gvsig.fmap.DefaultMapContextDrawer.draw(DefaultMapContextDrawer.java:175)<BR>> at com.iver.cit.gvsig.fmap.MapContext.draw(MapContext.java:1092)<BR>> at<BR>> com.iver.cit.gvsig.fmap.MapControl$PaintingRequest.paint(MapControl.java:1043)<BR>> at<BR>> com.iver.cit.gvsig.fmap.MapControl$Drawer2$Worker.run(MapControl.java:1234)<BR>> at java.lang.Thread.run(Unknown Source)<BR>><BR>> giovanni<BR>> _______________________________________________<BR>> Gvsig_internacional mailing list<BR>> Gvsig_internacional@listserv.gva.es<BR>> <A href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</A><BR>><BR>><BR>><BR>> _______________________________________________<BR>> gvSIG_usuarios mailing list<BR>> gvSIG_usuarios@listserv.gva.es<BR>><BR>> Para ver histórico de mensajes, editar sus preferencias de usuario o darse<BR>> de baja en esta lista, acuda a la siguiente dirección:<BR>><BR>> <A href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</A><BR>><BR>><BR><BR>--<BR>View this message in context: <A href="http://n2.nabble.com/oracle-plugin-crashes-with-point-layers-on-oracle-10-2-tp4352187p4391745.html">http://n2.nabble.com/oracle-plugin-crashes-with-point-layers-on-oracle-10-2-tp4352187p4391745.html</A><BR>Sent from the gvSIG usuarios mailing list archive at Nabble.com.<BR>_______________________________________________<BR>gvSIG_usuarios mailing list<BR>gvSIG_usuarios@listserv.gva.es<BR><BR>Para ver histórico de mensajes, editar sus preferencias de usuario o darse de baja en esta lista, acuda a la siguiente dirección:<BR><BR><A href="http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios">http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</A><BR></FONT></P></DIV></BODY></HTML>