Error with SDO_TUNE.EXTENT_OF on a table with more than one geometry.

Hello,
I'm using a GeoServer with Oracle Spatial database, and I run into some problems. GeoServer uses SDO_TUNE.EXTENT_OF to calculate the maximum extent of features you add. It works fine for all object with only one geometry, but fails for objects that has two geometry columns. The error is ORA-01422.
Is this a bug in Oracle, or am I doing something wrong? I know SDO_AGGR_MBR works fine, but I'd rather not use it, since if it is possible I would like to avoid changing the GeoServer functions.
Here is a small script I created to show this error:
1. Create two tables, object1 with one geometry and object2 with two geometry columns.
2. Create metadata (projected coordinate system).
3. Insert two rows, one in each table.
4. Create spacial indices.
5. Calculate extent, on object1 it will succeed, on object2 it will fail.
6. Clean.
CREATE TABLE object1
     id NUMBER PRIMARY KEY,
     geom1 SDO_GEOMETRY
CREATE TABLE object2
     id NUMBER PRIMARY KEY,
     geom1 SDO_GEOMETRY,
     geom2 SDO_GEOMETRY
INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
VALUES
     'OBJECT1',
     'GEOM1',
     2180,
     SDO_DIM_ARRAY
          SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
          SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
VALUES
     'OBJECT2',
     'GEOM1',
     2180,
     SDO_DIM_ARRAY
          SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
          SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
VALUES
     'OBJECT2',
     'GEOM2',
     2180,
     SDO_DIM_ARRAY
          SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
          SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
INSERT INTO object1 VALUES(1, SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(450000, 350000, NULL), NULL, NULL));
INSERT INTO object2 VALUES(1, SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(550000, 450000, NULL), NULL, NULL));
CREATE INDEX object1_geom1_sidx ON object1(geom1) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
CREATE INDEX object2_geom1_sidx ON object2(geom1) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
CREATE INDEX object2_geom2_sidx ON object2(geom2) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
SELECT SDO_TUNE.EXTENT_OF('OBJECT1', 'GEOM1') FROM DUAL;
SELECT SDO_TUNE.EXTENT_OF('OBJECT2', 'GEOM1') FROM DUAL;
SELECT SDO_TUNE.EXTENT_OF('OBJECT2', 'GEOM2') FROM DUAL;
DELETE FROM user_sdo_geom_metadata WHERE table_name IN ('OBJECT1', 'OBJECT2');
DROP INDEX object1_geom1_sidx;
DROP INDEX object2_geom1_sidx;
DROP INDEX object2_geom2_sidx;
DROP TABLE object1;
DROP TABLE object2;
Thanks for help.

Hi,
As a workaound to avoid the ORA-01422 errors, you could try to create views on your object2 table, and insert their geom metadata (with view names as table names!))
create view view2_1 as select * from object2;
create view view2_2 as select * from object2;
INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
VALUES
'VIEW2_1',
'GEOM1',
2180,
SDO_DIM_ARRAY
SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
VALUES
'VIEW2_2',
'GEOM2',
2180,
SDO_DIM_ARRAY
SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
SELECT SDO_TUNE.EXTENT_OF('OBJECT1', 'GEOM1') FROM DUAL;
SELECT SDO_TUNE.EXTENT_OF('VIEW2_1', 'GEOM1') FROM DUAL;
SELECT SDO_TUNE.EXTENT_OF('VIEW2_2', 'GEOM2') FROM DUAL;
Results in 11.1.0.7.0
SDO_TUNE.EXTENT_OF('OBJECT1','GEOM1')(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), S
SDO_GEOMETRY(2003, 2180, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3), SDO_ORDINATE_ARR
AY(450000, 350000, 450000, 350000))
SQL>
SDO_TUNE.EXTENT_OF('VIEW2_1','GEOM1')(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), S
SDO_GEOMETRY(2003, 2180, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3), SDO_ORDINATE_ARR
AY(500000, 400000, 500000, 400000))
SQL>
SDO_TUNE.EXTENT_OF('VIEW2_2','GEOM2')(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), S
SDO_GEOMETRY(2003, 2180, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 3), SDO_ORDINATE_ARR
AY(550000, 450000, 550000, 450000))jack

Similar Messages

  • Error while running spatial queries on a table with more than one geometry.

    Hello,
    I'm using GeoServer with Oracle Spatial database, and this is a second time I run into some problems because we use tables with more than one geometry.
    When GeoServer renders objects with more than one geometry on the map, it creates a query where it asks for objects which one of the two geometries interacts with the query window. This type of query always fails with "End of TNS data channel" error.
    We are running Oracle Standard 11.1.0.7.0.
    Here is a small script to demonstrate the error. Could anyone confirm that they also have this type of error? Or suggest a fix?
    What this script does:
    1. Create table object1 with two geometry columns, geom1, geom2.
    2. Create metadata (projected coordinate system).
    3. Insert a row.
    4. Create spacial indices on both columns.
    5. Run a SDO_RELATE query on one column. Everything is fine.
    6. Run a SDO_RELATE query on both columns. ERROR: "End of TNS data channel"
    7. Clean.
    CREATE TABLE object1
    id NUMBER PRIMARY KEY,
    geom1 SDO_GEOMETRY,
    geom2 SDO_GEOMETRY
    INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
    VALUES
    'OBJECT1',
    'GEOM1',
    2180,
    SDO_DIM_ARRAY
    SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
    SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
    INSERT INTO user_sdo_geom_metadata (table_name, column_name, srid, diminfo)
    VALUES
    'OBJECT1',
    'GEOM2',
    2180,
    SDO_DIM_ARRAY
    SDO_DIM_ELEMENT('X', 400000, 700000, 0.05),
    SDO_DIM_ELEMENT('Y', 300000, 600000, 0.05)
    INSERT INTO object1 VALUES(1, SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(550000, 450000, NULL), NULL, NULL));
    CREATE INDEX object1_geom1_sidx ON object1(geom1) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    CREATE INDEX object1_geom2_sidx ON object1(geom2) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    SELECT *
    FROM object1
    WHERE
    SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
    SELECT *
    FROM object1
    WHERE
    SDO_RELATE("GEOM1", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE' OR
    SDO_RELATE("GEOM2", SDO_GEOMETRY(2001, 2180, SDO_POINT_TYPE(500000, 400000, NULL), NULL, NULL), 'MASK=ANYINTERACT') = 'TRUE';
    DELETE FROM user_sdo_geom_metadata WHERE table_name = 'OBJECT1';
    DROP INDEX object1_geom1_sidx;
    DROP INDEX object1_geom2_sidx;
    DROP TABLE object1;
    Thanks for help.

    This error appears in GeoServer and SQLPLUS.
    I have set up a completly new database installation to test this error and everything works fine. I tried it again on the previous database but I still get the same error. I also tried to restart the database, but with no luck, the error is still there. I geuss something is wrong with the database installation.
    Anyone knows what could cause an error like this "End of TNS data channel"?

  • Spatial index creation for table with more than one geometry columns?

    I have table with more than one geometry columns.
    I'v added in user_sdo_geom_metadata table record for every column in the table.
    When I try to create spatial indexes over geometry columns in the table - i get error message:
    ERROR at line 1:
    ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
    ORA-13203: failed to read USER_SDO_GEOM_METADATA table
    ORA-13203: failed to read USER_SDO_GEOM_METADATA table
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD", line 8
    ORA-06512: at line 1
    What is the the solution?

    I'v got errors in my user_sdo_geom_metadata.
    The problem does not exists!

  • My husband has paired his phone using the remote app to the TV- I would like to do the same with my phone. Can we pair more than one phone to the tv using the remote app ?

    My husband has paired his phone using the remote app to the apple TV- I would like to do the same with my phone. Can we pair more than one phone to the tv using the remote app ?

    Yes I believe so. Try it and see you can always delete the Apple TV from a remote if it messes things up.
    But we have three remotes setup to do this. My iPhone and iPad and my wifes iPhone. She has a different iTunes logon but it seems to work fine

  • I have business and personal e-mail accounts with different contacts. Can I have more than one address book on my iPhone?

    I have business and personal e-mail accounts with different contacts. Can I have more than one address book on my iPhone?

    Set up an additional user account and use one for work and one for personal stuff - each will have a separate address book. Turn on fast user switching for easy switching between the two.
    AK

  • With iphoto it is possible to order more than one book at once?

    With iphoto it is possible to order more than one book at once? If yes, what can it be done? Thanks

    thank you! Another question regarding iphoto. I would like to disable the 'faces' feature as I don't use it nor wish to use it and I feel it slows down the program when I import a large quantity of pictures. How can I disable this feature?

  • VLD-0201:Table has more than one primary key

    hi
    i'm working with OWB 9.2,I was imported the table from database,when i validating that it is giving message:
    VLD-0201:Table has more than one primary key
    vld-0209:Duplicate unique key i.e:cust_acc and SYS_C00435 detected.
    Can i use this table and generate the mapping with out any errors?
    Any help will be very generate.

    Hi Ashok,
    I'm quite curious how you managed to get a table with 2 PK's.
    I tried it myself:
    =======================================================
    SQL>create table x(c1 number constraint pk1 primary key,c2 number constraint pk2 primary key, c3 date);
    create table x(c1 number constraint pk1 primary key,c2 number constraint pk2 primary key, c3 date)
    ERROR at line 1:
    ORA-02260: table can have only one primary key
    SQL>ed
    Wrote file afiedt.buf
    1* create table x(c1 number constraint uk1 unique,c2 number constraint uk2 unique, c3 date)
    SQL>/
    Table created.
    =====================================================
    As you can see, trying to create a table with more than 1 PK is impossible. With Unique Key, that IS possible (see second example).
    I don't expect mappings to function properly with such an error message.
    Is it possible for you to drop the table in the database, correct the definition of the table in OWB and then deploy that corrected version to the database?
    If on the other hand the table on the database is correct (i.e. has only one PK) then the import into OWB obviously did not go well and I'd suggest you drop the imported definition and try to import it again.
    Cheers, Patrick

  • How to add the rows formatted as table headings, Tables headings are repeated when a table spans more than one page.

    Hi all,
    i am facing problem while generating Test Result word document after successful execution of TestStand.
    The Problem is :
    i want to add rows Formatted as table headings, table headings are repeated when a table spans more than one page(marked as Red).
    Example:
    Page  No. 1
    |     Test case Number  |  Test Step number      |
    |      100                         |            100                   |
    Page  No. 2
    |     Test case Number  |  Test Step number      |
    |      200                         |            300                   |
    Test Result word document should generate with Table headings(marked as Red) in every pages of the document, but i am not getting as per above example.
    Please through light on this.
    Regards,
    Susa.

    Hi Santiago,
    Thank you very much for your valuable reply.
    i want to generate MS-word report for TestStand after successful testing using MS-word2000.
    Test report contains Actual values, Expected values and Pass/Fail status.
    In my program i have customized all  fields i can able to generate test report which contains Verification engineer name , test mode, test date, start time, end time Actual values, Expected values and Pass/Fail status.etc....
    To put all values of test case number, Test step number, Actual values, Expected values and Pass/Fail status in to table for each time, i will
    insert a row into table every time values arrives, once the table exceedes its page size it moves to the next page, next page should start with table row header  but it start with  values of above said parameters.
    so i'm not able to repeat table row header for each page.
    Please find the attached file for your reference.
    Attched file expected.doc  :   This file contains what i wanted to generate MS-word report. Here table row header "Test Case Number and Test Step Number " is repeated in second page.
    Attached file Actual output from source code.doc   :  This report generated from the source code. Here table row header "Test Case Number and Test Step Number" is not repeated in second page.
    Do you know any property to set "repeat as header row at the top of each page" using MS-word ActiveX in CVI/Labwindows.
    i think this information is sufficient for you,
    Still if you need some information please ask me.
    Thanks
    Susa.
    Attachments:
    Actual output from source code.doc ‏25 KB
    expected.doc ‏26 KB

  • Populating more than one table and more than one field

    I need some suggestions and this forum has always been a great source of good advice.
    I have a web form at the following location: http://www.webdevpractice.com/genoptix/CE/register.php
    Here's what the web form needs to do:
    Send a confirmation email listing seminars the visitor checked on the form.
    Create a similar message on a confirmation page.
    Populate 2 two tables.
    Items 1 and 2 are working fine.
    The advice I need is on how to populate two tables in the database.
    There are three tables:
    ACCOUNTS
    account_id
    first_name
    last_name
    medtech_id
    job_title
    npi
    company
    city
    state
    email
    phone
    contact
    ATTENDANCE
    attendance_id
    account_id
    seminar_id
    SEMINARS
    seminar_id
    seminar
    speaker_first_name
    speaker_last_name
    date
    The web form contains data that need to go into the ACCOUNTS table and the ATTENDANCE table. The challenge is getting the account_id and seminar_id into the ATTENDANCE table. If all the information was inserted properly, I could write a query that revealed who was taking what seminar.
    Inserting data into the ACCOUNTS table is not a problem. I will create another form to insert information into the SEMINARS so that should not be a problem. But inserting the account_id and the seminar_id is what I am wondering about. Also, can more than one record be inserted in a table? If an user checks more that one seminar, each seminar (seminar_id) would need to be inserted in the ATTENDANCE table as separate records along with the account_id. I'm thinking I may have to do this manually. Also, the values for each seminar are their dates and titles. I used these as values to send the confirmations.
    I'm just looking for advice at this point. Is this doable?

    Bregent,
    The table I am wondering about is the ATTENDANCE table. There are two fields in addition to the primary key: account_id and seminar_id. The field I am concern with is the seminar_id which comes from a group of checkboxs on the form. So, one form could create several records. For example, presently there are three seminars that are offered. If the visitor selects all three seminars, that would create three records in the SEMINARS table. So, it might look like this:
    attendance_id     account_id     seminar_id
         1                    1                    1
         2                    1                    2
         3                    1                    3
    My PHP skills are basic. I've done other forms and use PHP in other ways. But I have never had to populate several rows in one table with an array of checkboxes nor have I be able to find an example of this.
    So the advice I am seeking (and perhaps this is premature) is this:
    Can one field from a table populate more than one record?
    Should I set up checkboxs as a group or individually with a different name?
    I am also considering setting up my tables differently so there is a table from each seminar--that may solve my problem.

  • How can I sort a table using more than one column in Numbers or in Pages?

    How can I sort a table using more than one column in Numbers or in Pages?

    Hi Ron,
    On the right side of the Toolbar click the Sort and Filter button, then select Sort.
    You can then set up a multiple column sort.
    Click Add A Column, Specify the sort for that column, Repeat.
    Jerry

  • CS3: Table on more than one page - How can I get the UIDRef's of the pages?

    Hi
    I have a table over more than one page. How can I get all UIDRef's of the pages who contain parts of the table?
    Thanks
    Hans

    Hi
    Thanks for the answer.
    - How can I get all page items of a table?
    - One other question: If I have a table over two pages (side by side) there is only one page item of the table. Right? How can I get the two pages (UIDRef) in that case?
    Thanks
    Hans

  • Error message "Transfer date 30.06.2007 is more than one year after the clo

    Hi SAP expert,
    I received error message "Transfer date 30.06.2007 is more than one year after the closed fiscal year" - message number AC 187. Used Tcode OAAQ when tried to reverse year end closing for depreciation area. How can i correct this problem? I want to finish for the whole year 2007 depreciation.
    Hope u guys can help me. Thanking u in advance.
    Regards,
    Nazrul

    Hi SAP experts,
    any solution for my porblem?
    TQ

  • IPad - with movie clips - how can I play more than one at a time?

    iPad2.  I post short movie clips via iTunes to the Photo catagory.  I can play each of these clips by selecting the clip and pressing the start arrow, only the selected clip will play.  How can I select a group of movie clips and have them play with only one selection.  Like a "slide show" but for movie clips???

    More than one contacts at a time

  • How to display(binding) values in the table from more than one node?

    Hi,
    I have two nodes (TRIPS & AMOUNTS)in the context. How to bind these values into the table control?
    When i bind second one, first one is getting replaced.

    Hi Mog,
    Of course it is possible to create a table from attributes of more than one node, and in some cases this is still necessary, but you have to do this the hard (manual) way.
    If you have a table control, have a look at the properties and the elements belonging to it.
    First of all, there is the property "dataSource", which binds to a multiple node (let's name it TableRootNode). This means that for each element of THIS node, one row is created. In each row the data of exactly one element of this TableRootNode is displayed.
    Then you have columns in this table. Inside of the columns there is a header and an editor. The editor is the interesting part.
    Normally the primary property of this editor is bound to an attribute of the TableRootNode. Then everything works as expected. If it binds to an attribute of a subnode (SUB) of TableRootNode, then in row i the data of the subnode of the i-th element of TableRootNode is displayed. There is no need for SUB to be a multiple node, but it must not be a singleton.
    If you bind a property of the editor to an attribute, which does not lie in the subtree of TableRootNode, then you will see the same value in each row.
    Now it depends on the structure of your context. Take the node, which is relevant for the change in each row (I assume it is TRIPS) and bind the table to the node as you are used to. Then for each additional column, you have to create a new column in the tree, create a new header element with a title and a new editor (e.g. textview or inputfield) and then bind the right property of the editor to the corresponding attribute in node AMOUNTS).
    If these 2 nodes do not have parent-child-relationship, the tip to create a new node, which consists of the attributes of both nodes is the only solution.
    Ciao, Regina

  • Logical table having more than one Logical table sources

    Hi ,
    Is it possible a logical table has 2 logical table sources and there is no join between the underlying table of logical table sources?
    What will happen if we create the request which contains one attribute from each source?
    Will BI server return records with Cartesian join?
    Is it mandatory if logical table is having more than one logical table sources(exp. Logical table sources are X,Y and underlying table is A,B respectively),
    The underlying tables (A&B) must be joined ?
    Can someone explain the logic behind the logical table sources? How does it work?
    Any reference of document will be appreciable.
    Thanks,Ashish

    Hi Stijn,
    Thanks for response.
    You are saying that Oracle BI server will run a query against both tables and combine the results. But if there is no possibilty of any type of join, how BI server will combine the results from both tables.
    I have a scenario like below -
    Suppose i have 2 tables A and B at physical layer. Both table contains the information of any common subject area.
    But there is no attribute is common between A and B so not any kind of join possible between two.
    Now if i create a logical table with 2 logical table source A and B and create any request having one column from A and one from B ,
    What will happen? How BI server will combine the result? Will BI server not result records after Cartesian join.
    How can i model this scenario?

Maybe you are looking for

  • Building in carriage returns using Report Query

    I am using Report Querys and Report Layouts. I am trying to build in some carriage returns that will be recognized in my rtf template. I tried using 'chr(10)', br's etc, but it doesn't work. It prints the characters instead of doing the carriage retu

  • TRM: doubts in interest rate instrument and Business partner

    Dear all, While implementing Treasury Risk Management, in order to fulfill my clientsu2019 needs I have three questions regarding, 1. Interest rate instruments, 2.Leasings and 3.Business partners. 1.When creating a contract of an interest rate instru

  • SSIS 2012 - Double quote charcter in data does not allow to load flat file to source component

    Hello everyone, I've created a source component for flat file data. This file contains data the column data in double quotes. Like, First Name Last Name "Ankit"       "Shah" The text qualifier is double quote for source file connection.  When I do ha

  • Online Store or Retail Store?

    As I plan to buy a new Mac Pro I am curious... if you order online you can customize the computer to your specifications. Can one do this in an Apple retail store too or do you buy it "as-is"?

  • Please help me with my zen MX.

    Hi Ive had my MX for almost a year now and havent had any problems with it till now. I tried to turn it on this morning and it kept freezeing so i tried to turn it off and nothing. I pressed the reset button and now it wont turn on or do anything it