Spatial - SDO_AGGR_UNION question.

I have extracted geo spatial informaton from a document and created sdo_geometry objects of different types in my database. I have polygons, points, lines, ellipsis, and multipoint types of gtypes. I am trying to aggregate them using SDO_AGGR_UNION. this is sql I am running - the dxc.xml_id is the id of my document which all of the rows have):
select SDO_AGGR_UNION(SDOAGGRTYPE(dxc.shape_geo, 0.005)) from DOCUMENT_GEO dxc where dxc.xml_id = 374;
I get this error:
ORA-29913: error in executing ODCIAGGREGATEITERATE callout
ORA-13031: Invalid Gtype in the SDO_GEOMETRY object for point object
ORA-13031: Invalid Gtype in the SDO_GEOMETRY object for point object
29913. 00000 - "error in executing %s callout"
*Cause:    The execution of the specified callout caused an error.
*Action:   Examine the error messages take appropriate action.
I am thinking that spatial only support aggregating points with points, polygons with polygons, lines with lines, etc. Can anyone confirm this. The documentation isn't clear. If you can aggregate points with other things I would love to know how its done. Thanks.

Your question is better off @ the Spatial Forum: Spatial

Similar Messages

  • SDO_AGGR_UNION Question

    I have extracted geo spatial informaton from a document and created sdo_geometry objects of different types in my database. I have polygons, points, lines, ellipsis, and multipoint types of gtypes. I am trying to aggregate them using SDO_AGGR_UNION. this is sql I am running - the dxc.xml_id is the id of my document which all of the rows have):
    select SDO_AGGR_UNION(SDOAGGRTYPE(dxc.shape_geo, 0.005)) from DOCUMENT_GEO dxc where dxc.xml_id = 374;
    I get this error:
    ORA-29913: error in executing ODCIAGGREGATEITERATE callout
    ORA-13031: Invalid Gtype in the SDO_GEOMETRY object for point object
    ORA-13031: Invalid Gtype in the SDO_GEOMETRY object for point object
    29913. 00000 - "error in executing %s callout"
    *Cause: The execution of the specified callout caused an error.
    *Action: Examine the error messages take appropriate action.
    I am thinking that spatial only support aggregating points with points, polygons with polygons, lines with lines, etc. Can anyone confirm this. The documentation isn't clear. If you can aggregate points with other things I would love to know how its done. Thanks.

    680275,
    . . . .Multipoints appear to be supported.
    . . . .NOTE: the multipoint you listed was missing an EIA-tuple that identifies the last coordinate.
    SQL> INSERT INTO foobar (geometry) VALUES (
          MDSYS.SDO_GEOMETRY(2005, 40986, NULL,
          MDSYS.SDO_ELEM_INFO_ARRAY(
                1,1,1,
                3,1,1,
                5,1,1,
                7,1,1), -- "this was the missing EIA tuple"
          MDSYS.SDO_ORDINATE_ARRAY(
                1,2, --"point 1, EIA 1,1,1"
                3,4, --"point 2, EIA 3,1,1"
                1,2, --"point 3, EIA 5,1,1"
                3,4) --"point 4, EIA 7,1,1"
    SQL> SELECT t.geometry.sdo_gtype FROM foobar t;
                  2003  --"polygon"
                  2001  --"point"
                  2005  --"multipoint"
                  2002  --"line"
    4 rows selected.
    SQL> SELECT SDO_AGGR_UNION(SDOAGGRTYPE(geometry, 0.005)) from foobar;
    SDO_GEOMETRY(
        2004,
        40986,
        NULL,
        SDO_ELEM_INFO_ARRAY(
            1,2,1,
            5,1,3,
            11,1005,3,
                11,2,1,
                39,2,2,
                43,2,1),
        SDO_ORDINATE_ARRAY(
            6075668.22,2231086.91,6075754.6,2231132.45,
            1,2,3,4,  --"look familiar?"
            6061788.51,2165302.52,6067373.34,2283448.5,
            6067415.28,2283445.98,6067462.25,2283443.2,
            6067512.2,2283440.25,6067557.15,2283437.6,
            6067608.88,2283434.54,6067732.73,2283427.23,
            6067762.67,2283425.46,6067781.78,2283422.04,
            6067867.37,2283406.71,6067995.22,2283383.8,
            6068124.42,2283360.66,6068253.62,2283337.51,
            6068382.8,2283314.38,6068390.77,2283312.95,
            6068424.34,2283441.03,6068477.6,2283562.25,
            6068069.52,2283742.62,6068073.71,2283852.77,
            6067842.68,2283848.42,6067586.81,2283843.86,
            6067448.96,2283841.22,6067373.34,2283448.5)). . . .NOTE: the unioning (in sdo_aggr_"UNION") is probably why the duplicate coordinates in the multiple-point geometry were omitted from the aggregate.
    Regards,
    Noel

  • Oracle Spatial performance question

    All,
    I am doing a performance test on Oracle 11g Spatial. I am simulating doing searches in 10 degree by 10 degree windows over 6M+ images, six arc minutes per side. Here is my spatial query construction:
    String intersectSQL = "SELECT A.name, A.GEOMETRY.Get_WKT() " +
    "FROM six_amin_polygons A " +
    "WHERE SDO_RELATE(A.GEOMETRY,?, " +
    "'mask=inside+coveredby+overlapbdyintersect')='TRUE'";
    where the question mark is replaced by the geometry structure of the search window. The results for the first few searches are fast, then the query times balloon very quickly. PostGIS/PostgreSQL performs these searches in an average time of 30 s per window.
    Here are the initial (first four rows) of Oracle Spatial results:
    area_idx area_name sql_query_time number_results
    0 S80.0W90.0 3890 10100
    1 S80.0W80.0 3124 10100
    2 S80.0W70.0 186484 10100
    3 S80.0W60.0 183077 10100
    Any ideas? Am I using the best mask for image/area intersection? Please advise.
    Thanks,
    Jeff

    With anyinteract you get
    inside+coveredby+overlapbdyintersect+touch
    since you are comparing polygons to polygons.
    Do you want polygons that touch the window geometry in the result ? Do you want all the geometries
    that have some kind of intersection with the window query ? Then you should use ANYINTERACT mask.
    siva

  • Update a "point" table with the poly_id the point belongs to

    Sorry, I'm re-posting this message as I initially included in my previous question!
    Hi,
    Dan, thanks for your help on "improving performance in loading spatial data" question.
    Yes, after droping the spatial index it worked much quicker!
    Now I have another problem with the table I've managed to populate at a decent speed (with your help!)
    There is a column, poly_id which is the polygon the point belongs to. There is another table that stores all the polygons.
    I tried the following PL/SQL code but again, it takes ages to run, regardless of having the table indexed or not.
    So the tables are
    Measurements - unit_id, start_time,relative_time,meas_point,meas_type,dv_id,poly_id
    and
    areas - poly_id,poly_name,polygon,layer
    And the code is
    PROCEDURE upd_meas
    IS
    CURSOR pos_cur IS
    SELECT * FROM measurements;
    BEGIN
    FOR pos_rec IN pos_cur LOOP
    UPDATE measurements SET poly_id = (select poly_id from areas a WHERE layer='MAR'
    and mdsys.sdo_filter(a.polygon,pos_rec.meas_point,'querytype=WINDOW' ) = 'TRUE'
    and rownum =1)
    WHERE relative_time=pos_rec.relative_time
    AND meas_type=pos_rec.meas_type
    AND unit_id=pos_rec.unit_id;
    COMMIT;
    END LOOP;
    END;
    Any hint on how to improve the performance? I've also tried sdo_relate without any difference in the execution time.
    With thanks in advance,
    Silvia

    Hi Silvia,
    Is there an index on the layer column in the areas table? If so, you may want to use the noindex hint
    so it doesn't get used instead of the spatial index. For more info on hints check the Oracle doc for
    Designing an Tuning for Performance.
    I would use SQL*PLUS to prototype getting a fast response from a filter or relate call (only - not in the context
    of the update statement), then use that syntax in spatial portion of the pl/sql update statement.
    The spatial portion of the query to test might look something like this:
    select /*+NO_INDEX(a layer_idx_name) */  poly_id from areas a WHERE layer='MAR'
    and mdsys.sdo_filter(a.polygon,pos_rec.meas_point,'querytype=WINDOW' ) = 'TRUE'
    and rownum =1;
    or
    select /*+ index (a polygon_spatial_idx_name) */...
    Hope this helps,
    Dan

  • Georaptor for sqldeveloper and jdeveloper ?

    Hi,
    georaptor is an add in for sqldeveloper to handle spatial data.
    question: can georaport be used as add in for JDeveloper, and - if so - how to install it ?
    Leo

    If you are building a Java extension, then you can port them relatively easily between the two as SQL Developer is built on the JDev IDE. Extensions do need to be adapted for whether they go into JDev or SQL Developer, but there are a few customer extensions available for both.
    If you have specific technical questions regarding this, then pose those and the developers will get back to you.
    SQL Developer is now available in JDeveloper. You can download the latest JDeveloper 11g (Beta) release to see this.
    (There is also a SQL Developer plugin now available for Eclipse. This is an early adopter release.)
    Sue

  • Triger an external procedure

    First, I am not sure I am in the correct place.
    I need to find a way to detect change in table row. I would like to use a trigger for that. But I would like to run a script while detecting a change, and not update any table.
    Thanks,
    Lior
    null

    Hi Lior,
    This technical forum is only for Oracle
    Spatial related questions.
    Please post non-spatial questions to
    metalink, or contact Oracle customer support
    directly.
    Thanks.
    Dan
    null

  • Spatial Query - sdo_aggr_union

    Hi
    I am a newbie to oracle spatial (Database 11g) and am having an issue with sdo_aggr_union
    i have the following cursor
    CURSOR get_buffer_union IS
    SELECT sdo_aggr_union(sdoaggrtype(coverage,0.5)) coverage
    FROM
    (SELECT sdo_aggr_union(sdoaggrtype(coverage,0.5)) coverage
    FROM
    (SELECT sdo_aggr_union(sdoaggrtype(coverage,0.5)) coverage
    FROM
    (SELECT sdo_aggr_union(sdoaggrtype(coverage,0.5)) coverage
    FROM
    (SELECT sdo_aggr_union(mdsys.sdoaggrtype(geom,0.5)) coverage
    FROM rep_geo_acc_buffer
    where extraction_date = trunc(sysdate)
    GROUP BY mod(rownum,128))
    GROUP BY mod (rownum, 32))
    GROUP BY mod (rownum, 8))
    GROUP BY mod (rownum, 2)
    The result i am getting back is null. If I run the inner statement i get back 128 rows. Is it possible that this result is being held in cache and this is not the true result or is there someting wrong with the query.

    Wellcome to OTN Forums!
    Why you are using GROUP BY inner GROUP BY?
    What is your logic?
    CURSOR get_buffer_union IS
    SELECT sdo_aggr_union(sdoaggrtype(coverage,0.5)) coverage
    FROM
    (SELECT sdo_aggr_union(sdoaggrtype(coverage,0.5)) coverage
    FROM
    (SELECT sdo_aggr_union(sdoaggrtype(coverage,0.5)) coverage
    FROM
    (SELECT sdo_aggr_union(sdoaggrtype(coverage,0.5)) coverage
    FROM
    (SELECT sdo_aggr_union(mdsys.sdoaggrtype(geom,0.5)) coverage
    FROM rep_geo_acc_buffer
    where extraction_date = trunc(sysdate)
    GROUP BY mod(rownum,128))
    GROUP BY mod (rownum, 32))
    GROUP BY mod (rownum, 8))
    GROUP BY mod (rownum, 2)
    );

  • Spatial Frequently Asked Questions: request for content

    Hi All,
    In several discussions it has been mentioned that it would be nice to have a place where we could have the answers to frequently asked questions, so that we could refer to them and they could be found easily.
    I have taken the liberty to ask in the Community Feedback (No Product Questions) space the question how we could best do that, and we'll be getting help from Laura Ramsey. Hence my question: Which questions and answers should go into our FAQ? I'll do a bit of searching, just to see if I can find the frequent topics, but one thing should be in there first and foremost I think: Links to the online Spatial docs for version 11 and 12. That way we can easily refer people to the docs, which usually is already a big help. Probably some stuff about SRID's and that sort of thing, because that always sparks discussions, indexing and the metadata maybe?
    I'll post here what my searches turn up, anybody has any other ideas please post them here for easy collecting.
    Cheers,
    Stefan

    If you still have an issue after  reading the links above then please post your question as a new post rather than posting here or in one of the referenced posts.
    New posts in this thread will be moved to new threads as appropriate.
    For the best results in getting answers to your questions the post "Want Good Answers?  Ask Good Questions!" may help.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • I have a question - Does Oracle BI in cloud has visualisation like Heat map, tree map , spatial map ? In general what are the additional visualisation as compared to OBIEE if any , thanks

    I have a question - Does Oracle BI in cloud has visualisation like Heat map, tree map , spatial map ? In general what are the additional visualisation as compared to OBIEE if any , thanks

    I have a question - Does Oracle BI in cloud has visualisation like Heat map, tree map , spatial map ? In general what are the additional visualisation as compared to OBIEE if any , thanks

  • Newbie spatial question. coordiante point without srid

    Hi;
    I have some datas; they should be coordinates but i couldnt analyse them becouse they seem meaningless for me.
    (2001, , (3146506.63299122, 4386524.44436437, 0), , )
    this data means 36:48.371N 028:15.933E but icouldnt understand how to convert..
    i got the data from db, i got the result from software that uses this db.
    as i read the documentation (2001,?,(...... question mark tells the format of data, but my data is null as you see.
    can u please show the way out?
    thanks
    sorry i am new th these stuff.

    Hi,-
    you can always use NULL SRID.
    The geometry in Oracle Spatial is described as follows in SQL:
    SDO_GEOMETRY(2003, --> GTYPE
    NULL, --> SRID
    NULL, --> SDO_POINT (IGNORED HERE)
    SDO_ELEM_INFO_ARRAY(1, 1003, 1), --> YOUR GEOMETRY'S COMPONENTS
    SDO_ORDINATE_ARRAY(5, 1, 8, 1, 8, 6, 5, 7, 5, 1)) --> YOUR GEOMETRY'S COORDINATES
    Which format are you converting from?
    Have you read Oracle Spatial User's Guide?
    I strongly recommend to read it.
    Hope this helps
    best regards
    baris

  • *Directions Webinar-Followup Questions-Retail Analytics-Oracle Spatial

    Thanks to all who joined today's Directions Media webinar, "Retail Analytics in an Enterprise Cloud with Oracle Spatial and Oracle Site Hub". If you have followup questions that we did not have time to address during the live webinar, please post them here. Thanks.

  • Post Questions here-Today's webcast- BI  & Spatial & Predictive Analytics

    If you have followup questions from today's Directions webinar (Learn How to Use Oracle’s Spatial and BI Tools for Location-aware Predictive Analytics), please post here. Thanks.

    If you would like to share your OBIEE and OBIA knowledge and experiences, please submit your proposals below:
    http://submissions.miracd.com/ioug2010/login.asp
    Collaborate 2010 (april 18-22) will have a special focus on BI => "Get Analytical with BIWA Training Days"

  • Very basic question Oracle spatial query

    Hi All,
    Iam a newbie to oracle spatial.
    How can i verify that oracle spatial is installed in my database.
    My database is version is 10.2.0.2.0
    Is there any special query i can execute to test oracle spatial is working properly / installed properly.
    All the finctionality oracle spatial is working properly
    Thanks in advance.
    baskar k

    Spatial     VALID     10.2.0.2.0
    I got this message on executing this query
    +++++++++++++++++++++++++++++++
    SELECT comp_name, status, substr(version,1,10) as version
    from dba_server_registry
    where comp_name = 'Spatial';
    ++++++++++++++++++++++++++++++++

  • Question about "Spatial Index Advisor"

    I'm now using "Oracle8i Enterprise Edition 8.1.6" and "Oracle8i Enterprise Manager 2.1" for Windows NT/2000. I tried to use the extended administration tool of the Manager "Spatial Index Advisor" to access my spatial data. I can see the layers in the "Add layer" Dialog. But when I want to add a layer, it popup a failed message box said "Server object could not be created:Server object could not be initialized:Not be supported charaterset:oracle-characterset-852". Why? And how can I solve the problem?

    Hi Dinghy,
    The Oracle 8.1.6 sdo advisor is only implemented for the US7ASCII character set.
    The Oracle 8.1.7 release of the advisor does have NLS support.
    Hope this helps. Thanks.
    Dan
    null

  • Question on changing the owner of spatial datatype

    create table test4 (
    COL1 NUMBER(38) NOT NULL,
    COL14 SCOTT.SDO_GEOMETRY
    ) TABLESPACE USERS;
    SQL> select table_owner, table_name FROM all_synonyms where synonym_name='SDO_GEOMETRY'
    OMETRY';
    TABLE_OWNER TABLE_NAME
    SCOTT SDO_GEOMETRY
    I want to change the owner of SDO_GEOMETRY to MDSYS. I know re-creating the table like "COL14 MDSYS.SDO_GEOMETRY" will get what i'm
    looking for but is there a way to ALTER the table to achieve the same without re-creating it?
    Thanks,
    Rajesh

    user11919950,
    . . . .If you're just messing around on a test machine, then give this a spin:
    -- "Identify obj# in table named obj$ for SDO_GEOMETRY owned by MDSYS
    select
       obj#,
       t.OBJECT_NAME,
       u.USERNAME,
       o.OWNER#
    from       sys.obj$ o,
       dba_users u,
       dba_objects t
    where      u.USER_ID = o.OWNER# (+)
    AND o.name = 'SDO_GEOMETRY'
    AND o.owner# = 46
    AND o.obj# = t.object_id;
          OBJ#   OBJECT_NAME  USERNAME   OWNER#
         45779  SDO_GEOMETRY  MDSYS      46
         48788  SDO_GEOMETRY  MDSYS      46
    -- "identify owner#/user_id for SCOTT"
    SELECT user_id FROM dba_users WHERE username = 'SCOTT'
       USER_ID
            54
    -- "Change the username of one,both of those records from MDSYS to SCOTT"
    -- "NOTE: untested SQL, but if it fails, just edit the table in Oracle Enterprise Manager"
    UPDATE obj$ SET owner# = &ScottUserID WHERE obj# = &ObjNum;
    COMMIT;
    {code}
    I've temporarily changed obj# values in this obj$ table to break associations between oracle objects that were throwing errors. I used Oracle Enterprise Manager's "view contents" form to view the obj$ table and to make those changes. See {message:id=4596120}
    Cheers,
    Noel                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • IBook 4 battery will not charge

    I recently bought a gently used iBook G4 (14.1 1.33) with OS X v10.3.9froma friend. When I bought it the battery was fully charged and working but it has since stopped sharging. I have reset the PMU, NVRAM, PRAM, the adapter light is green, and, when

  • User exit in Production Confirmation

    Hi Experts, I need to fill the a custom pallet table when the material document is created in transaction CO11N. And I need to do few validations and if those fails I need to reverse the material document. I found few user exits with the material doc

  • How do you block explicit lyrics in iTunes store?

    My daughter can not buy explicit lyrics due to settings we have put in place but she can still listen to the short clips of the songs marked explicit.  Is there a way to block this as well?

  • Something is wrong with my billing

    i can't get to my itunes store to update and my apps aren't working

  • SQL in Java

    Hi is there anyone that can help me with this simple SQL command? ("insert into user values ('"i"','"+name+"')"); i++; The variable i is a running number and name is a variable as well. I beleive the syntax to quo the variable i has problem. Please h