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

Similar Messages

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

  • How do I export an animation from Photoshop with no background, to use in after effects?

    Its been a few years since I've used photoshop and after effects together so hoping you can remind me how to do this.
    I'm trying to export an animation created in photohop, its frame by frame, no background. I've been exporting it as an image sequence, now I"ve coloured it I need to solve this transparency issue.
    Is there a way to export it to use in after effects on top of a background layer.
    So I just want to see the character, no background, animation on top of my background layer in after effects, does that make sense??
    Please don't say I need to have an alpha channel on each frame, that will take ages, there must be another way.
    Please help I need to sort this ASAP
    Thanks in advance!
    x

    Thanks!
    So this makes sense, I tried it, when I import into after effects (here is the psd.)
    I get this window not sure what to be selecting, but I tried different things and it still isn't importanting as literally the animation with no background, have I missed something? whats strange is that when I import the psd, what does import is a strange monatage of snippets of the video I'm making in afterfx, not the completely separate animation i made in photoshop which I'm trying to work into the video.
    very perplexing! any more help is much appreciated.
    Thanks

  • Can i use purchased sound effects off iTunes in an iOS app? - copyright issue

    basically I'm making an iOS app, and i need a sound effect that i purchased off the iTunes store, aka from some company. Can i use this sound effect in my app without being sued a lot of money? If i payed for the file i should be okay correct?

    Hello Aidan,
    Here is the statement from the Terms and Conditions of the iTunes Store:
    "You shall be authorized to use iTunes Products only for personal, noncommercial use."
    We do not give legal advice on this Forum, but I think the statement is pretty clear.

  • HP 15-d030nr: What Upgrades Do I Need To Make In Order To Be Able To Use Adobe After Effects CS6?

    HP 15-d030nr, what upgrades do I need to make in order to be able to use adobe after effects cs6?
    I installed Adobe After Effectss CS6 because I was told by HP Support that it would still work; it doesnt.  It is very slow, and locks up bad.  What upgrades do I need to do, or am I looking at having to go buy another labtop?  Also, can I do these upgrades myself - at what cost?
    **HP 15-d030nr**
    Hardware
    Product Name 15-d030nr
    Product Number F5X99UA
    Microprocessor 2.0GHz Intel Pentium N3510 Processor
    Microprocessor Cache 2MB L2 Cache
    Memory 4GB DDR3L SDRAM (1 DIMM)
    Memory Slots 2 user accessible
    Video Graphics Intel HD graphics
    Display 15.6-inch diagonal HD BrightView LED-backlit touchscreen display (1366x768)
    Hard Drive 500GB 5400RPM hard drive
    Multimedia Drive SuperMulti DVD burner
    Network Card 10/100BASE-T Ethernet LAN (RJ-45 connector)
    Wireless Connectivity 1x1 802.11b/g/n WLAN
    Sound HD Audio with stereo speakers
    Keyboard Full-size island-style keyboard with numeric keypad
    Pointing Device Touchpad supporting multi-touch gestures without on/off button
    External Ports Multi-format digital media card reader for Secure Digital cards 1
    SuperSpeed USB 3.0
    2 Universal Serial Bus (USB) 2.0
    1 HDMI
    1 VGA (15-pin)
    1 RJ-45 (LAN)
    1 Headphone-out/microphone-in combo jack Dimensions 1.11 in (H) x 14.88 in (W) x 10.20 in (D) Weight 4.96 lb Power 45W AC adapter
    3-cell 31WHr 2.8Ah lithium-ion polymer battery ID Mech Description Front facing HP TrueVision HD Webcam with integrated digital microphone
    **After Effects CC (2014) system requirements and language versions Windows**
    Intel Core2 Duo or AMD Phenom II processor with 64-bit support
    Microsoft Windows 7 with Service Pack 1, Windows 8, or Windows 8.1
    4 GB of RAM (8 GB recommended)
    5 GB of available hard-disk space; additional free space required during installation (cannot install on removable flash storage devices)
    Additional disk space for disk cache (10 GB recommended)
    1280 x 1080 display
    OpenGL 2.0–capable system
    QuickTime 7.6.6 software required for QuickTime features
    Optional: Adobe-certifi ed GPU card for GPU-accelerated ray-traced 3D renderer
    Internet connection and registration are necessary for required software activation, validation of subscriptions, and access to online services.*
    *I also have a 1TB external hardrive*
    This question was solved.
    View Solution.

    Your problem is that the program wants a good video card and a fast hard drive and lots of memory and you have none of the above. If you upgraded the RAM to 8 gigs and installed a solid state hard drive you might make the program useable but the real bottleneck  is going to be the Intel HD graphics, which cannot be upgraded. 
    You do have an open slot to add one 4 gig memory module. This is an easy relatively inexpensive upgrade. See here:
    https://www.youtube.com/watch?v=L7FvZ-JduRM
    http://www.crucial.com/usa/en/ct51264bf160b
    I would try this a step at a time. Next would be the solid state drive. That would cost maybe $150. Post back if you need more help. 
    If this is "the Answer" please click "Accept as Solution" to help others find it. 

  • How do I find and use the "Spotlight Effect" in PS6?

    How do I find and use the "Spotlight Effect" in PS6?  I was using it yesterday and now I can find it ... help!

    Hi,
    I'll start with the most basic qusetion if you have Spot selected from the dropdown in the Lighting Effects Properties.
    There are also some presets under Presets including a Default Setting.

  • How to use SDO_GEOM.WITHIN_DISTANCE with a geodetic CRS and degree as unit?

    Hi,
    I am trying to use SDO_GEOM.WITHIN_DISTANCE on geodetic data, but I don't want to use meter as unit for the tolerance. I thought I simply can set the unit to 'Degree', but this does not work:
    select SDO_GEOM.WITHIN_DISTANCE(
    MDSYS.SDO_GEOMETRY('POINT(0 0)', 4326),
    +11,+
    MDSYS.SDO_GEOMETRY('POINT(0 10)', 4326),
    +0.00000000005,+
    +'unit=Degree') from dual;+
    ORA-13291: conversion error between the specified unit and standard unit
    ORA-06512: at "MDSYS.SDO_3GL", line 985
    ORA-06512: at "MDSYS.SDO_GEOM", line 1034
    ORA-06512: at "MDSYS.SDO_GEOM", line 1049
    ORA-06512: at line 1
    +13291. 00000 - "conversion error between the specified unit and standard unit"+
    *Cause:    Cannot convert the specified unit from/to standard unit+
    for linear distance, angle, or area.
    *Action:   Check the unit specification and respecify it.+
    What am I doing wrong?
    Update: How is the specified unit used? Is WITHIN_DISTANCE trying to convert my 10 degree into a meter value? Because then I would understand why it is not working.
    Thanks,
    Tobias
    Edited by: tsauerwein on May 19, 2010 11:23 PM

    HI Tobias,
    "Degree" is an angle unit, not a distance unit of measurement. For within_distance operations you must use a valid distance unit, which are defined in sdo_dist_units view.
    if you indeed want to represent a distance unit in "decimal degree", you may try to define one for that by yourself.
    regards
    Jeffrey

  • Using GB Guitar Effects

    I've been using the GB Guitar Effects, but they take up soooo much memory that I can't add more instruments or tracks without it freaking out.
    Is there a way to make this work? Do i need an external hard drive to be able to make every track play in real time without GB stopping the playback? This drives me nuts. I would like to be able to use the GB effects and record a bunch of tracks without problems.
    PLEASE HELP!!!

    You should use a external drive. You should lock tracks you're not working. More RAM is very helpful. And if you need record tracks dry and add effects later.

  • In Captivate 8, how do I insert a text animation. It is grey scale and therefore can't be selected. I also want to use a "typing" effect.

    In Captivate 8, how do I insert a text animation. It is grey scale and therefore can't be selected. I want to use animation and also want to use a "typing" effect.

    Hi there
    What is your project type? Responsive? If so, that's why animation is disabled. Animations are usually built in Flash and Responsive output doesn't "do" Flash.
    Cheers... Rick

  • I have purchased a macbook air with 64 gb hard disk. the available space is only 10gb. With this available space, i can't use the system effectively. kindly advise.

    I have purchased a macbook air with 64 gb hard disk. the available space is only 10gb. With this available space, i can't use the system effectively. kindly advise.

    You should have bought one with a larger SSD. You can regain some space by disabling the sleepimage file:
    To disable safe sleep, run the two following commands in Terminal:
    $ sudo pmset -a hibernatemode 0
    $ sudo nvram "use-nvramrc?"=false
    When done, restart your computer. Now go delete the file "/private/var/vm/sleepimage" to free up some hard drive space. When you put your computer to sleep it, should happen in under five seconds; my MacBook now goes to sleep in two seconds.
    [robg adds: To state the obvious, with safe sleep disabled, a total power loss will wipe out whatever was open on your machine. To enable safe sleep mode again, repeat the above commands, but change hibernatemode 0 on the first line to hibernatemode 3, and =false to =true on the second line. You'll then need to reboot again. Personally, I prefer the safe sleep mode, even with the slower sleep time and hard drive consumption -- even if for no other reason than it's great when changing batteries on a flight.]
    You can also delete unneeded files:
    Freeing Up Space on The Hard Drive
      1. See Lion/Mountain Lion's Storage Display.
      2. You can remove data from your Home folder except for the /Home/Library/ folder.
      3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
      4. Also see Freeing space on your Mac OS X startup disk.
      5. See Where did my Disk Space go?.
      6. See The Storage Display.
    You must Empty the Trash in order to recover the space they occupied on the hard drive.
    You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
    Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located.

  • Use Photo Booth effects in FaceTime?

    Can you use Photo Booth effects in FaceTime?
    Thanks in advance.

    Not with just FaceTime on it's own. However if you would like to get technical you can use a 3rd party app such as CamTwist you can use special effects. If you would like help with that or have any other questions let me know. :-)

  • Can I use adobe after effects with my project from premiere elements

    Wondering if I can use adobe after effects with my premiere elements project

    drunner
    What version of Adobe After Effects do you have?
    Whatever the case, I have not found any Adobe After Effects documentation that include a Premiere Elements project.prel file as a supported import choice.
    I suspect that you are going to have to export your Premiere Elements Timeline as a .mp4 file with a After Effects supported compression into After Effects.
    But, I would ask in the Adobe After Effects Forum just to double check.
    After Effects
    More later.
    ATR

  • I have the Photoshop Elements 11 and when I use the stamp effect the image becomes totally black. It used to have my line drawing in white, now, just a black image. I need the stamp effect. also, most other effects simply crash the program.

    I have the Photoshop Elements 11 and when I use the stamp effect the image becomes totally black. It used to have my line drawing in white, now, just a black image. I need the stamp effect. also, most other effects simply crash the program.

    Which operating system are you using?
    Some filters like Filter>Sketch>Stamp need to have two different colors for the Foreground and Background set in the toolbox.
    Press the D key to set the default toolbox color swatches to Black and White and then try the Stamp filter.
    If your using mac os x 10.9 or 10.10, then some of the filters under Filter>Sketch will crash pse 11
    They are Filter>Sketch>Comic, Graphic Novel and Pen and Ink
    Otherwise resetting the pse11 editor preferences might resolve the crashing.
    Go to Photoshop Elements Editor(Edit)>General, click on Reset Preferences on Next Launch and then restart the pse 11 editor

Maybe you are looking for

  • Problem executing an Online Form in Web DynPro(Adobe Form)

    Gurus, I am trying to create an Online Form in Web DynPro(Adobe Form), i could successfully create the form and deploy it. But when i executed, i am getting the below error. << com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Error during

  • How to use case when in Select qry?

    Hi Friends, I want to use Case when in Select qry, my situation is like this SELECT bmatnr blgort bj_3asiz bmat_kdauf b~mat_kdpos        SUM( ( case when bshkzg = 'S' then bmenge else 0 END ) -         ( case when bshkzg = 'H' then bmenge else 0 END

  • Error Message while installing Reader 9.4

    I am currently using Windows XP and am getting the following error message when installing Adobe Reader 9.4: Error 1402. Could Not open Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\OptionalComponents\MSFS. Verify that you hav

  • Know a good hosting service with Mac interface in Australia?

    I want to create a website from a template, for selling jewelry, and wondered if anyone could recommend a web hosting service in Australia that supports Mac OS X. Hopefully I can buy a domain name, create a website from a template, and subscribe to t

  • SMS through SAP B1

    Can someone help me in SDK codes for sending SMS from SAP B1. Can i get the sample source code for the same. I also want to know can i use the SMS Message dynamically. Thanks & Regards Shiv