SDO_RELATE gives strange results. Bug?

If I use the mask = inside for a given query, I get lines 69 and = overlapbdyintersect mask I get 15 ranks.
But if I use the mask = inside + overlapbdyintersect, I have only 50 lines.
And then if I use UNION ALL, for speed as indicated in the manual, I get 84 lines as a result if I combine the two.

Isn't this a little odd?
No explanation for this kind of behavior?

examples:
Inside (69) + OVERLAPBDYINTERSECT (15) = 50 (strange)
Count (S_ID) map SELECTION. BYGG_POLY
where
SDO_RELATE (GEOM, SDO_UTIL. FROM_WKTGEOMETRY
* (' Polygon ((441029.298070891 6445795.42259877, 441320.756519155 6445767.05053744, 441318.177240852 6445527.17765524, 441029.298070891 6445795.42259877)) "), *.
* "(masque = INTÉRIEUR + OVERLAPBDYINTERSECT') ="TRUE"*"

Inside (69) + OVERLAPBDYINTERSECT (15) = 84 (Correct)
SELECT card S_ID. BYGG_POLY
where
SDO_RELATE (GEOM, SDO_UTIL. FROM_WKTGEOMETRY
* (' Polygon ((441029.298070891 6445795.42259877, 441320.756519155 6445767.05053744, 441318.177240852 6445527.17765524, 441029.298070891 6445795.42259877)) "), *.
* "(masque = à l'INTÉRIEUR ') ="TRUE"*"
UNION ALL
SELECT card S_ID. BYGG_POLY
where
SDO_RELATE (GEOM, SDO_UTIL. FROM_WKTGEOMETRY
* (' Polygon ((441029.298070891 6445795.42259877, 441320.756519155 6445767.05053744, 441318.177240852 6445527.17765524, 441029.298070891 6445795.42259877)) "), *.
* "(masque = OVERLAPBDYINTERSECT') ="TRUE"*"

And here is a set of data that applies to the questions above, for sql loader (sqlldr)
[bygg_poly.sql | http://www.4shared.com/file/130099592/40e86c5/bygg_poly.html]
[bygg_poly.ctl | http://www.4shared.com/file/130099618/2e445b8a/bygg_poly.html]

Your data set (table BYGG_POLY) was 1054 invalid geometries.

Index of the Oracle and Oracle Spatial 11 g recommended:
http://www.Oracle.com/technology/products/spatial/PDF/spatial_wp09_bestprac.PDF
has talked about validation of the geometry.

For example, you can use the following sql code to fix your invalid geometries:

Update BYGG_POLY
geom value = sdo_util.rectify_geometry (geom, 0.001)
where sdo_geom.validate_geometry_with_context (geom,.001)! = "TRUE";

Note rectify_geometry checks the following problems that can make an invalid geometry
and the problems in the geometry returned bugs:

Duplicate vertices
Limit of polygon cutting himself
Incorrect orientation of exterior or interior rings (or both) of a polygon

After that, the query with "mask = inside ' returns of 69 lines,"
"mask = OVERLAPBDYINTERSECT' returns 42 lines."
"= INSIDE + OVERLAPBDYINTERSECT mask ' returns 111 lines."

And notice an outside ring polygon must be specified in the order in the opposite direction:
SDO_UTIL. FROM_WKTGEOMETRY (' Polygon ((441029.298070891 6445795.42259877, 441318.177240852 6445527.17765524, 441320.756519155 6445767.05053744, 441029.298070891 6445795.42259877)) ")

Tags: Database

Similar Questions

  • MONTHS_BETWEEN gives strange results. What is the logic behind this?

    Hello

    Why third and fourth queries displays values less than 1?

    SELECT MONTHS_BETWEEN (TO_DATE('28-FEB-2011'),

    TO_DATE('01-FEB-2011')) FROM DUAL; -0.870967741935484



    SELECT MONTHS_BETWEEN (TO_DATE('28-FEB-2011'),

    TO_DATE('31-JAN-2011')) FROM DUAL; -1



    SELECT MONTHS_BETWEEN (TO_DATE('28-FEB-2011'),

    TO_DATE('30-JAN-2011')) FROM DUAL; -0.935483870967742?



    SELECT MONTHS_BETWEEN (TO_DATE('28-FEB-2011'),

    TO_DATE('29-JAN-2011')) FROM DUAL; -0.967741935483871?



    SELECT MONTHS_BETWEEN (TO_DATE('28-FEB-2011'),

    TO_DATE('28-JAN-2011')) FROM DUAL; -1

    My understanding is that, for the first and the second query, oracle considers only 28 days in February and for the rest of the queries, oracle considers only 31 days in January. But even then, when you look at the output, it is not look great!

    If the user asks about me, I'll have to give at least a stupid escape response!

    There is another logic behind it?

    Sébastien Thomas

    Check out this link.

    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:53374949268527

    Concerning

    REDA

  • strange result of Left Join 11 GR 2.

    It is a strange result of Left Join
    Why the result is 0 record?
    select * from v$version;
    
    BANNER
    -------------------------------------------------------
    Oracle Database 11g Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0      Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    Select * From
    (Select 1 aaa From DUAL) A
    LEFT JOIN
    (Select 2 bbb From DUAL Where '1' IN ('2','3')) B
    ON A.aaa = B.bbb;
    
    no rows selected
    Old Left Join syntax does not work, too :-(
    Select * From
    (Select 1 aaa From DUAL) A,
    (Select 2 bbb From DUAL Where '1' IN ('2','3')) B
    where A.aaa = B.bbb(+);
    
    no rows selected

    Aketi Jyuuzou wrote:
    It is a strange result of Left Join
    Why the result is 0 record?

    I guess that the rewrite of the query with the optimizer is the origin of the problem.
    Say the 10053 trace? I don't have access to the database 11 GR 2 now to test.
    You can see if the advice of line NO_REWRITE or NO_QUERY_TRANSFORMATION gives the desired result.

  • Satellite L10 and keyboard:-shift key gives wrong results

    Using the SHIFT key with most of other than a-z keys gives bad result.
    I tried to re - install a driver via Control Panel / keyboard with the Toshiba XP Home CD inserted but not better driver is found.
    Control Panel / regional and language setting is English UK

    Hello, Alan

    It will be nice if you can give us more information. What specific keyboard of the country you have? What you want to do exactly? Give us a few examples please.

  • Strange results in "organize bookmarks".

    Hi people,
    I'm having a strange result when I opened "Organize Favorites".
    I do not get the actual list, but rather, only 3 URL in the right pane (name, etc.) and Nothing in the left pane.
    I have topped up the bookmarks via the function "Import/Backup" from 2 different sources, I use to back up important applications and files, both with the same results. Namely an external hard drive and a USB key. And, Yes, I always check these files with applications of virus, malware and software spies/bot after save it!
    Any ideas there? I have several years to build these bookmark and I go nuts trying to go up this list! < VBG >
    I have a screenshot of this mess that can be seen at:
    Favorite screenshot (Please hold down the CTRL key to see in a new tab)
    Thanks in advance... Mark

    This may be a problem with the places.sqlite file that stores the bookmarks and history.

  • LEFTOUTER join querry which gives bad result

    Hello

    I have tables like below.when I perform a left outer join issue IDs and startdate he gives invalid results.when I write in request

    It does not correct result because there is no data for 16 jan. It should give no results. But it shows all records. How do I solve this problem

    SQL:

    Select a.id, a.date, b.val, a.tot, b.net, b.cre

    FROM table1 a

    join table2 b left

    "on a.id = b.id and a.date = b. and a.date ='02-Feb-2014."

    In the tables below contains no data for the month of February but still im getting the incorrect data. He must not returnany files right?

    Table1:

    IDDateValtot
    1January 1, 1319
    22 January 1338
    33 January 1347
    4January 4, 1356
    55 January 1365

    Table2:

    IDDateNETCRE
    1January 1, 1319
    213 January 1338
    33 January 1347
    4January 4, 1356
    55 January 1365

    "It should not returnany files right?

    Wrong, there is no where clause so it should return all the records in a padded with NULL values for b.

  • REGEXP_REPLACE return strange results and eliminating duplicate characters

    I try using REGEXP_REPLACE to remove all the characters that is not a letter or a number, but I get strange results. It seems to eliminate duplicate characters. The result varies also with the order of the boss. How can I solve this?

    SELECT REGEXP_REPLACE(p_str,'[^[:digit:]][^[:alpha:]]','.') FROM (SELECT 'AAA bb' double p_str);

    > AA.bb

    SELECT REGEXP_REPLACE(p_str,'[^[:alpha:]][^[:digit:]]','.') FROM (SELECT 'AAA bb' double p_str);

    > AAA.b

    Oracle Database 11 g Release 11.2.0.3.0 - 64 bit Production

    to remove all characters which is not a letter or a number

    You can try (it's more flexible for alphabets and numbers)

    [^ [: alnum:]]

    See you soon,.

    Manik.

  • Math.Sin (Math.pi) strange result

    Hello

    In my AE expression Math.sin (Math.PI) gives a result of 1.22E - 16, instead of the zero wait.

    Anyone know why?

    Looks like it is JavaScript, not the implementation of EI:

    JavaScript Math.cos and Math.sin are inaccurate. Is there a solution? -Stack overflow

    Dan

  • ASCIISTR function that gives different results

    Hi Experts,

    I use the function ASCIISTR and it gives different results in SQLPLUS and TOAD

    SQLPLUS
    SQL> SELECT ASCIISTR('é') UC FROM DUAL
      2  ;
    
    UC
    -----
    \201A
    
    SQL> SELECT ASCIISTR('ú') UC FROM DUAL;
    
    UC
    -----
    \00A3
    TOAD
    SELECT ASCIISTR('ú') UC FROM DUAL
    
    \00FA
    
    SELECT ASCIISTR('é') UC FROM DUAL
    
    \00E9
    I know experts here will be reluctant to respond to questions about the TOAD, but I wanted to understand if I'm missing something. I checked the NLS_SESSION_PARAMETERS in SQLPLUS and TOAD, and they are the same. :-(does not understand this behavior

    Version of database Oracle Database * 10g Enterprise Edition Release 10.2.0.3.0 - 64 bit Production *.

    Thanks in advance!

    The default code for the command line page is 437, identical to TOAD, you want to get the code page 1252

    SQL> host chcp
    Active code page: 437
    
    SQL> SELECT ASCIISTR('é') UC FROM DUAL;
    
    UC
    _____
    \201A
    
    SQL> host chcp 1252
    Active code page: 1252
    
    SQL> SELECT ASCIISTR('é') UC FROM DUAL;
    
    UC
    _____
    \00E9
    
    SQL>
    
  • Strange results, keying on green screen using Keylight

    Hello

    I am before a green screen using keylight. When I look at the 'Status' view in keylight, I notice a strange result that I can't solve. Inside of the massif of the matte (actor) his field of pants and shoes are filled with clear green dots. They seem to be the cause of distortion on my final rendering.

    Any adjustments I make to the matte I don't to get rid of these. I have attached a few GIFs to display question.

    Anyway is to remove these points so that they are 'solid' within the matte or a way to fix the colours them inside the massif of the matte in the final result?

    Any advice would be greatly appreciated.

    Kind regards

    That's what options despot in the section matte screen for. Other options include Minimax, Simple dog collar or plug-ins from third parties such as Re: fill of RevisionFX. Also take advantage of the various options to control your rollback Alpha levels.

    Mylenium

  • strange results in the calculation

    Hello

    I need another pair of eyes, or maybe another brain here: a miniature of a large area, I want to calculate the position of an object from the position in the big screen. The calculation is
    original pos / large size of the area * size small area
    I think it should be good to get the relative position in the small screen.
    However, Flash comes up with some strange results:
    (20 + 5000) / (2 * 5000) * 119 = 2439.5
    This should result in 59.738 for this calculation. The code for this looks like this:

    OMC._x = (omc.x + this.controlr.MAX) / (2 * this.controlr.MAX) * this.display.width;

    where omc.x is the x position in the big screen (here 20), MAX is 5000, 2 * MAX is the full size (the point 0,0 is in the Middle, so he has 10000 big), and the small screen is display.width.
    Values seem to be right; the calculation above (20 + 5000...) has been traced from the code. However, the result is totally wrong, and I have no idea why. Any ideas on that?


    blemmo

    Oh... just realized the numbers came as strings... so it all seemed well in the trace, but calculation of strings with numbers is not very accurate...

    Heck... I remember using the debugger more often.

    see you soon,
    blemmo

  • Record of strange results

    Hi all

    I came across a strange situation with a movie file sent by one of our colleague. The file is attached here. The results have been achieved for non-existing steps in the sequence 'Test '. See the attached picture. There is no single step in the sequence 'Test' even then results are saved. Please help me understand why there are results in the absence of measures to the title sequence 'Test '. Is this a bug in the TS? or something else.

    Sequence is saved in f1 TS 2012 SP1.

    Thank you

    JKV

    It's because someone changed the ResultList of your sub Test sequence.  They added 4 items in there.  Delete the and you will not see this more.

    TestStand basic rule: never touch Locals.ResultList manually!

    Kind regards

  • Mouse click strange focus bug - Office steals focus?

    Hello!

    I have a bug very strange, not so easy to explain.

    Sometimes, when I click on a window he will LOSE focus and therefore each click will make any update to the point of losing application.
    The only way to give a keyboard app at least the development of alt - tab to it, or activate other than by the keyboard.
    Currently there is a click anywhere, focus is no longer.
    On the desktop I can't click on the taskbar, it is as there is not the focus, but I can click on the icons on the desktop and can ' show ' this selection rectangle.

    The only way I know to get back to normal (except reconnect or restart) is by pressing ctrl + alt + delete, then click on he evokes in this new 'window'. It's somehow "normal" mouse again, so I can click Cancel and continue the work.

    First encountered this problem on Sunday while playing with Windows Movie Maker. Back then the only method I knew was reconnection, so I rather formatted the hard drive and reinstalled Windows7 (Professional), I was pretty shocked when he realized is always the same.

    Could not say what makes it appear, it is while using different applications etc, seems fairly random.

    I use a 2 monitor Setup. Disable the 2nd monitor does not solve the problem, after its appearance.

    Any ideas what may cause this? Maybe graphics card failure? I don't think it's the driver because the error reappears before reinstalling the latest ATI drivers.
    The similar problem only I could find has a post on the forum long long on a similar issue in Windows XP, and there is no answer at all.

    Thank you very much.

    Certainly not a problem of material for me.  Things are better when I killed the explorer.exe (using the Task Manager).

    In the Task Manager, I noticed that there are two instances of Flash Player running. Kill them does not solve everything, but once again, the behavior has been slightly less successful.  It turned out that I had both Flash 12 and 14 Flash installed. Then I uninstalled both and this is!  Everything was jake.

    All the bad behavior had disappeared. Altogether.

    I ran a few days like that and then reinstalled Flash 14.  Everything is always OK.

    Why the Flash configuration didn't remove the old version?  Cannot answer for you. All I can say is I'm happy again.

  • SDO_FILTER which gives weird results

    Hi people,

    Not sure if this is a bug or maybe I'm just not see something simple. On 11.2.0.4. I have an area of the area of interest and a line next door representing a piece of water, the two geometries validate the tolerance of 5 centimeters.
    http://www.dziemiela.com/june27.PNG
    The box is more than a mile away from the stream. The flow is relatively small and its MBR is no where close to touch the area. However, according to SDO_FILTER, two geometries are TRUE. I'm puzzled. So I wrote the mess for anyone wishing to give it a shot. I'll be back

    Streamy is valid? TRUE
    Véronique is valid? TRUE
    Basic SDO_GEOM. RELATE? DISJOINT
    Distance between 1795.19857225394 M
    MIL SDO_GEOM. RELATE? DISJOINT
    Distance between 1794.97512096382 M
    SDO_RELATE County 0
    SDO_FILTER County 1

    If two geometries are distance of 1.7 km and their members are distance of 1.7 km. I would like to say very clearly that these things shouldn't interact. Right? However, filter gives TRUE. Am I a something Klutz?

    Thank you
    Paul
    DECLARE
       sdo_streamy SDO_GEOMETRY := SDO_GEOMETRY(2002,8265,NULL,SDO_ELEM_INFO_ARRAY(1,2,1),SDO_ORDINATE_ARRAY(-77.6495001234516,38.9423350727726,-77.6482987901201,38.9418092727734,-77.6468049234557,38.9413522727742,-77.6461311901235,38.9413982061074,-77.6438177901271,38.942107872773,-77.6427925901286,38.9423368727726,-77.6423533234627,38.9422912727727,-77.6410643234647,38.9417884061068,-77.6406835234653,38.9416968727736,-77.6403321234658,38.9417886061068,-77.6394825901338,38.9417886727735,-77.63760792347,38.9414232061074,-77.6370221234709,38.9410114727747,-77.6357033901397,38.9392504727774,-77.6352933234736,38.9389760727778,-77.6347071901412,38.9380154727793,-77.6313675901464,38.9348822727842,-77.6301375234816,38.9342876061185,-77.6295517234825,38.9336930061194,-77.6294929901493,38.9335098727863));
       sdo_boxy SDO_GEOMETRY := SDO_GEOMETRY(2003,8265,NULL,SDO_ELEM_INFO_ARRAY(1,1003,1),SDO_ORDINATE_ARRAY(-77.6087382736728,38.9295533233688,-77.4229814409148,38.9295533233688,-77.4229814409148,39.0744969598833,-77.6087382736728,39.0744969598833,-77.6087382736728,38.9295533233688));
       num_result NUMBER;
    BEGIN
       dbms_output.put_line('Streamy is valid? ' || SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(sdo_streamy,0.05));
       dbms_output.put_line('Boxy is valid? ' || SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(sdo_boxy,0.05));
       dbms_output.put_line('Basic SDO_GEOM.RELATE? ' || SDO_GEOM.RELATE(sdo_streamy,'DETERMINE',sdo_boxy,0.05));
       dbms_output.put_line('Distance Between ' || SDO_GEOM.SDO_DISTANCE(sdo_streamy,sdo_boxy,0.05) || 'M');
       dbms_output.put_line('MBRs SDO_GEOM.RELATE? ' || SDO_GEOM.RELATE(SDO_GEOM.SDO_MBR(sdo_streamy),'DETERMINE',SDO_GEOM.SDO_MBR(sdo_boxy),0.05));
       dbms_output.put_line('Distance Between ' || SDO_GEOM.SDO_DISTANCE(SDO_GEOM.SDO_MBR(sdo_streamy),SDO_GEOM.SDO_MBR(sdo_boxy),0.05) || 'M');
       EXECUTE IMMEDIATE 'CREATE TABLE streamy (shape SDO_GEOMETRY)';
       EXECUTE IMMEDIATE 'INSERT INTO streamy (shape) VALUES (:p01)' USING sdo_streamy; COMMIT;
       INSERT INTO user_sdo_geom_metadata(table_name,column_name,diminfo,srid) VALUES 
       ('STREAMY','SHAPE',MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X',-180,180,.05),MDSYS.SDO_DIM_ELEMENT('Y',-90,90,.05)),8265); COMMIT;
       EXECUTE IMMEDIATE 'CREATE INDEX streamy_spx ON streamy(shape) INDEXTYPE IS MDSYS.SPATIAL_INDEX';
       EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM streamy a WHERE SDO_RELATE(a.shape,:p01,''MASK=ANYINTERACT'')=''TRUE''' INTO num_result USING sdo_boxy;
       dbms_output.put_line('SDO_RELATE Count ' || TO_CHAR(num_result));
       EXECUTE IMMEDIATE 'SELECT COUNT(*) FROM streamy a WHERE SDO_FILTER(a.shape,:p01)=''TRUE''' INTO num_result USING sdo_boxy;
       dbms_output.put_line('SDO_FILTER Count ' || TO_CHAR(num_result));
    END;
    /

    Hi Paul,.

    For geodetic geometry, R-tree index are in 3D. For example, you can see:

    SQL> select sdo_index_name, SDO_ROOT_MBR from user_sdo_index_metadata;
    
    SDO_INDEX_NAME
    --------------------------------
    SDO_ROOT_MBR(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINAT
    --------------------------------------------------------------------------------
    STREAMY_SPX
    SDO_GEOMETRY(3008, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 1007, 3), SDO_ORDINATE_ARR
    AY(.16636, -.759816, .628418, .166646, -.759754, .628538))
    

    sdo_boxy is converted to:
    SDO_GEOMETRY (3008, NULL, NULL, SDO_ELEM_INFO_ARRAY (1, 1007, 3), SDO_ORDINATE_ARR)
    AY (. 166589,-. 759798,.628364,.169393,-. 757698,.630331))

    If the two MBR or minimum limit boxes (MBBs) intersect.

    Thank you
    Ying

  • Strange results of variables

    I wrote a simple example of the use of variables for a class, using trace() to show results. The film consists of three fields and a button. Once these data are met, I am running the trace() rollin above the button function. I get this way is a bit strange and something that I've never met before. This is the result I get in the output window.
    "< p align ="left"> < / p > < p align ="left"> < / p > < p align ="left"" > < / p > ""
    Each of the input fields are assigned variables and adds a new variable togeter.
    var together_var:String = firstName_var + lastName_var + id_var
    Can someone tell me whats going on?
    Thank you

    Using variables is not the best way - instead of give your instance fields
    the names and then do: instanceName.text

    Otherwise, as kglad suggested and turn off the html property for the
    field.

    --
    Dave-
    Developer leader
    www.blurredistinction.com
    Adobe Community Expert
    http://www.Adobe.com/communities/experts/

Maybe you are looking for