SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT for polygon geometry validation

Hi,
I would like to make a validation of the polygon geometry upon a table SCHEMA.TABLE with the GEOM field, where the geometry is stored.
Can someone help me with a sample SQL sentence to fill my SCHEMA.VALIDITY table with all the detected errors that occured in the SCHEMA.TABLE?
Thanks!
Dejan

Greg
Have you tried scrolling down to the bottom of that section? You will see the following example (as in all descriptions in the documentation):
Examples*
The following example validates the geometry objects stored in the SHAPE column of the COLA_MARKETS table. The example includes the creation of the result table. For this example, a deliberately invalid geometry was inserted into the table before the validation was performed.
-- Is a layer valid? (First, create the result table.)
CREATE TABLE val_results (sdo_rowid ROWID, result varchar2(1000));
-- (Next statement must be on one command line.)
CALL SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('COLA_MARKETS','SHAPE','VAL_RESULTS');
Call completed.
SQL> SELECT * from val_results;
SDO_ROWID
RESULT
Rows Processed <12>
AAABXNAABAAAKYAAC+
+13349 [Element <1>] [Ring <1>][Edge <1>][Edge <3>]+
CREATE TABLE val_results (sdo_rowid ROWID, result varchar2(1000));
would have been in your case:
CREATE TABLE schema.validity (sdo_rowid ROWID, result varchar2(1000));
CALL SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('COLA_MARKETS','SHAPE','VAL_RESULTS');
would have been in your case:
CALL SDO_GEOM.VALIDATE_LAYER_WITH_CONTEXT('SCHEMA.TABLE','GEOM','SCHEMA.VALIDITY');
SQL> SELECT * from val_results;
would have been in your case:
SELECT * from schema.validity;
If you would like to have your id included:
Select a.id, b.*
from schema.validity b left outer join schema.table a
on (b.sdo_rowid= a.rowid);
In order to help people making their life easier with the management of spatial metadata, spatial index and geometry validation, like yours, and possible fix up, 1Spatial has a product named Radius Check.
Have a look at the second item from the top here: http://www.oracle.com/technology/products/spatial/htdocs/spatial_partners_downloads.html
or
http://www.1spatial.com/products/radius_check/index.php
Maybe you can find it usefull.
Luc

Similar Messages

  • 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.

  • 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 - 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

  • No geometry validation on insert ?

    Hi!
    How come Oracle let me insert a non-closed polygon in an spatial-indexed table ? When I run SDO_GEOM.VALIDATE_GEOMETRY() I get the right error code (ORA-13348 polygon boundary is not closed) but I really CAN insert it !!!
    Here's the polygon i've inserted. This is really just example 2.3.3, but modified to be a polygon instead of a line.
    INSERT INTO cola_markets VALUES(
    11,
    'compound_line_string',
    MDSYS.SDO_GEOMETRY(
    2003,
    NULL,
    NULL,
    MDSYS.SDO_ELEM_INFO_ARRAY(1,1005,2, 1,2,1, 3,2,2),
    MDSYS.SDO_ORDINATE_ARRAY(10,10, 10,14, 6,10, 14,10)
    Is it the programmer's responsability to write his own trigger to validate the geometry that is inserted ? I dont mind doing it, but I still think there's something weird going on !
    Thank you!
    Mathieu Gauthier
    Development Team
    JCMB Technology Inc

    Oracle Spatial does not do geometry validation on insert, as you've found. The reason for this is that some people require geometry loading to go as fast as possible, and having a trigger on every insert would slow things down.
    You can create a trigger to do the validation as you've described, if you need it.

  • 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

  • Documentation of Geometry validity in Oracle Spatial?

    Is there anywhere in the 10g Spatial documentation where the geometric conditions required for a geometry to be valid are defined? I've found a few sentences spread through the document, but I would have expected that such an important concept would have had a single place where it was summarized.

    As the designer of JTS, I'm intimately familiar with the OGC SFS spec!
    Of course it's always nice to see statements about adherence to specs. But it's even nicer to see vendor documentation that explicitly states the semantics of the data model, to confirm the adherence to the spec. Actually most of that information is in the Spatial docs, I think - it's just spread out and a bit hard to find.
    Also, the OGC SFS does leave some room for implementations to vary. For instance, the SFS does not mandate the orientation of rings in polygons, whereas Oracle requires a specific orientation. This kind of thing is very important for developers to be aware of.
    Anyway, my primary concern was about whether valid LineStrings can self-intersect, and I think that's answered now.

  • 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

  • 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.

  • 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 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

  • How to Use the language function for assignment and validation

    Hi All,
    If anyone can explain me in details with example ,how to use the language function for assignments and validations?
    Thanks
    Arnab

    Hi Arnab,
    The expression is checked only for the current MDM session.
    If u login with the ABC language it will always show the ABC language no matter how many times u execute it.
    Try connecting to the DM with the XYZ language.
    It should go to the if part rather than else.
    Hope it helps.
    Thanks,
    Minaz

  • Exit/badi for Material group validation on service POs

    Hi Gurus,
    The requirement is to put validation on 'MATERIAL GROUP' at item level as well as service sub line item level.I have used EXIT_SAPMM06E_017 for line level validation.
    For service sub line level 'MATERIAL GROUP' i tried using EXIT_SAPLMLSP_030 but validation is not working properly as
    EXIT_SAPLMLSP_030 is triggered before EXIT_SAPMM06E_017.
    Kindly suggest any alternatives.
    Thanks in advance
    Deepika

    Hi,
    I had finally used BADI ME_PROCESS_PO_CUST method CHECK and PROCESS_ITEM for enjoy transactions i.e ME21N ME22N ME23N and written code in EXIT EXIT_SAPLMLSP_030 for service item validations.
    IF sy-tcode = 'ME21N' OR sy-tcode = 'ME22N' OR sy-tcode = 'ME23N' OR sy-tcode = 'MASS' OR sy-tcode = 'ME29N'.
        DATA: wa_zmm_mat_grp TYPE zmm_mat_grp.
        EXPORT header_data-aedat FROM header_data-aedat TO MEMORY ID 'ZDAT24933'.
        EXPORT header_data-bsart FROM header_data-bsart TO MEMORY ID 'ZBRT24933'.
        IF header_data-aedat GE '20090810'.         " Material group mandatory appplicable date.
          IF ( header_data-bsart = 'SRV' OR header_data-bsart = 'SRVF' OR header_data-bsart = 'SRVI') AND ( header_data-bsart NE ' ')  AND
             ( re_data-loekz EQ 'S' OR re_data-loekz EQ ' ' ).
            SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = re_data-matkl AND
                                                                         bsart = header_data-bsart.
            IF sy-subrc NE 0.
              MESSAGE e005(ze1).
            ENDIF.
          ENDIF.
          IF header_data-bsart IS NOT INITIAL.
            IF ( header_data-bsart NE 'SRV') AND ( header_data-bsart NE 'SRVF') AND ( header_data-bsart NE 'SRVI') AND
               ( re_data-loekz EQ 'S' OR re_data-loekz EQ ' ' ).
              SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = re_data-matkl.
              IF sy-subrc EQ 0.
                MESSAGE e006(ze1).
              ENDIF.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    For service subline item following code:
    DATA: wa_zmm_mat_grp TYPE zmm_mat_grp,
          v_bsart TYPE ekko-bsart,
          v_packno TYPE esll-packno,
          v_ebeln TYPE ekpo-ebeln,
          v_aedat TYPE ekko-aedat.
    IF sy-tcode = 'ME21N' OR sy-tcode = 'ME22N' OR sy-tcode = 'ME23N' OR sy-tcode = 'MASS' OR sy-tcode = 'ME29N'.
      IF srv_esll-matkl IS NOT INITIAL.
        IMPORT header_data-bsart TO v_bsart FROM MEMORY ID 'ZBRT24933'.
        IMPORT header_data-aedat TO v_aedat FROM MEMORY ID 'ZDAT24933'.
        IMPORT re_data-bsart TO v_bsart FROM MEMORY ID 'ZBRT24933'.
        IMPORT re_data-aedat TO v_aedat FROM MEMORY ID 'ZDAT24933'.
        IF v_bsart IS INITIAL OR v_aedat IS INITIAL.
          SELECT SINGLE packno FROM esll INTO v_packno WHERE sub_packno = srv_esll-packno.
          IF sy-subrc EQ 0.
            SELECT SINGLE ebeln FROM ekpo INTO v_ebeln WHERE packno = v_packno.
            IF sy-subrc EQ 0.
              SELECT SINGLE bsart aedat FROM ekko INTO (v_bsart, v_aedat) WHERE ebeln = v_ebeln.
            ENDIF.
          ENDIF.
        ENDIF.
        IF v_aedat GE '20090810'.         " Material group mandatory appplicable date.
          IF ( v_bsart EQ 'SRV' ) OR ( v_bsart EQ 'SRVI' ) OR ( v_bsart EQ 'SRVF' ) AND ( v_bsart NE ' ' )
          AND srv_esll-del = ' '.
            SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = srv_esll-matkl AND
                                                                         bsart = v_bsart.
            IF sy-subrc NE 0.
              MESSAGE e005(ze1).
            ENDIF.
          ENDIF.
          IF ( v_bsart NE 'SRV' ) AND ( v_bsart NE 'SRVI' ) AND ( v_bsart NE 'SRVF' ) AND ( v_bsart NE ' ' )
          AND ( srv_esll-del = ' ').
            SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = srv_esll-matkl .
            IF sy-subrc EQ 0.
              MESSAGE e006(ze1).
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ELSEIF sy-tcode = 'ME21' OR sy-tcode = 'ME22' OR sy-tcode = 'ME23'.
      IF srv_esll-matkl IS NOT INITIAL.
        IMPORT i_ekko-bsart TO v_bsart FROM MEMORY ID 'ZPOT24933'.
        IMPORT i_ekko-aedat TO v_aedat FROM MEMORY ID 'ZDTA24933'.
        IF v_bsart IS INITIAL OR v_aedat IS INITIAL.
          SELECT SINGLE packno FROM esll INTO v_packno WHERE sub_packno = srv_esll-packno.
          IF sy-subrc EQ 0.
            SELECT SINGLE ebeln FROM ekpo INTO v_ebeln WHERE packno = v_packno.
            IF sy-subrc EQ 0.
              SELECT SINGLE bsart aedat FROM ekko INTO (v_bsart, v_aedat) WHERE ebeln = v_ebeln.
            ENDIF.
          ENDIF.
        ENDIF.
        IF v_aedat GE '20090810'.         " Material group mandatory appplicable date.
          IF ( v_bsart EQ 'SRV' ) OR ( v_bsart EQ 'SRVI' ) OR ( v_bsart EQ 'SRVF' ) AND ( v_bsart NE ' ' )
          AND srv_esll-del = ' '.
            SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = srv_esll-matkl AND
                                                                         bsart = v_bsart.
            IF sy-subrc NE 0.
              MESSAGE e005(ze1).
            ENDIF.
          ENDIF.
          IF ( v_bsart NE 'SRV' ) AND ( v_bsart NE 'SRVI' ) AND ( v_bsart NE 'SRVF' ) AND ( v_bsart NE ' ' )
          AND ( srv_esll-del = ' ').
            SELECT SINGLE  *  FROM zmm_mat_grp INTO wa_zmm_mat_grp WHERE matkl = srv_esll-matkl .
            IF sy-subrc EQ 0.
              MESSAGE e006(ze1).
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
    ENDIF.
    hope this will help u.

  • Need code for this checkbox validation

    There are 3 checkboxes on my form cb1,cb2,cb3.I need the code for the below validations..
    if I check the checkbox cb1 then cb2,cb3 should be disabled(grayed, should not allow to
    check). when i unchecked cb1 all 3 boxes should be enabled and then if i check cb2
    then cb1,cb3 should be disabled.
    At any point of time only one checkbox should be checked and
    remaining 2 will be disabled/grayed.
    hope its clear.
    thanks in advance
    Devender

    Hello,
    You can enable/disable your check box items with the:
    Set_Item_Property( 'item_name', ENABLED, PROPERTY_TRUE | PROPERTY_FALSE ) Built-in.
    If Checkbox_Checked( 'chk1' ) Then
       Set_Item_Property( 'chk2', ENABLED, PROPERTY_FALSE ) ;
       Set_Item_Property( 'chk3', ENABLED, PROPERTY_FALSE ) ;
    End if ;
    ...Francois

  • Need code for this Small validation on when-validate-item

    Hi All,
    I have a text item(date datatype) in forms 4.5 I need to do a small validation want to write on when-validate-item. When I enter a date in that text item (Ex 10-JUN-2005) it has to check
    1) It Cannot be "blank"
    2) It cannot be "Not older than today"
    can you please put me code for this small validation. I am new to Forms.
    Thanks in Advance,
    Reddy

    I always put code in the when-validate-RECORD trigger to ensure fields are entered, rather than setting the property. That way, the user can enter other fields within the record, and then gets a message that the field is required only when leaving the record.
    ...of course, if the date item is the only field in the block, then the when-validate triggers will not run unless the user at least types a space in the date. In that case, you need to check in the key-commit trigger.

Maybe you are looking for