SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT and "NULL" in SDO_GEOMETRY

For the table N_GEOM we have in the SDO_GEOM_METADATA_TABLE:
table_name: N_GEOM
geometry_column: SHAPE
diminfo: SDO_DIM_ARRAY(SDO_DIM_ELEMENT('LONGITUDE', -180, 180, .001), SDO_DIM_ELEMENT('LATITUDE', -90, 90, .001))
srid: 8307
If we validate the geometry SDO_GEOMETRY(NULL, 8307, NULL, NULL, NULL)
we get:
SQL> select sdo_geom.validate_geometry_with_context(SDO_GEOMETRY(NULL, 8307, NULL, NULL, NULL),
2 diminfo)
3 from user_sdo_geom_metadata where table_name='N_GEOM';
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(SDO_GEOMETRY(NULL,8307,NULL,NULL,NULL),D
NULL
SQL> select sdo_geom.validate_geometry_with_context(NULL,
2 diminfo)
3 from user_sdo_geom_metadata where table_name='N_GEOM';
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(NULL,DIMINFO)
NULL
But if we use a tolerance value we get:
SQL> select sdo_geom.validate_geometry_with_context
2 (SDO_GEOMETRY(NULL, 8307, NULL, NULL, NULL),
3 0.001) from dual;
select sdo_geom.validate_geometry_with_context
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "MDSYS.SDO_GEOM", line 70
ORA-06512: at "MDSYS.SDO_GEOM", line 1851
But witht NULL we get:
SQL> select sdo_geom.validate_geometry_with_context
2 (NULL,
3 0.001) from dual;
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(NULL,0.001)
NULL
Why do we an error message for one these queries?

There is no such SRID 2000303. However, this one sure looks like it does the same thing. Replace all the SRID values with 2320 and you should be set.
SQL> select *
  2  from MDSYS.SDO_COORD_REF_SYSTEM
  3  where srid = 2320;
      SRID COORD_REF_SYS_NAME                                                              COORD_REF_SYS_KIND
COORD_SYS_ID  DATUM_ID GEOG_CRS_DATUM_ID SOURCE_GEOG_SRID PROJECTION_CONV_ID CMPD_HORIZ_SRID CMPD_VERT_SRID
INFORMATION_SOURCE
DATA_SOURCE                              IS_LE LEGACY_CODE
LEGACY_WKTEXT
LEGACY_CS_BOUNDS(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
IS_VA SUPPO
      2320 ED50 / TM30                                                                      PROJECTED
        4530                        6230            4230              16370
General Command of Mapping via EuroGeographics; http://crs.ifag.de/
EPSG                                    FALSE
TRUE  TRUE

Similar Messages

  • Oracle 11 sdo_geom.validate_geometry_with_context ERROR

    Hi forum,
    we've identified the following error in oralce spatial version 11.1.0.7.
    The only difference between the following statements is the fourth position of the sdo_ordinate_array (2568619.62 <-> 2568619.61)
    This is the result from an oracle 11.1.0.7 database:
    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(3003,31466,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.62,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0)),0.0005) as val_stat from dual;
    VAL_STAT
    13367 Point:0,Edge:0,Ring:2,
    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(3003,31466,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.61,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0)),0.0005) as val_stat from dual;
    VAL_STAT
    TRUE
    The result on oracle 10.2.0.1 is TRUE for both statements!
    Is this a known bug in oracle 11?
    Regards, Arnd.

    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(3003,31466,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.62,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0)),0.0005) as val_stat_31466_feature_1 from dual;
    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(3003,31466,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.61,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0)),0.0005) as val_stat_31466_feature_2 from dual;
    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(3003,31462,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.62,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0)),0.0005) as val_stat_31462_feature_1 from dual;
    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(3003,31462,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.61,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0)),0.0005) as val_stat_31462_feature_2 from dual;
    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(3003,null,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.62,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0)),0.0005) as val_stat_null_feature_1 from dual;
    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(3003,null,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.61,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0)),0.0005) as val_stat_null_feature_2 from dual;
    select sdo_geom.validate_geometry_with_context(SDO_CS.MAKE_2d(MDSYS.SDO_GEOMETRY(3003,31466,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.62,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0))),0.0005) as val_stat_31466_feature_1_2d from dual;
    select sdo_geom.validate_geometry_with_context(SDO_CS.MAKE_2d(MDSYS.SDO_GEOMETRY(3003,31466,null,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,40,2003,1),
    MDSYS.SDO_ORDINATE_ARRAY(2568609.43,5653957,0,2568619.61,5653845.08,0,2568646.99,5653847.57,0,2568642.96,5653891.06,0,2568712.86,5653897.49,0,2568718.77,5653832.82,0,2568621.54,5653823.93,0,2568623.62,5653801.14,0,2568743.69,5653812.04,0,2568877.45,5653824.19,0,2568856.27,5654056,0,2568838.3,5654054.37,0,2568609.43,5653957,0,2568767.56,5654001.42,0,2568830.75,5654028.43,0,2568853.78,5654030.53,0,2568868.7,5653867.3,0,2568816.59,5653862.57,0,2568810.64,5653927.73,0,2568772.49,5653924.24,0,2568771.19,5653938.66,0,2568773.23,5653938.85,0,2568767.56,5654001.42,0))),0.0005) as val_stat_31466_feature_2_2d from dual;

  • SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT giving seemingly incorrect result

    I ran the following query and got the unexpected answer of TRUE:
    SELECT SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT
    SDO_UTIL.REMOVE_DUPLICATES
    SDO_GEOMETRY
    2002,
    8307,
    NULL,
    SDO_ELEM_INFO_ARRAY(1,2,1),
    SDO_ORDINATE_ARRAY(32.5, 65.789, 32.5, 65.789)
    ), .005
    ), .005
    FROM dual;
    What surprised me was the SDO_ORDINATE_ARRAY after the remove duplicates has only a longitude and latitude yet the geometry a line was validated as true. Doesn't a line at least need two sets of coordinates? How was this geometry validated to true?

    yet the geometry a line was validated as true.Actually a geometry line containing duplicates was converted to a point type (gtype 2001), which was validated as 'TRUE' as it should be.
    SQL> SELECT SDO_UTIL.REMOVE_DUPLICATE_VERTICES(SDO_GEOMETRY(2003, 8307,NULL,
    SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY(32.5, 65.789, 32.5, 65.789)
    ),0.005)
    FROM DUAL;
    SDO_GEOMETRY(2001, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), SDO_ORDINATE_ARRAY(32.5, 65.789))
    1 row selected.

  • Sdo_geom.validate_geometry_with_context - Reporting multiple errors

    All Oracle versions.
    sdo_geom.validate_geometry_with_context appears to report only the first error it finds in an sdo_geometry.
    Thus, it reports only the first duplicate vertex in "ORA-13356: adjacent points in a geometry are redundant", or only
    the first loop in a ring for "ORA-13349: polygon boundary crosses itself".
    I understand that, for some errors, reporting more than one error would be difficult but for more simple errors such as
    the two mentioned, it would be most helpful to have validate_geometry_with_context report more than one error location
    in its return string. Such reporting would reduce the time and effort required in find-fix-find error correction cycle.
    Comments?
    regards
    Simon

    A triangle is a bad example for ORA-13349. In fact, it is impossible for a triangle not to be right unless two points are the same.
    I don't agree with a lot of the comments because I know that many simple types of errors can be detected. Here is
    a polygon with a hole that has multiple 13349 errors because of "bow-ties" or "loops in the outer boundary".
    select sdo_geom.validate_geometry_with_context(MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,17,2003,1),
                                      MDSYS.SDO_ORDINATE_ARRAY(
                                      523960.5, 5201847.7, 525174.7, 5202361.9, 525171.4, 5202328.8, 524843.0, 5202839.7,
                                      524889.4, 5202833.0, 523748.1, 5202484.7, 523781.3, 5202554.4, 523960.5, 5201847.7,
                                      524141.2, 5202192.9, 524223.1, 5202550.3, 524197.1, 5202520.5, 524502.3, 5202546.6,
                                      524584.2, 5202293.4, 524614.0, 5202345.6, 524171.0, 5202189.2, 524141.2, 5202192.9)),0.005) as error
              from dual;
    ERROR                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
    13349 [Element <1>] [Ring <1>][Edge <5>][Edge <7>] As you can see, validate_geometry_with_context() only returns the first loop in the outer boundary (1003).
    But with a slight modification of approach we can get at least one more:
    select sdo_geom.validate_geometry_with_context(b.geom,0.005) as error
    from (select mdsys.sdo_util.extract(
                    MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1,17,2003,1),
                                       MDSYS.SDO_ORDINATE_ARRAY(
                                       523960.5, 5201847.7, 525174.7, 5202361.9, 525171.4, 5202328.8, 524843.0, 5202839.7,
                                       524889.4, 5202833.0, 523748.1, 5202484.7, 523781.3, 5202554.4, 523960.5, 5201847.7,
                                       524141.2, 5202192.9, 524223.1, 5202550.3, 524197.1, 5202520.5, 524502.3, 5202546.6,
                                       524584.2, 5202293.4, 524614.0, 5202345.6, 524171.0, 5202189.2, 524141.2, 5202192.9)),1,a.elem_no) as geom
             from (select level as elem_no from dual connect by level < 3) a
          ) b;
    ERROR
    13349 [Element <1>] [Ring <1>][Edge <5>][Edge <7>]
    13349 [Element <1>] [Ring <1>][Edge <7>][Edge <5>]So, by extension, it is possible to return all the other bow-ties: I have done this in a function I have written. I now
    need to extend it to find all other bow-ties in a ring.
    I have function that finds all duplicate vertices (13356) in a geometry. Works well.
    select rownum as point, b.valid, c.geometry
      from (select substr(sdo_geom.validate_geometry_with_context(a.geom,0.005),1,40) as valid,
                   a.geom
              from (select MDSYS.SDO_GEOMETRY(2006, NULL, NULL,
                                      MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1,13,2,1),
                                      MDSYS.SDO_ORDINATE_ARRAY(50.0, 15.0, 55.0, 15.0, 55.0, 15.0, 55.0, 15.0, 60.0, 15.0, 60.0, 15.0, 65.0, 15.0)) as geom
                      from dual) a
            ) b,
            TABLE(sdo_error.getErrors(b.geom,0.005)) c;
    POINT VALID                                    GEOMETRY
    1     13356 [Element <1>] [Coordinate <2>] MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(55,15,NULL),NULL,NULL)
    2     13356 [Element <1>] [Coordinate <2>] MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(55,15,NULL),NULL,NULL)
    3     13356 [Element <1>] [Coordinate <2>] MDSYS.SDO_GEOMETRY(2001,NULL,MDSYS.SDO_POINT_TYPE(60,15,NULL),NULL,NULL)As I said, this can be done for simple elemental errors. Errors that involve interactions of rings for example are harder. But, gee, other
    software packages provide such capability so it is possible. And, these are data-level issues so I think it reasonable that Oracle
    provides an improved set of functions and not hand it over to external GIS software clients.
    regards
    Simon

  • Sdo_geom.validate_geometry_with_context returns error for a valid polygon

    Hi people,
    I have found a strange case, where sdo_geom.validate_geometry_with_context returns an error:
    select sdo_geom.validate_geometry_with_context(SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(0.0, 51.9273, 0.3556, 51.9273, 0.3910, 51.9274, 0.1964, 51.9274, 0.0, 51.9273)), 1) from dual;
    13349 [Element <1>] [Ring <1>][Edge <3>][Edge <1>]
    The tolerance for SRID 8307 is in meters, right? The shape is a parallelogram, although the lat dimension is about 0.0001 grad or ~11 meters. Any hints why there is an error?
    // using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Edited by: Slava2 on May 27, 2013 3:12 AM

    You defined a spheric polygon in WGS84, that has a self intersection near <0.22945371630245; 51.9274226210077> :
    WITH l1 AS
    (SELECT SDO_GEOMETRY(2002, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(0.0000,51.9273, 0.3556,51.9273)) geom
        FROM dual),
        l2 AS
    (SELECT SDO_GEOMETRY(2002, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(0.3910,51.9274, 0.1964,51.9274)) geom
    FROM dual)
    SELECT  sdo_geom.sdo_intersection(l1.geom, l2.geom,0.00001) FROM l1, l2;
    (2001; 8307; ; (1; 1; 1); (0.22945371630245; 51.9274226210077))
    1 row selected.

  • VALIDATE_LAYER_WITH_CONTEXT - Rowid and NULL in result table

    Hello,
    Oracle 10g R2
    I performed validity test using VALIDATE_LAYER_WITH_CONTEXT as follow:
    CREATE TABLE RESULT_TABLE_CP(SDO_ROWID ROWID, RESULT VARCHAR2(2000));
    CALL SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('VESSEL_ZONE_GEOMETRY', 'POLYGON', 'RESULT_TABLE_CP');
    What puzzled me was the result table contained the rowid and NULL as the result for each geometry. I was expecting to see what the error is, not just NULL.
    However when I use VALIDATE_GEOMETRY_WITH_CONTEXT to test the same layer, I got TRUE for all of them, as:
    select DISTINCT SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(a.POLYGON,b.DIMINFO)
    from VESSEL_ZONE_GEOMETRY a,
    USER_SDO_GEOM_METADATA b
    where b.TABLE_NAME = 'VESSEL_ZONE_GEOMETRY'
    and b.COLUMN_NAME = 'POLYGON'
    and a.POLYGON is not null;
    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(A.POLYGON,B.DIMINFO) ------------------------------------------------------------------------------------
    TRUE
    Any suggestion would be much appreciated!
    Thanks, CP

    Can you get the geometry by running
    select polygon from VESSEL_ZONE_GEOMETRY where rowid = '....';

  • Using SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT effectively

    I have been using SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT to validate the geometry of several million polygon features. Here is an example of the SQL I have been using:
    Create table myResultsTable
    as
    SELECT A.myID, SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(A.GEOMETRY, 0.1) as invalidGeometry, FROM myGeometryTable A
    WHERE SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(A.GEOMETRY, 0.1) <> 'TRUE';
    I noticed that for each polygon in the table, this function returns only one result for the polygon before moving on to the next polygon despite it being possible that a polygon could fail the validation for several reasons.
    How can I return all reasons why a polygon has invalid geometry?
    Does it require me to use PL/SQL? If so, can anyone get me started?
    Or does it require me to use SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT? If so, how do I specify a tolerance when using this function like I did when I used SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT?
    Many thanks for your time.

    Hi,
    The validation routines only report the first reason geometry data is invalid.
    To validate several million polygon features I would use validate_layer_with_context because it is faster.
    If you don't want to for some reason then alter your statement to only run the validation procedure once:
    select a.status,a.id
    from (SELECT m.myID id, SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(m.GEOMETRY, 0.1) status
    FROM myGeometryTable m) a
    where a.status <> 'TRUE';
    Then there are possibilities in terms of automatically trying to fix things up to move on to the next error. For instance, if you get a duplicate vertices error your run remove_duplicate_vertices to try to fix that error, then revalidate and see if there are other errors. If you have a self-intersecting geometrt then running a self union may fix those kinds of problems (in 10g r2 this is automated with sdo_util.rectify_geometry, which attempts to automatically fix these kinds of errors).
    NOTE: Always check results of any automated geometry fix-up procedures to make sure you agree with the results of the procedure. I would recommend against automatically updating your data without checking the results.
    Hope this helps,
    Dan

  • Sdo_geom.validate_geometry_with_context

    I have been using sdo_geom.validate_geometry_with_context to identify problems with geometry. When reporting errors the function returns, if one exists, an error code and the position of the error.
    Does anyone know whether the validation stops at this point, i.e. it does not continue through the remainder of the geometry to find further errors?

    The function SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT will validate a single geometry. You can write a PL/SQL cursor to validate each geometry in a table if you desire.
    You can validate all the geometries in a table with SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT, and the results are written to a table.
    See the Oracle Spatial Users Guide and Reference, Release 9.2 for further information

  • SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT returns ORA-13199 SRID does not exist

    Hi everyone,
    I'm facing with this error while I was trying to list wrong spatial data (11.0.2.0.3 RAC (AIX))
    Select   *
    From     table
    Where    SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT (GEOMETRY,0.001)! ='TRUE'
    It returns :
    ORA-13199: SRID does not exists
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 17
    ORA-06512: at "MDSYS.SDO_CS", line 5328
    ORA-06512: at "MDSYS.SDO_GEOM", line 483
    ORA-06512: at "MDSYS.SDO_GEOM", line 560
    ORA-06512: at line 1
    Is there anyone who faced with this kind of issue or any idea ?
    Thanks in advance
    Regards

    There is no such SRID 2000303. However, this one sure looks like it does the same thing. Replace all the SRID values with 2320 and you should be set.
    SQL> select *
      2  from MDSYS.SDO_COORD_REF_SYSTEM
      3  where srid = 2320;
          SRID COORD_REF_SYS_NAME                                                              COORD_REF_SYS_KIND
    COORD_SYS_ID  DATUM_ID GEOG_CRS_DATUM_ID SOURCE_GEOG_SRID PROJECTION_CONV_ID CMPD_HORIZ_SRID CMPD_VERT_SRID
    INFORMATION_SOURCE
    DATA_SOURCE                              IS_LE LEGACY_CODE
    LEGACY_WKTEXT
    LEGACY_CS_BOUNDS(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
    IS_VA SUPPO
          2320 ED50 / TM30                                                                      PROJECTED
            4530                        6230            4230              16370
    General Command of Mapping via EuroGeographics; http://crs.ifag.de/
    EPSG                                    FALSE
    TRUE  TRUE

  • Difference between Null and null?

    What is the difference between null and NULL?
    When is each used?
    Thanks,

    veryConfused wrote:
    There is a null in java, but no NULL. null means no value. However, when assigning value, the following is different:Although the empty String has no special role. Null means, the referential type is not assigned (doesn't refer) to a specific object. The empty String is just another object though, so seeing it or pointing it out as something special when it actually isn't at all (no more special than new Integer(0) or new Object[0]) just adds to the confusion.

  • How to differentiate the EMPTY Records and Null Values in DSO

    Hello....how is everyone here?? Ehehehe!
    I try to load some data from the flat file which contains some EMPTY data and Null Values for the records. The data type for the InfoObjects of the fields "Quantity" is "number". The sample data from the flat file (CSV) are as below:
    Food              Quantity
    Hamburger  -       12
    Cheese        -       0
    Vegetable      -               (Empty)
    When I try to load the above sample data to the DSO, I get the results of the data as follow:
    Food              Quantity
    Hamburger     - 12.000
    Cheese           -  0.000
    Vegetable         - 0.000
    In this case, how can the user differentiate whether the records is contain empty value of null values in DSO? This is kinda of hard to differentiate the both scenarios above. Is there any way to differentiate the scenarios described here?
    Thanks alot =)

    Hi Fluffy,
    It depends on the initial values of the data type
    The inital values For quantity/Currency/ Numbers it takes spaces as 0
    for char it is SPACE
    We cannot differeniate between space and null values.
    IF you have to force this then define quantity as char and load the data. we will not have units and aggregation in this case.
    Hope this helps.
    PV

  • How to force simple tags and null attributes to appear when using SQL/XML?

    Hello everybody:
    I'm developing a non-schema based XMLType view.
    When the XML document is generated, i noticed two things I need to manage in order to achieve the desired result:
    1. Oracle generates a <tag></tag> pair for each XMLELEMENT defined; in my case, some tags need to appear as <tag/>... how do I do? Is it possible when using schema based XMLType views? Is it possible while using a non-schema approach?
    2. When using XMLATTRIBUTE('' AS "attribute") or XMLATTRIBUTE(NULL AS "attribute"), no one attribute with label "attribute" and null value appears at the output; how do I force to Oracle DB to render those attributes which are with no values (needed to render those attributes as another parsing code will await for all the items)?
    3. Some tip about how to route the output to an XML text disk file will be appreciated.
    Thanks in advance.
    Edited by: Enyix on 26/02/2012 11:21 PM
    Edited by: Enyix on 26/02/2012 11:22 PM

    Hello odie_63, thanks for your reply:
    Reasons why needed single tags are these two next: Needed to generate a single XML file from 50,000,000 rows, where the XML ouput matches not only row data but another default values for another elements and attributes (not from database but using strings and types with default values); by using start and end tag, the generated file is as much twice bigger than using single tags; second, needed a very precise presentation for all the document.
    For generating that document, currently focus is based on using a batch process relying on Spring Batch with using a single JDBC query where a join happens between two tables. From my point of view, that approach uses: database resources, network resources, disk resources, and processing resources, including the price of making the join, sending to network, creating objects, validating, and making the file (Expending too much time generating that XML file). That processs currently is in development.
    I think possibly another approach is delegating the complete generation of that file to the database using its XML capabilities. My current approach following your recomendations is to generate a clob where I will put all the XML and putting it into a table. It leads me to another issues: Considering limitations on memory, processing and disk space, needed to append a single row-as-xml into the clob as soon as possible, and putting the clob inside the field as soon as possible, or putting the clob inside the field, and appending into it as the data is generated; so How do I manage the process in order to achieve that goals?. Seen these issues aren't related to my original question, so I'll open a new post. Any help will be apreciated.
    Thanks again in advance.

  • How to check empty string and null? Assign same value to multiple variables

    Hi,
    1.
    How do I check for empty string and null?
    in_value IN VARCHAR2
    2. Also how do I assign same value to multiple variables?
    var_one NUMBER := 0;
    var_two NUMBER := 0;
    var_one := var_two := 0; --- Gives an error
    Thanks

    MichaelS wrote:
    Not always: Beware of CHAR's:
    Bug 727361: ZERO-LENGTH STRING DOES NOT RETURN NULL WHEN USED WITH CHAR DATA TYPE IN PL/SQL:
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is NOT null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> alter session set events '10932 trace name context forever, level 16384';
    Session altered.
    SQL> declare
      2    l_str1   char (10) := '';
      3    l_str2   char (10) := null;
      4  begin
      5  
      6    if l_str1 is null
      7    then
      8      dbms_output.put_line ('oh STR1 is null');
      9    elsif l_str1 is not null
    10    then
    11      dbms_output.put_line ('oh STR1 is NOT null');
    12    end if;
    13  
    14    if l_str2 is null
    15    then
    16      dbms_output.put_line ('oh STR2 is null');
    17    elsif l_str2 is not null
    18    then
    19      dbms_output.put_line ('oh STR2 is NOT null');
    20    end if;
    21  end;
    22  /
    oh STR1 is null
    oh STR2 is null
    PL/SQL procedure successfully completed.
    SQL> SY.

  • Varchar2, empty strings and NULL

    Hi all,
    When inserting an empty string into a column of type varchar2 - is a NULL value stored in the column by the database? I've seen conflicting reports, and I know that the SQL 1992 spec specifies that empty strings not be treated as a NULL value, but that Oracle has traditionally treated zero length strings stored in a varchar2 column as NULL.
    So, is there a way to store an empty string in a varchar2 column as an empty string and not a NULL value?
    TIA,
    Seth

    It can be even more complicated or annoying than NULL not equal to ASCII NULL.
    example:
    create table test_null
    (fld1 varchar2(10),
    fld2 varchar2(10),
    fld3 varchar2(20));
    insert into test_null values (chr(0),null, 'chr(0) and null');
    insert into test_null values (null, null, 'null and null');
    insert into test_null values ('', chr(0), ''''' and chr(0)');
    insert into test_null values ('', null, ''''' and null');
    select * from test_null;
    FLD1       FLD2       FLD3
                          chr(0) and null
                          null and null
                          '' and chr(0)
                          '' and null
      1  DECLARE
      2  BEGIN
      3   for c1 in (select fld1, fld2, fld3 from test_null) loop
      4      if c1.fld1 = c1.fld2 then
      5         dbms_output.put_line(c1.fld3||' Are equal'||
      6                '  Length fld1 = '||to_char(length(c1.fld1))||
      7                ' Length fld2 = '||to_char(length(c1.fld2)));
      8      else
      9         dbms_output.put_line(c1.fld3||' Are NOT equal'||
    10                '  Length fld1 = '||to_char(length(c1.fld1))||
    11                ' Length fld2 = '||to_char(length(c1.fld2)));
    12      end if;
    13      dbms_output.put_line(' ');
    14   end loop;
    15*  END;
    SQL> /
    chr(0) and null Are NOT equal  Length fld1 = 1 Length fld2 =
    null and null Are NOT equal  Length fld1 =  Length fld2 =
    '' and chr(0) Are NOT equal  Length fld1 =  Length fld2 = 1
    '' and null Are NOT equal  Length fld1 =  Length fld2 =
    PL/SQL procedure successfully completed.

  • Difference between IS NULL and = NULL

    Hello Guys,
    In 10gR2 what is the difference between IS NULL and = NULL
    Thanks,
    Imran

    Just don't use the second, because the comparison operator = cannot deal with NULLs as you (probably) hope it can:
    SQL> create table t1 as select rownum as id, 'test' as word from dual connect by level<=2;
    Table created.
    SQL> update t1 set word=null where id=1;
    1 row updated.
    SQL> commit;
    Commit complete.
    SQL> select * from t1;
            ID WORD
             1
             2 test
    SQL> select * from t1 where word is null;
            ID WORD
             1
    SQL> select * from t1 where word = null;
    no rows selectedKind regards
    Uwe Hesse
    http://uhesse.wordpress.com

Maybe you are looking for

  • IMovie HD to FCP HD

    iMovie HD imports my HDV footage from my new Sony HDR-HC7camera, whereas my current version of FCP HD does not. (I hear rumours that FCP 6 is about to be released, so I'm waiting to upgrade my FCP HD software from 4.5 to 6) In the mean time I am sear

  • Upgrade from OS 9.2 to OS X

    I'm trying to upgrade my G3 power mac (DV) from OS 9 to OS X. I bought Tiger for my new G5 mac and want to load it on my old machine. I've updated the firmware to the latest for this model, 1.1. When I follow the instructions on the Tiger cd to click

  • How to restore ipad 2 back to iso 5

    i have ios 6 i need a usb keyboard to type notes on it i can't pay 69.00 for a keyboard and i am not sure if i can use this in school casue of the persmmsion needed to get on the network please help i have been suign my ibook g3 and it is a pain to c

  • How to create code for an additional field in an info set

    Hello, I have an info set in tra SQ02 and the area is HCM with version ERP2004. I need to create an additional field to show "Work permit" in ad hoc queries. I know that the infotype 0016 has a standard field P0016-ARBER which contains a date if that

  • Error in configuration of UWL

    Hi all i have an error in confugaration of UWL for Travel Request, my sap version is 5.0 and my portal version is 6.0, i created system alias, and the test connections were working fine, and we created RFC destination by name<system alias>$<webflow c