Hi all,
I have a single point in a table such that the query:
select SDO_GEOM.VALIDATE_GEOMETRY(geomObj, 0.05) from testvalid;
/* Returns */
SDO_GEOM.VALIDATE_GEOMETRY(GEOMOBJ,0.05)
'TRUE'
However the query:
select SDO_GEOM.VALIDATE_GEOMETRY_with_context(geomObj, 0.05) from testvalid;
Receives the following error:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.NumberFormatException: empty String
ORA-06512: at "MDSYS.SDO_3GL", line 658
ORA-06512: at "MDSYS.SDO_GEOM", line 519
ORA-06512: at "MDSYS.SDO_GEOM", line 558
ORA-06512: at line 1
The data itself is a single sdo_point:
select GEOMOBJ from testvalid;
/* Returns: */
GEOMOBJ
'(3001, , (174.092329032787, 129.420551704918, -71.2857142857142), , )'
I think that the problem is something to do with the precision of the stored X, Y and Z values in the point because if I run the following:
update TESTVALID set GEOMOBJ.sdo_point.x = cast(GEOMOBJ.sdo_point.x as number(8,3));
select SDO_GEOM.VALIDATE_GEOMETRY_with_context(geomObj, 0.05) from testvalid;
/* Returns: */
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(GEOMOBJ,0.05)
'TRUE'
Similarly, running a direct comparison from an object made on the fly from the point's text representation works fine:
select SDO_GEOM.VALIDATE_GEOMETRY_with_context("MDSYS"."SDO_GEOMETRY"(3001,NULL, "MDSYS"."SDO_POINT_TYPE"(174.092329032787,129.420551704918,-71.2857142857142),NULL,NULL), 0.005) from dual;
/* Returns */
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT("MDSYS"."SDO_GEOMETRY"(3001,NULL,"MDSYS"."SDO_POINT_TYPE"(174.092329032787,129.420551704918,-71.2857142857142),NULL,NULL),0.005)
'TRUE'
Note that I only noticed this problem after upgrading from v11 to v11 R2. Also, the same ORA-29532 error comes up when running any of the SDO_GEOM.[x] function calls such as SDO_GEOM.DISTANCE(). The problem is not limited to SDO_POINT type geometries, yet the problem occurs only on
some geometry entries in my database. It is repeatable in that the same geometry will continue to fail and the only solution I've found is to try to round down its precision in x, y, and/or z. I only know how to easily round down the precision for SDO_POINT types, so one of my problems is that I'm left with a whole scattering of other geometries that I can no longer spatially query.
The datas themselves were inserted from MATLAB (which connects using v11 Oracle ODBC Java drivers) which converts my coordinates to java.math.BigDecimal and binds them to an oracle prepared statement.
One possibility that I'm considering is that the insertion is done from various computers, some of which are 64-bit machines. Maybe somehow those machines are pumping in coordinates to a precision too great for oracle geometry?
Any help would be fantastic as I'm pretty lost here.
If the precision is indeed the problem, does anyone know how I can trim off those excess values after the decimal point for all geometry types?
Thanks,
Sven.