Spatial Queries Not Always Producing Accurate Results

Hi,
Spatial queries are not always producing accurate results. Here are the issues. We would appreciate any clarification you could provide to resolve these issues.
1. When querying for points inside a polygon that is not an MBR (minimum bounded rectangle), some of the coordinates returned are not inside the polygon. It is as though the primary filter is working, but not the secondary filter when using sdo_relate. How can we validate that the spatial query using sdo_relate is using the secondary filter?
2. SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT returns true when validating geometries even though we find results that are invalid.
3. Illegal geodetic coordinates can be inserted into a table: latitude > 90.0, latitude < -90.0, longitude > 180.0 or longitude < -180.0.
4. Querying for coordinates outside the MBR for the world where illegal coordinates existed did NOT return any rows, yet there were coordinates of long, lat: 181,91.
The following are examples and information relating to the above-referenced points.
select * from USER_SDO_GEOM_METADATA
TABLE_NAME      COLUMN_NAME      DIMINFO(SDO_DIMNAME, SDO_LB, SDO_UB, SDO_TOLERANCE)      SRID
LASTKNOWNPOSITIONS      THE_GEOM SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .05), SDO_DIM_ELEMENT('Y', -90, 90, .05))      8307
POSITIONS     THE_GEOM SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', -180, 180, .05), SDO_DIM_ELEMENT('Y', -90, 90, .05))      8307
Example 1: Query for coordinates inside NON-rectangular polygon includes points outside of polygon.
SELECT l.vesselid, l.latitude, l.longitude, TO_CHAR(l.observationtime,
'YYYY-MM-DD HH24:MI:SS') as obstime FROM lastknownpositions l where
SDO_RELATE(l.the_geom,SDO_GEOMETRY(2003, 8307, NULL,
SDO_ELEM_INFO_ARRAY(1, 1003, 1),
SDO_ORDINATE_ARRAY(-98.20268,18.05079,-57.30101,18.00705,-57.08229,
54.66061,-98.59638,32.87842,-98.20268,18.05079)),'mask=inside')='TRUE'
This query returns the following coordinates that are outside of the polygon:
vesselid : 1152 obstime : 2005-08-24 06:00:00 long : -82.1 lat : 45.3
vesselid : 3140 obstime : 2005-08-28 12:00:00 long : -80.6 lat : 44.6
vesselid : 1253 obstime : 2005-08-22 09:00:00 long : -80.0 lat : 45.3
Example 2a: Using SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT
Select areaid, the_geom,
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(the_geom, 0.005) from area where
areaid=24
ResultSet:
AREAID THE_GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO,
SDO_ORDINATES) SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(THE_GEOM,0.005)
24 SDO_GEOMETRY(2003, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1), SDO_ORDINATE_ARRAY(-98.20268, 18.05079, -57.30101, 18.00705, -57.08229, 54.66061, -98.59638, 32.87842, -98.20268, 18.05079)) TRUE
Example 2b: Using SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT
Select positionid, vesselid, the_geom,
SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(the_geom, 0.005) from positions where vesselid=1152
ResultSet:
POSITIONID VESSELID THE_GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z),
SDO_ELEM_INFO, SDO_ORDINATES) DO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(THE_GEOM,0.005)
743811 1152 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-82.1, 45.3, NULL), NULL, NULL) TRUE
743812 1152 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-82.1, 45.3, NULL), NULL, NULL) TRUE
743813 1152 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-80.2, 42.5, NULL), NULL, NULL) TRUE
743814 1152 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-80.2, 42.5, NULL), NULL, NULL) TRUE
Example 3: Invalid Coordinate values found in POSITIONS table.
SELECT p.positionid, p.latitude, p.longitude, p.the_geom FROM positions p
WHERE p.latitude < -180.0
2 lines from ResultSet:
POSITIONID LATITUDE LONGITUDE THE_GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
714915 -210.85408 -79.74449 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-79.74449, -210.85408, NULL), NULL, NULL)
714938 -211.13632 -79.951256 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(-79.951256, -211.13632, NULL), NULL, NULL)
SELECT p.positionid, p.latitude, p.longitude, p.the_geom FROM positions p
WHERE p.longitude > 180.0
3 lines from ResultSet:
POSITIONID LATITUDE LONGITUDE THE_GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
588434 91 181 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(181, 91, NULL), NULL, NULL)
589493 91 181 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(181, 91, NULL), NULL, NULL)
589494 91 181 SDO_GEOMETRY(2001, 8307, SDO_POINT_TYPE(181, 91, NULL), NULL, NULL)
Example 4: Failure to locate illegal coordinates by querying for disjoint coordinates outside of MBR for the world:
SELECT p.vesselid, p.latitude, p.longitude, p.the_geom,
TO_CHAR(p.observationtime, 'YYYY-MM-DD HH24:MI:SS') as obstime,
SDO_GEOM.RELATE(p.the_geom, 'determine',
SDO_GEOMETRY(2003, 8307, NULL,SDO_ELEM_INFO_ARRAY(1, 1003, 1),
SDO_ORDINATE_ARRAY(-180.0,-90.0,180.0,-90.0,180.0,90.0,
-180.0,90.0,-180.0,-90.0)), .005) relationship FROM positions p where
SDO_GEOM.RELATE(p.the_geom, 'disjoint', SDO_GEOMETRY(2003, 8307,
NULL,SDO_ELEM_INFO_ARRAY(1, 1003, 1),
SDO_ORDINATE_ARRAY(-180.0,-90.0,180.0,-90.0,180.0,90.0,-80.0,90.0,
-180.0,-90.0)),.005)='TRUE'
no rows selected
Carol Saah

Hi Carol,
1) I think the results are correct. Note in a geodetic coordinate system adjacent points in a linestring or polygon are connected via geodesics. You are probably applying planar thinking to an ellipsoidal problem! I don't have time to do the full analysis right now, but a first guess is that is what is happening.
2) The query window seems to be valid. I don't think this is a problem.
3) Oracle will let you insert most anything into a table. In the index, it probably wraps. If you validate, I think the validation routines will tell you is is illegal if you use the signature with diminfo, where the coordinate system bounds are included in the validation.
4) Your query window is not valid. Your data is not valid. As the previous reply stated, you need to have valid data. If you think in terms of a geodetic coordinate system, you will realize that -180.0,-90.0 and 180.0,-90.0 are really the same point. Also, Oracle has a rule that polygon geometries cannot be greater than half the surface of the Earth.
Hope this helps.

Similar Messages

  • Analog clock MC -- how to produce accurate results?

    I'm using Flash 8.
    I am trying to program an analog clock movieClip -- if any of
    you have seen the UK game show "Countdown", it's a replica of the
    Countdown clock. It's a 30-second clock and the second hand runs
    from top ("12") to bottom ("6").
    My first crack at this has been timeline-based. I've used a
    motion tween to animate the hand moving from top to bottom. My
    movie is set to run at 12fps, but it's only running at ~11.3fps.
    Even though it's a slight deviation, it causes the clock to run
    about 32 seconds instead of 30. Note that during the animation, the
    CPU usage isn't exceeding about 4%.
    I do understand that you can't depend on the Flash Player to
    run at a particular framerate.
    So I changed the logic behind the clock to use setInterval().
    Unfortunately, even my intervals aren't firing at the exact rate
    they need to. I've set the interval to 100ms, but it appears to be
    firing at 110ms or so. Even changing the intervals to a higher
    number (200ms, 500ms) don't produce exact results.
    Any ideas or suggestions on how I can make this work?
    Thanks,
    Curt

    When you say “DAQ express” I assume you mean DAQmx, in
    LabVIEW 7.0 or later. You could go the route of trying to do precise software
    timed stuff, but using WinXP you will always run into the problems that you
    mentioned. Hardware timed, will always be more accurate, but setting up the
    control may be a bit tricky. To program a hardware timed acquisition you can either
    do it explicitly with the DAQmx functions, or you can use the DAQ assistant
    (which is an Express VI). With the DAQ assistant once you drop it down it
    should be pretty straight forward how to configure it, a window will pop and
    you will have to fill in what you want. I would also recommend taking a look at
    some of the shipping examples to get a feel for DAQmx programming without using
    the DAQ assistant. You can find these examples in LabVIEW by going to: Help
    Menu >> Find Example. Then from there: Hardware Input and Output >>
    DAQmx >> Analog Generation. If you look at the examples that are Internally
    Clocked, those will be the easiest to work with initially. Now I am not too
    sure how well this will be for stage control, generally this is done either
    with a motion board or if fine enough control is needed FPGA. But with those
    examples, it should give you a good starting point to work from.
     -GDE

  • Masks not working, producing strange results?...

    Hello, I'm having problems with an animated mask.
    I have a leg graphic (contains 3 tweened leg pieces), and then a gradient.
    In the editor they behave how they should, properly masking the leg. However
    the SWF output produces some crazy results shown below:
    I've tried setting both as movieclips, using the "Layer" blend mode on the leg, using leg.mask = legMask;
    but whatever I try produces the exact same result.
    Any ideas?
    Thanks!

    It sounds like you've applied the Blur filter to the mask instead of the object the Mask is applied to.
    This will blur the masked footage:
    GROUP
         Footage copy
              Mask
              Gaussian Blur
         Footage
    This will blur the edges of the mask:
    GROUP
         Footage copy
              Mask
                   Gaussian Blur
         Footage
    Hope that helps.

  • New (1.5) add(*) method does not always equal to getContentPane().add(*);

    Just came across something people might not be aware of,
    The add(*) method provided in 1.5 does not always produce the same result as getContentPane().add(*)...
    Setting the contentPane (of a JFrame) to a JTabbedPane should mean that when you "add" a component (using the add(somComponent)) you get (according to the documentation) a tab whose text defaults to c.getName(). However, when you call add(someComponent) you get no tab text....changing the call to getContentPane().add(someComponent) brings it back...
    Bit odd....
    Thanks,
    Michael

    I don't use 1.5 so I can't comment, but this months [url http://java.sun.com/developer/JDCTechTips/]Core Java Technology Tech Tip may (or may not) help.

  • Query is not working cant see result always saying no item found

    hi i have created this query to see all systems who have ms word installed on them but its always showing no result other builtin queries working fine but when i create new query its show nothing just no item found i would love if some one help me in this
    matter thanks 
    select SMS_R_System.Name, SMS_R_System.LastLogonUserName, SMS_G_System_SoftwareFile.FileVersion from  SMS_R_System inner join SMS_G_System_SoftwareFile on SMS_G_System_SoftwareFile.ResourceID = SMS_R_System.ResourceId where SMS_G_System_SoftwareFile.FileName
    = "winword.exe" order by SMS_R_System.Name

    How have you configured your Client Settings in the Administration node? The setting called 'Software Inventory' needs to be enabled. If you've just recently enabled it with the default settings, make sure that the client is sending in the data at a schedule
    other than 7 days, unless you want to keep it at the default.
    Also, you'd need to specify which file types that should be inventoried. If I'm not mistaken, by default there's no file types specified.
    Enable this feature with caution, as it could if configured in a bad manner, end up sending a lot of data over the network.
    Regards,
    Nickolaj Andersen | www.scconfigmgr.com | @Nickolaja

  • IWeb Error: "Your search did not produce any results."

    I just updated my iWeb and added the new search and comment features to my iWeb site. I am happy to see these features added but the search feature gives me a page displaying "Your search did not produce any results." Does anyone else have this issue? I am using my .Mac account and did a "Publish all to .Mac" to see if that would help. Comments work great. Can anyone help? Not good to have a feature that does not work.
    Cheers!
    Patrick

    I am having the same problem and can probably give you an answer as to why the search feature is not working...
    Look carefully and you may notice that by re-publishing your site with 1.1, iWeb has converted all text on your site to image files (probably .png). This is what happened when I re-published.
    Therefore, there is technically no text to "search" through...
    No fix as of yet... I will ttry to republish yet again tonight

  • Your search did not produce any results

    Hi,
    I'm publishing my iWeb site to my ME.COM account.
    I have the site password protected as offered in iWeb.
    But when the site is password protected the search with the iWeb search field does not provide any results.
    Only the message:
    "Your search did not produce any results."
    If I disable the password protection for the site in iWeb and republish, the search provides the expected results.
    Any idea what's wrong?
    Thanks and Regards,
    JO

    Sorry, didn't test enough.
    After publishing a few new blog entries under the password protected site, I tested the search again and it does not return any results.
    It was working for a short time when I republished unprotected and then again protected.
    Now that I added block entries under the protected site mode, search is brogen, again.
    Any Help?
    Thanks and Regards,
    JO

  • Having installed aperture 3 and imported iphoto library (15000 photos) Apertue 3 does not render most of my photos corectly most a blurred pixellated and distorted. Reverting to photo produces perfect results. Any suggestions

    Having installed aperture 3 and imported iphoto library (15000 photos) Apertue 3 does not render most of my photos corectly most a blurred pixellated and distorted. Reverting to photo produces perfect results. Any suggestions

    Galdaplh,
    What do you mean by "reverting to photo"?  "Revert" is not a function in Aperture so you must be talking about something else.
    If you just performed the import of that many photos, Aperture will take some time to generate thumbnails.  You can see if it is doing this sort of thing by {Command}-{Shift}-0 to show the Activity window.
    Once Aperture generates all its thumbnails, you will have nearly instantaneous access to much, much better thumbnails than Aperture uses immediately after importing photos.
    nathan

  • HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS

    HI ALL SINCE TWO DAYS I AM DOWNLOADING VIBER BUT I AM NOT HAVING MY ACCESS CODE AND EVERY TIME I DELETE THE APPLICATION AND DOWNLOADING IT AGAIN BUT ALWAYS THE SAME RESULT PLEASE I NEED YOUR HELP FOR THE ACCESS CODE.MY PHONE NUMBER IS 0022996969896.THANKS IN ADVANCE

    try this website this should help you http://helpme.viber.com/index.php?/Knowledgebase/List/Index/1/iphone

  • SQL Query produces different results when inserting into a table

    I have an SQL query which produces different results when run as a simple query to when it is run as an INSERT INTO table SELECT ...
    The query is:
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      The INSERT INTO code:
    TRUNCATE TABLE applicant_summary;
    INSERT /*+ APPEND */
    INTO     applicant_summary
    (  account_number
    ,  main_borrower_status
    ,  num_apps
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      When run as a query, this code consistently returns 2 for the num_apps field (for a certain group of accounts), but when run as an INSERT INTO command, the num_apps field is logged as 1. I have secured the tables used within the query to ensure that nothing is changing the data in the underlying tables.
    If I run the query as a cursor for loop with an insert into the applicant_summary table within the loop, I get the same results in the table as I get when I run as a stand alone query.
    I would appreciate any suggestions for what could be causing this odd behaviour.
    Cheers,
    Steve
    Oracle database details:
    Oracle Database 10g Release 10.2.0.2.0 - Production
    PL/SQL Release 10.2.0.2.0 - Production
    CORE 10.2.0.2.0 Production
    TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    Edited by: stevensutcliffe on Oct 10, 2008 5:26 AM
    Edited by: stevensutcliffe on Oct 10, 2008 5:27 AM

    stevensutcliffe wrote:
    Yes, using COUNT(*) gives the same result as COUNT(1).
    I have found another example of this kind of behaviour:
    Running the following INSERT statements produce different values for the total_amount_invested and num_records fields. It appears that adding the additional aggregation (MAX(amount_invested)) is causing problems with the other aggregated values.
    Again, I have ensured that the source data and destination tables are not being accessed / changed by any other processes or users. Is this potentially a bug in Oracle?Just as a side note, these are not INSERT statements but CTAS statements.
    The only non-bug explanation for this behaviour would be a potential query rewrite happening only under particular circumstances (but not always) in the lower integrity modes "trusted" or "stale_tolerated". So if you're not aware of any corresponding materialized views, your QUERY_REWRITE_INTEGRITY parameter is set to the default of "enforced" and your explain plan doesn't show any "MAT_VIEW REWRITE ACCESS" lines, I would consider this as a bug.
    Since you're running on 10.2.0.2 it's not unlikely that you hit one of the various "wrong result" bugs that exist(ed) in Oracle. I'm aware of a particular one I've hit in 10.2.0.2 when performing a parallel NESTED LOOP ANTI operation which returned wrong results, but only in parallel execution. Serial execution was showing the correct results.
    If you're performing parallel ddl/dml/query operations, try to do the same in serial execution to check if it is related to the parallel feature.
    You could also test if omitting the "APPEND" hint changes anything but still these are just workarounds for a buggy behaviour.
    I suggest to consider installing the latest patch set 10.2.0.4 but this requires thorough testing because there were (more or less) subtle changes/bugs introduced with [10.2.0.3|http://oracle-randolf.blogspot.com/2008/02/nasty-bug-introduced-with-patch-set.html] and [10.2.0.4|http://oracle-randolf.blogspot.com/2008/04/overview-of-new-and-changed-features-in.html].
    You could also open a SR with Oracle and clarify if there is already a one-off patch available for your 10.2.0.2 platform release. If not it's quite unlikely that you are going to get a backport for 10.2.0.2.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Spatial Queries are CPU bound and show very heavy use of query buffers

    Hi,
    Spatial Queries:
    When using tkprof to analyse spatial queries it is clear that
    there are implicit queries being done by Oracle spatial which
    use vast amounts of buffers, and seem unable to cache basic
    information from query to query - thus resulting in our machine
    being CPU bound when stress testing Oracle Spatial, for example
    the example below shows how information which is fixed for a
    table and not likely to change very often is being retrieved
    inefficiently (note the 26729 query buffers being used to do 6
    executions of what should be immediately available!!!):
    TKPROF: Release 8.1.7.0.0 - Production on Tue Oct 16 09:43:38
    2001
    (c) Copyright 2000 Oracle Corporation. All rights reserved.
    SELECT ATTR_NO, ATTR_NAME, ATTR_TYPE_NAME, ATTR_TYPE_OWNER
    FROM
    ALL_TYPE_ATTRS WHERE OWNER = :1 AND TYPE_NAME = :2 ORDER BY
    ATTR_NO
    call count cpu elapsed disk query rows
    Parse 6 0.00 0.01 0 0 0
    Execute 6 0.00 0.01 0 0 0
    Fetch 6 0.23 0.41 0 26729 5
    total 18 0.23 0.43 0 26729 5
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    0 SORT ORDER BY
    0 FILTER
    1 NESTED LOOPS
    1 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 NESTED LOOPS
    290 TABLE ACCESS FULL ATTRIBUTE$
    578 TABLE ACCESS CLUSTER TYPE$
    578 TABLE ACCESS CLUSTER TYPE$
    578 INDEX UNIQUE SCAN (object id 255)
    578 TABLE ACCESS BY INDEX ROWID OBJ$
    578 INDEX RANGE SCAN (object id 35)
    578 TABLE ACCESS CLUSTER USER$
    578 INDEX UNIQUE SCAN (object id 11)
    289 TABLE ACCESS BY INDEX ROWID OBJ$
    578 INDEX RANGE SCAN (object id 35)
    0 TABLE ACCESS CLUSTER USER$
    0 INDEX UNIQUE SCAN (object id 11)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    error during parse of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the
    view
    and again:
    SELECT diminfo, nvl(srid,0)
    FROM
    ALL_SDO_GEOM_METADATA WHERE OWNER = 'NAGYE' AND TABLE_NAME =
    NLS_UPPER('TILE_MED_LINES_MBR') AND '"'||COLUMN_NAME||'"'
    = '"GEOM"'
    call count cpu elapsed disk query
    current rows
    Parse 20 0.00 0.04 0
    0 0 0
    Execute 20 0.00 0.00 0
    0 0 0
    Fetch 20 0.50 0.50 0 5960
    100 20
    total 60 0.50 0.54 0 5960
    100 20
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE) (recursive depth: 1)
    Rows Row Source Operation
    1 FILTER
    2 TABLE ACCESS BY INDEX ROWID SDO_GEOM_METADATA_TABLE
    2 INDEX RANGE SCAN (object id 24672)
    1 UNION-ALL
    1 FILTER
    1 NESTED LOOPS
    1 NESTED LOOPS
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS OUTER
    1 NESTED LOOPS
    1 TABLE ACCESS FULL OBJ$
    1 TABLE ACCESS CLUSTER TAB$
    1 INDEX UNIQUE SCAN (object id 3)
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    1 INDEX UNIQUE SCAN (object id 33)
    0 INDEX UNIQUE SCAN (object id 33)
    0 TABLE ACCESS CLUSTER USER$
    1 INDEX UNIQUE SCAN (object id 11)
    1 TABLE ACCESS CLUSTER SEG$
    1 INDEX UNIQUE SCAN (object id 9)
    1 TABLE ACCESS CLUSTER TS$
    1 INDEX UNIQUE SCAN (object id 7)
    1 TABLE ACCESS CLUSTER USER$
    1 INDEX UNIQUE SCAN (object id 11)
    0 FILTER
    0 NESTED LOOPS
    0 NESTED LOOPS OUTER
    0 NESTED LOOPS
    0 TABLE ACCESS FULL USER$
    0 TABLE ACCESS BY INDEX ROWID OBJ$
    0 INDEX RANGE SCAN (object id 34)
    0 INDEX UNIQUE SCAN (object id 97)
    0 INDEX UNIQUE SCAN (object id 96)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    0 FIXED TABLE FULL X$KZSPR
    0 NESTED LOOPS
    0 FIXED TABLE FULL X$KZSRO
    0 INDEX RANGE SCAN (object id 101)
    error during parse of EXPLAIN PLAN statement
    ORA-01039: insufficient privileges on underlying objects of the
    view
    Note: The actual query being performed is:
    select a.id, a.geom
    from
    tile_med_lines_mbr a where sdo_relate(a.geom,mdsys.sdo_geometry
    (2003,NULL,
    NULL,mdsys.sdo_elem_info_array
    (1,1003,3),mdsys.sdo_ordinate_array(151.21121,
    -33.86325,151.21132,-33.863136)), 'mask=anyinteract
    querytype=WINDOW') =
    'TRUE'
    call count cpu elapsed disk query
    current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.08 0.08 0 4 0 0
    Fetch 5 1.62 21.70 0 56 0 827
    total 7 1.70 21.78 0 60 0 827
    Misses in library cache during parse: 0
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    827 TABLE ACCESS BY INDEX ROWID TILE_MED_LINES_MBR
    828 DOMAIN INDEX
    Rows Execution Plan
    0 SELECT STATEMENT GOAL: CHOOSE
    827 TABLE ACCESS GOAL: ANALYZED (BY INDEX ROWID) OF
    'TILE_MED_LINES_MBR'
    828 DOMAIN INDEX OF 'TILE_MLINES_SPIND'
    CPU: none, I/O: none
    call count cpu elapsed disk query
    current rows
    Parse 1 0.00 0.00 0 92
    Execute 1 0.00 0.00 0 22
    Fetch 1 0.00 0.00 38 236
    total 3 0.00 0.00 38 350
    Misses in library cache during parse: 1
    Optimizer goal: CHOOSE
    Parsing user id: 37 (NAGYE)
    Rows Row Source Operation
    12 TABLE ACCESS BY INDEX ROWID ROADELEMENT_MBR
    178 DOMAIN INDEX
    Rows Execution Plan
    0 SELECT STATEMENT GOAL: CHOOSE
    12 TABLE ACCESS GOAL: ANALYZED (BY INDEX ROWID) OF
    'ROADELEMENT_MBR'
    178 DOMAIN INDEX OF 'RE_MBR_SPIND'
    CPU: none, I/O: none
    Can Oracle improve the performance of Oracle spatial by
    improving the implementation so as to perform alternative
    implicit queries so as not to use these vast amounts of memory?
    Cheers
    Alex Eadie

    Hi Ravi,
    Thankyou for your reply.
    Here are some more details for you:
    Yes the queries are cached in that it gets its data from RAM and
    not from disk however the number of buffers used internally by
    Oracle RDBMS/Spatial is rather large and results in significant
    CPU usage (namely > 5000 per query or >40MByte). Which I'm sure
    you'd agree? Those numerous internal queries taking >10ms CPU
    time each, which is culmulative.
    A single real of ours query of will take between 180ms and 580ms
    depending on the number of results returned.
    An example query is:
    select a.id, a.geom
    from tile_med_lines_mbr a where sdo_relate
    (a.geom,mdsys.sdo_geometry
    (2003,NULL, NULL,mdsys.sdo_elem_info_array
    (1,1003,3),mdsys.sdo_ordinate_array(151.21121,
    -33.86325,151.21132,-33.863136)), 'mask=anyinteract
    querytype=WINDOW') = 'TRUE'
    Our 500Mhz PC Server database can only execute 3 processes
    running these queries simultaneously to go to 100% CPU loaded.
    The disk is hardly utilized.
    The data is the main roads in Sydney, Australia.
    The tables, data and indexes were created as shown below:
    1.     Create the Oracle tables:
    create table tile_med_nodes_mbr (
         id     number not null,
         geom     mdsys.sdo_geometry not null,
         xl     number not null,
         yl     number not null,
         xh     number not null,
         yh     number not null);
    create table tile_med_lines_mbr (
         id     number not null,
         fromid     number not null,
         toid     number not null,
         geom     mdsys.sdo_geometry not null,
         xl     number not null,
         yl     number not null,
         xh     number not null,
         yh     number not null);
    2.     Use the sqlldr Oracle loader utility to load the data
    into Oracle.
    % sqlldr userid=csiro_scats/demo control=nodes.ctl
    % sqlldr userid=csiro_scats/demo control=lines.ctl
    3.     Determine the covering spatial extent for the tile
    mosaic and use this to create the geometry metadata.
    % sqlplus
    SQLPLUS>     set numw 12
    SQLPLUS>     select min(xl), min(yl), max(xh), max(yh)
         from (select xl, yl, xh, yh
              from tile_med_nodes_mbr union
              select xl, yl, xh, yh
              from tile_med_lines_mbr);
    insert into USER_SDO_GEOM_METADATA
         (TABLE_NAME, COLUMN_NAME, DIMINFO)
         VALUES ('TILE_MED_NODES_MBR', 'GEOM',
         MDSYS.SDO_DIM_ARRAY
         (MDSYS.SDO_DIM_ELEMENT('X', 151.21093421,
                   151.21205421, 0.000000050),
         MDSYS.SDO_DIM_ELEMENT('Y', -33.86347146,
                   -33.86234146, 0.000000050)));
    insert into USER_SDO_GEOM_METADATA
         (TABLE_NAME, COLUMN_NAME, DIMINFO)
         VALUES ('TILE_MED_LINES_MBR', 'GEOM',
         MDSYS.SDO_DIM_ARRAY
         (MDSYS.SDO_DIM_ELEMENT('X', 151.21093421,
                   151.21205421, 0.000000050),
         MDSYS.SDO_DIM_ELEMENT('Y', -33.86347146,
                   -33.86234146, 0.000000050)));
    4.     Validate the data loaded:
    create table result
    (UNIQ_ID number, result varchar2(10));
    execute sdo_geom.validate_layer
    ('TILE_MED_NODES_MBR','GEOM','ID','RESULT');
    select result, count(result)
    from RESULT
    group by result;
    truncate table result;
    execute sdo_geom.validate_layer
    ('TILE_MED_LINES_MBR','GEOM','ID','RESULT');
    select result, count(result)
    from RESULT
    group by result;
    drop table result;
    5.     Fix any problems reported in the result table.
    6.     Create a spatial index, use the spatial index advisor to
    determine the sdo_level.
    create index tile_mlines_spind on
    tile_med_lines_mbr (geom) indextype is
    mdsys.spatial_index parameters
    ( 'sdo_level=7,initial=1M,next=1M,pctincrease=0');
    7.     Analyse table:
    analyze table TILE_MED_LINES_MBR compute statistics;
    8.     Find the spatial index table name:
    select sdo_index_table, sdo_column_name
    from user_sdo_index_metadata
    where sdo_index_name in
    (select index_name
    from user_indexes
    where ityp_name = 'SPATIAL_INDEX'
    and table_name = 'TILE_MED_LINES_MBR');
    9.     Analyse spatial index table:
    analyze table TILE_MLINES_SPIND_FL7$
    compute statistics;
    I hope this helps.
    Cheers
    Alex Eadie

  • Old outer join syntax produces different results from new syntax!

    I have inherited a query that uses the old outer join syntax but that is yielding correct results. When I translate it to the new outer join syntax, I get the results I expect, but they are not correct! And I don't understand why the old syntax produces the results it produces. Bottom line: I want the results I'm getting from the old syntax, but I need it in the new syntax (I'm putting it into Reporting Services, and RS automatically converts old syntax to new).
    Here's the query with the old outer join syntax that is working correctly:
    Code Snippet
    SELECT   TE = COUNT(DISTINCT T1.ID),
             UE = COUNT(DISTINCT T2.ID),
             PE = CONVERT(MONEY, COUNT(DISTINCT T2.ID)) / 
                  CONVERT(MONEY,COUNT(DISTINCT T1.ID))
    FROM     TABLE T1, TABLE T2
    WHERE    T1 *= T2
    In this query, much to my surprise, TE <> UE and PE <> 1. However, TE, UE, and PE seem to be accurate!
    Here's the query with the new outer join syntax that is working but not producing the results I need:
    Code Snippet
    SELECT   TE = COUNT(DISTINCT T1.ID),
             UE = COUNT(DISTINCT T2.ID),
             PE = CONVERT(MONEY, COUNT(DISTINCT T2.ID)) / 
                  CONVERT(MONEY,COUNT(DISTINCT T1.ID))
    FROM     TABLE T1 LEFT OUTER JOIN TABLE T2 ON T1.ID = T2.ID
    Though not producing the results I need, it is producing what would be expected: TE = UE and PE = 1.
    My questions:
    1) Can someone who is familiar enough with the old syntax please help me understand why TE <> UE and PE <> 1 in the first query?
    2) Can someone please tell me how to properly translate the first query to the new syntax so that it continues to produce the results in the first query?
    Thank you very much.

    How can we reproduce the issue?
    Code Snippet
    USE [master]
    GO
    EXEC sp_dbcmptlevel Northwind, 80
    GO
    USE [Northwind]
    GO
    SELECT
    TE
    = COUNT(DISTINCT T1.OrderID),
    UE = COUNT(DISTINCT T2.OrderID),
    PE = CONVERT(MONEY, COUNT(DISTINCT T2.OrderID)) /
    CONVERT(MONEY,COUNT(DISTINCT T1.OrderID))
    FROM
    dbo
    .Orders T1, dbo.Orders T2
    WHERE
    T1
    .OrderID *= T2.OrderID
    SELECT
    TE
    = COUNT(DISTINCT T1.OrderID),
    UE = COUNT(DISTINCT T2.OrderID),
    PE = CONVERT(MONEY, COUNT(DISTINCT T2.OrderID)) /
    CONVERT(MONEY,COUNT(DISTINCT T1.OrderID))
    FROM
    dbo
    .Orders T1
    LEFT OUTER JOIN
    dbo.Orders T2
    ON T1.OrderID = T2.OrderID
    GO
    EXEC sp_dbcmptlevel Northwind, 90
    GO
    Result:
    TE
    UE
    PE
    830
    830
    1.00
    TE
    UE
    PE
    830
    830
    1.00
    As you can see, I am getting same results.
    AMB

  • How do I compress a file on a Mac.  I do not see and option to compress a file when I right click on it and the Apple help does not provide and accurate answer

    How do I compress a file on a Mac.  I do not see and option to compress a file when I right click on it and the Apple help does not provide and accurate answer

    Select the file with one click, then go to File in the menu bar and select Compress...
    By the way Niel's post says control - click. This means click with the control key held down. It produces the same result as going to File in the menu bar and selecting Compress...

  • Combining 2 spatial queries into 1

    Hi there. I want to merge two different spatial queries both of which return a single aspect of what I need. The first query returns the distinct group feature ids of all those geometries falling within a specified tolerance of a particular point, i.e. each geometry belongs to one feature id type:
    select distinct a2.cfcc from GEOMETRY_MAP.GEOM_POINT$_TABLE a1,
    attribute_map.landmark_table a2 where SDO_WITHIN_DISTANCE
    (location, (MDSYS.SDO_GEOMETRY(2001, 8265, MDSYS.SDO_POINT_TYPE(-104.9,39.9,null),NULL, NULL)), 'DISTANCE = 10000')='TRUE'
    and a1.land = a2.land order by cfcc;
    The following results are returned (one for each feature id) e.g. D43 is the id for schools but many schools may have fallen within the specified distance:
    CFCC
    D43
    D44
    D61
    D65
    The second query returns the feature ids of geometries AND their distances from the specified point and looks as follows:
    select distinct a2.cfcc, sdo_geom.sdo_distance(location, b.pgeom, 0.005) distance from GEOMETRY_MAP.GEOM_POINT$_TABLE a1, attribute_map.landmark_table a2, (select MDSYS.SDO_GEOMETRY(2001,8265,MDSYS.SDO_POINT_TYPE(-104.9,39.9,null), NULL, NULL) pgeom from dual)b where a1.land = a2.land and SDO_WITHIN_DISTANCE (location, b.pgeom, 'DISTANCE = 10000')='TRUE' order by cfcc, distance;
    The results of this query are:
    CFCC DISTANCE
    D43 4025.459
    D43 5585.05361
    D43 5589.70435
    D61 7770.4209
    D65 6223.59763
    D65 7929.03858
    As you can see the second query returns not just the feature id but the associated distance of each individual feature of that type. What I would like to do is to merge the two result sets so that only the closest individual feature of a particular type and its distance from the input point is returned, i.e. I only need the closest school as oppose to all the closest schools. Any ideas? Thanks a lot, Joe

    Hi Richard. Thnaks for your reply. I should have mentioned that more than one feature type is returned, i.e. not just schools, and so ROWNUM = 1 would not work in this scenario. Any other ideas. Cheers, Joe

  • Dreamweaver 8 - does not always render content correctly when element sizes are specified as %s

    Hi,
    I'm using DW 8 and am changing CSSs to specify element sizes as %s - a move towards responsive design. Browsers that I've tried - Firefox, Chrome, IE and Safari - render the results correctly but DW does not always render correctly: it seems to have particular problems in calculating and showing margins and padding. Does anybody know whether this is a known fault? Am I asking too much of an old version of the system? Or am I missing something else somewhere along the way?
    Thanks,
    Andrew

    andywalmsley wrote:
    Hi,
    Am I asking too much of an old version of the system? Or am I missing something else somewhere along the way?
    Yes, Dreamweaver design view, whilst quite good, did and still does not represent the css you write 100% accurately.
    The more complex the css the less likely it is to render as you would expect.
    I've come to rely less and less on design view over the past months as ways and means of producing websites advance leaving DW some way off the pace, it always has been.
    I have not tested out CC2014 but would suspect its an improvement over past versions at showing css in design view but still behind the curve.

Maybe you are looking for

  • Creative Audigy 4 Pro probl

    <SPAN>I have the speaker system Sven HT-485 and sound card Creative Audigy 4 Pro. As to me correctly to connect all this through the external module of the sound card that worked normally. And I connect that, but through a coaxial and optical there i

  • How do I print a web page and email a link to a web page?

    I cannot print a web page like I could with earlier Firefox versions. Nor can i email a link to a web page. nor can I load google toollbar. i am very disappointed with firefox for not supportring these features.

  • Installing JDK 1.5

    I'm trying to install JDK1.5 update 6 on Redhat Linux 9. I've run the chmod 755 jdk.... command. When I try ./jdk..... it tells me "unable to execute binary. What can I do?

  • Using my old drives from my PPC G5 in my new Intel 3.0  ?

    OK, so I just got my new Intel 3.0 and I simply took my old drives out of my Power PC G5 and put them in my new Intel and they sem to be working fine. Is t ok to do this?? (I hope at this point) Thanks~

  • Premiere Elements 9 for Mac won't let me burn a DVD w. menus to DVD

    So I am trying to burn a DVD with menus for a clinet. I am pretty new to all of this video editing stuff. I am a photographer that has now branced out. I am following all of the instructions in the Classroom in a Book but I noticed a couple of things