Spatial view

Hi.
I'm using Oracle 8.1.7 with MapInfo 6.0
Is it possible to create a view on a spatial table and see it a spatial table to open the view in MapInfo ?
I try it by cerate a view (CREATE VIEW sql statement) and insert a line in the user_sdo_geo_metadata table unsuccefully.
null

Hi Hervi,
Regarding the first part of your question, it is possible to create a view in Oracle Spatial, and you don't need to (and shouldn't) add an entry in user_sdo_geom_metadata for the right things to happen.
I can't answer the mapinfo part of the question.

Similar Messages

  • Spatial view in sql server

    Hi everybody 
                i want to create spatial view in the sqlserver 2008 . i m creating relationship between entity . i m pasting my sql query :
    SELECT     sde.STATE.OBJECTID, sde.STATE.StateID, sde.STATE.StateName, sde.STATE.SHAPE, SUM(sde.Population.Population) AS Expr1
    FROM         sde.STATE INNER JOIN
                          sde.Population INNER JOIN
                          sde.TEHSIL ON sde.Population.TehsilID = sde.TEHSIL.TehsilID INNER JOIN
                          sde.DISTRICT ON sde.TEHSIL.DistrictID = sde.DISTRICT.DistrictID ON sde.STATE.StateID = sde.DISTRICT.StateID
    GROUP BY sde.STATE.OBJECTID, sde.STATE.StateID, sde.STATE.StateName, sde.STATE.SHAPE
    when i try to save this query it gives the error .
    The type "gemometry " is not comparable .It can not be used in the GROUP BY clause.
    when i not include shape in GROUP BY clause it gives following error
    Column 'sde.STATE.SHAPE ' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
    please if any one has created just informed me

    Should just be a matter of doing the aggregation in a subquery.  Try:
    SELECT  sde.STATE.OBJECTID     
          , sde.STATE.StateID     
          , sde.STATE.StateName     
          , sde.STATE.SHAPE,     
          , q1.SumOfPopulation     
    FROM    sde.STATE      
            JOIN (      
                    SELECT   StateID,     
                           , SUM(sde.Population.Population) as SumOfPopulation     
                    FROM     sde.STATE      
                             JOIN sde.DISTRICT ON sde.STATE.StateID = sde.DISTRICT.StateID     
                             JOIN sde.TEHSIL ON sde.TEHSIL.DistrictID = sde.DISTRICT.DistrictID    
                             JOIN sde.Population ON sde.Population.TehsilID = sde.TEHSIL.TehsilID  
                    GROUP BY StateID  
             ) q1 ON q1.StateID = sde.STATE.StateID    

  • Union of tables to give a spatial view

    I have a series of tables that i am trying to join together and display in a view. Some of them have a slightly different structure. They all have either a east/north, easting or northing, or a centrex and centrey. I then want the centroids for each polygon. If i run the select statements seperatly they select what i want, however when i put a union in it gives the following error message :
    ERROR at line 1:
    ORA-22901: cannot compare nested table or VARRAY or LOB attributes of an object
    type
    The SQL is as follows :
    CREATE or REPLACE VIEW ALLSITES_V AS
    select
    'SSSI' desg,SSSI_NAME site_name,SSSI_ID site_code,EAST CENTREX,NORTH CENTREY,TO_NUMBER(sssi_id) isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
    from SSSI
    union
    select
    'SPA' desig,SPA_NAME site_name,SPA_CODE site_code,EASTING CENTREX,NORTHING CENTREY,ISIS_ID isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
    from SPA
    union
    select
    'RAMSAR' desg,RAMSAR_NAME site_name,RAMSAR_CODE site_code,EASTING CENTREX,NORTHING CENTREY,ISIS_ID isis_id,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
    from RAMSAR
    union
    select
    'SAC' desg,SAC_NAME site_name, SITE_CODE site_code,ISIS_ID isis_id,CENTREX,CENTREY,MI_STYLE,MI_PRINX,GEOLOC,sdo_geom.sdo_centroid(geoloc,0.001)
    from SAC
    I am assuming it is because i have not used the SDO_GEOM function in it's correct format. I would also like the view to show the centrex and y and also the MBR. It is will be used when passed through a WMS. I have missed out something fairly fundermental but i am not sure how to incorperate it.

    Hi,
    I created view:
    CREATE OR REPLACE VIEW VIEW_ALL as
    SELECT
    ID, GEOMETRIE_ZNACKA as GEOMETRIE
    FROM
    TAB_A
    WHERE
    GEOMETRIE_ZNACKA is not null
    UNION ALL
    SELECT
    ID, GEOMETRIE_SIPKA as GEOMETRIE
    FROM
    TAB_B
    WHERE
    GEOMETRIE_SIPKA is not null
    I inserted geometry metadata:
    insert into mdsys.user_sdo_geom_metadata (table_name,column_name,diminfo,SRID)
    values ('VIEW_ALL','GEOMETRIE',MDSYS.SDO_DIM_ARRAY (MDSYS.SDO_DIM_ELEMENT('X',431700, 904600,0.01),
    MDSYS.SDO_DIM_ELEMENT('Y',935200, 1227300,0.01)),2065);
    Tables TAB_A and TAB_B have spatial index on column with geometry.
    When I view the view VIEW_ALL in the spatial view (Georaptor) we get an error "ORA-01446".
    Geometry data of tables TAB_A and TAB_B (directly) is viewed in spatial view (Georaptor) corectly.
    Thanks
    Petr Soucek

  • Spatial view 3D effect plugin causing After Effects to crash.

    I installed the Spatial View stereoscopic effect plugin today, only using the 30 day trial.
    However, every time I try to apply the effect or adjust some the settings, After Effects crashes.
    Anyone else had the same problem?
    I really need this plugin badly Q_Q

    I think this is too specialised a question to get an answer :/
    Nevermind, I've decided to go with Tridef, it's a lot cheaper and easier to use.
    If anyone is looking to convert 2D video to 3D analglyph, it seems the way to go.

  • Slow SDO_RELATE operation on a spatial view

    Hi Folks,
    I need some help to understand what's going on with a spatial query that is taking so long to be executed (about 7 minutes).
    I have a spatial view as below:
    create or replace view v_lote_fiscal_relac as
    select
    lf.objectid,lf.numbloco,lf.setor,lf.quarteirao,lf.origem,lf.tipo,lf.nome,lf.superquadra,lf.quadra,lf.area,lf.observacao,lf.motivo,lf.data,lf.matricula,
    vlf.idf_lote,vlf.ind_tipo_lote,vlf.num_lote,vlf.num_seq_lote,vlf.num_setor,vlf.num_quarteirao,vlf.mtr_area_real,vlf.des_tipo_categoria,
    lf.geom
    from
    GEOSMFAGP.Lote_Fiscal lf, IMO_VW_LOTE_FISCAL@POAGEO vlf
    where
    retorna_num_lote(lf.numbloco) = vlf.num_lote AND
    retorna_num_seq_lote(lf.numbloco) = vlf.num_seq_lote;
    The functions retorna_num_lote and retorna_num_seq_lote just do a substr to extract information from lf.numbloco column
    This is the spatial query created by a mapping application
    SELECT
    OBJECTID
    FROM
    GEOPONTO.V_LOTE_FISCAL_RELAC T
    WHERE
    SDO_RELATE(T.GEOM,
    SDO_GEOMETRY(2003,1010101,NULL,
    SDO_ELEM_INFO_ARRAY(1,1003,1),
    SDO_ORDINATE_ARRAY(180514.7833451195,1663508.6932339652,
    180514.84948680276,1663504.0633161366,
    180517.6274375,1663503.9971744534,
    180517.69357918325,1663508.4948089155,
    180514.7833451195,1663508.6932339652)), 'mask=ANYINTERACT') = 'TRUE'
    Please, correct me if I'm wrong, but it looks like the query will first get all the records that satisfy the where clause and then apply the spatial filter on this resultset.
    How can it be improved?
    I did some tests using SQL Developer (SQL Profiler) and it was possible to create a better execution plan to this query. The time was reduced to 4 seconds.
    But the SQL Profile seems to have effect only to the query analyzed. I mean, if a change the sdo_geometry parameter, the query takes 7 minutes again.
    Any ideas?
    Regards,
    Luis

    Hi Stefan,
    Please, see below the Explain Plan that I mentioned and the SQL Profiler command that makes the query be executed very fast.
    *1- Original*
    Plan hash value: 2780585567
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
    | 0 | SELECT STATEMENT | | 4808 | 1596K | 25 (0)| 00:00:01 | | |
    | 1 | NESTED LOOPS | | 4808 | 1596K| 25 (0)| 00:00:01 | | |
    | 2 | REMOTE | IMO_VW_LOTE_FISCAL | 25553 | 648K | 25 (0)| 00:00:01 | POAGEO | R->S |
    |* 3 | TABLE ACCESS BY INDEX ROWID| LOTE_FISCAL | 1 | 314 | 25 (0)| 00:00:01 | | |
    |* 4 | DOMAIN INDEX | XSPLOTE_FISCAL_GEO | | | 0 (0)| 00:00:01 | | |
    uery Block Name / Object Alias (identified by operation id):
    1 - SEL$F5BB74E1
    2 - SEL$F5BB74E1 / VLF@SEL$2
    3 - SEL$F5BB74E1 / LF@SEL$2
    4 - SEL$F5BB74E1 / LF@SEL$2
    Predicate Information (identified by operation id):
    3 - filter("VLF"."NUM_LOTE"="RETORNA_NUM_LOTE"("LF"."NUMBLOCO") AND
    "VLF"."NUM_SEQ_LOTE"="RETORNA_NUM_SEQ_LOTE"("LF"."NUMBLOCO"))
    4 - access("MDSYS"."SDO_RELATE"("LF"."GEOM","MDSYS"."SDO_GEOMETRY"(2003,1010101,NULL,"SDO_ELEM_INFO_ARRA
    Y"(1,1003,1),"SDO_ORDINATE_ARRAY"(180514.7833451195,1663508.6932339652,180514.84948680276,1663504.063316136
    6,180517.6274375,1663503.9971744534,180517.69357918325,1663508.4948089155,180514.7833451195,1663508.6932339
    652)),'mask=ANYINTERACT')='TRUE')
    *2- Using SQL Profile*
    Plan hash value: 3617866586
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Inst |IN-OUT|
    | 0 | SELECT STATEMENT | | 4808 | 1596K| 485 (1) | 00:00:06 | | |
    |* 1 | HASH JOIN | | 4808 | 1596K| 485 (1) | 00:00:06 | | |
    | 2 | TABLE ACCESS BY INDEX ROWID| LOTE_FISCAL | 1882 | 577K| 459 (1) | 00:00:06 | | |
    |* 3 | DOMAIN INDEX | XSPLOTE_FISCAL_GEO | | | 0 (0) | 00:00:01 | | |
    | 4 | REMOTE | IMO_VW_LOTE_FISCAL | 25553 | 648K| 25 (0) | 00:00:01 | POAGEO | R->S |
    uery Block Name / Object Alias (identified by operation id):
    1 - SEL$F5BB74E1
    2 - SEL$F5BB74E1 / LF@SEL$2
    3 - SEL$F5BB74E1 / LF@SEL$2
    4 - SEL$F5BB74E1 / VLF@SEL$2
    Predicate Information (identified by operation id):
    1 - access("VLF"."NUM_LOTE"="RETORNA_NUM_LOTE"("LF"."NUMBLOCO") AND
    "VLF"."NUM_SEQ_LOTE"="RETORNA_NUM_SEQ_LOTE"("LF"."NUMBLOCO"))
    3 - access("MDSYS"."SDO_RELATE"("LF"."GEOM","MDSYS"."SDO_GEOMETRY"(2003,1010101,NULL,"SDO_ELEM_INFO_ARRA
    Y"(1,1003,1),"SDO_ORDINATE_ARRAY"(180514.7833451195,1663508.6932339652,180514.84948680276,1663504.063316136
    6,180517.6274375,1663503.9971744534,180517.69357918325,1663508.4948089155,180514.7833451195,1663508.6932339
    652)),'mask=ANYINTERACT')='TRUE')
    Recommendation (estimated benefit: 99.96%)
    - Consider this SQL Profile:.
    execute dbms_sqltune.accept_sql_profile(task_name => 'staName68255',
    task_owner => 'GEOPONTO', replace => TRUE);
    After the execution o the command above, the same query is executed in 3 seconds.
    P.S: I Cannot change the view, the column is indexed and SDO_FILTER will not work for me, because I need an exact match.
    Regards,
    Luis

  • Sdo_filter fail when query against a spatial view in different schema

    We have a table with X,Y coordinates and would like to run spatial query against it. We do not want to change the table structure, so we opt to use a function based index. USER_SDO_GEOM_METADATA is updated and index is built. Then we created a view with spatial column from the table. Everything works fine with the user who owns the table and view.
    When we try to run a spatial query against the view from a different user, it failed with error. However, if we substitute the select from my_view* with the actual SQL statement that created the view, it works. So it looks like Oracle refuse to acknowledge the spatial index if accessed via view. Here is some simplified scripts:
    --- connect as USER1.
    --update meta data
    INSERT INTO USER_SDO_GEOM_METADATA ( TABLE_NAME, COLUMN_NAME, DIMINFO, SRID ) VALUES
    ('LOCATIONS', 'MDSYS.SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL)',
    SDO_DIM_ARRAY( SDO_DIM_ELEMENT('X', 1300000, 1600000, 1), SDO_DIM_ELEMENT('Y', 400000, 700000, 1) ), 2264 );
    --created index
    CREATE INDEX LOCA_XYGEOM_IDX ON LOCATIONS
    ( SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL)
    ) INDEXTYPE IS MDSYS.SPATIAL_INDEX;
    --create view
    CREATE VIEW USER1.MY_VIEW AS SELECT ID ,X_COORD,Y_COORD, SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL) SHAPE
    FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0;
    -- run spatial query from view, works fine by user1 by failed on user2.
    SELECT SHAPE FROM (
    SELECT * FROM USER1.MY_VIEW
    ) a WHERE sdo_filter (shape, sdo_geometry ('POLYGON ((1447000 540000, 1453000 540000, 1453000 545000, 1447000 545000, 1447000 540000))', 2264), 'querytype=window') = 'TRUE';
    -- run spatial query from table directly, simply replace the view with actual statements that created the view. works fine by user1 AND user2.
    SELECT SHAPE FROM (
    SELECT ID ,X_COORD,Y_COORD, SDO_GEOMETRY(2001,2264,SDO_POINT_TYPE(NVL(X_COORD,0),NVL(Y_COORD,0),NULL),NULL,NULL) SHAPE
    FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0
    ) a WHERE sdo_filter (shape, sdo_geometry ('POLYGON ((1447000 540000, 1453000 540000, 1453000 545000, 1447000 545000, 1447000 540000))', 2264), 'querytype=window') = 'TRUE';
    When run against the view by user2, the error is:
    ORA-13226: interface not supported without a spatial index
    ORA-06512: at "MDSYS.MD", line 1723
    ORA-06512: at "MDSYS.MDERR", line 8
    ORA-06512: at "MDSYS.SDO_3GL", line 1173
    13226. 00000 - "interface not supported without a spatial index"
    *Cause:    The geometry table does not have a spatial index.
    *Action:   Verify that the geometry table referenced in the spatial operator
    has a spatial index on it.
    Note, the SELECT SHAPE FROM (****) A WHERE SDO_FILTER(....) syntax is a third party application, all we have control is the part inside "(select ...)".
    So it appears Oracle is treating view differently. Have attempted fake the view name into USER_SDO_GEOM_METADATA, did not work. Also, granted select on the index table to user2, did not work.
    if we re-created the view in user2 schema, it worked for user2 but not user1, so it's not something we can do for every user.
    Searched the forum, no good match found. A few posts talked about "union all" in view caused the problem but I do not have the union.
    We are only use Oracle 10g Locator, not full spatial edition.
    Any ideas?
    Thanks!
    Edited by: liu.284 on Oct 4, 2011 12:08 PM

    It seems a bug, where a function-based spatial index is not correctly handled in a view query transformation.
    Not sure if the following works for you or not.
    add a new column "shape" (mdsys.sdo_geometry) in table locations, use a trigger and x_coord/y_coord
    to set values for this new column, and just create a normal spatial index on this new column. (drop the
    function-based spatial index). And create a view like:
    CREATE VIEW USER1.MY_VIEW2 AS SELECT ID , X_COORD, Y_COORD, SHAPE
    FROM USER1.LOCATIONS WHERE X_COORD>0 AND Y_COORD>0;

  • How do I get all Finder windows to open in spatial view?

    How do I get all Finder windows without special view options set to open in the 'spatial' mode (without the toobar or sidebar)? The ones I specifically change stay that way, but I want all new and old folders to be like that too.

    That's called the simple Finder mode. You would need to configure that as part of Parental Controls in the Accounts preferences. To make any Finder window appear that way jut click on the gadget in the top right corner of the Finder window.

  • Is it possible to create a spatial view with paramete?

    Is it possible to create a view with parameter like following:
    SELECT GEOM FROM INTERSTATES WHERE MDSYS.SDO_FILTER(GEOM, MDSYS.SDO_GEOMETRY(2003, 8307, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3), MDSYS.SDO_ORDINATE_ARRAY(?, ?, ?, ?)), 'querytype=WINDOW') = 'TRUE'
    so that I can specify ???? at run time.
    If not, is there a way to create a view that perform variable window query?

    You may want to look at application contexts, that way you may have code something like this:
    create or replace context gis_ctx using gis_params ;
    create or replace package gis_params
    as
    procedure set_bounds( minx in number, miny in number, maxx in number,maxy in number );
    end;
    create or replace package body gis_params
    as
    procedure set_bounds( minx in number, miny in number, maxx in number,maxy in number )
    is
    begin
    dbms_session.set_context( 'gis_ctx', 'minx', minx);
    dbms_session.set_context( 'gis_ctx', 'miny', miny);
    dbms_session.set_context( 'gis_ctx', 'maxx', maxx);
    dbms_session.set_context( 'gis_ctx', 'maxy', maxy);
    end ;
    end ;
    To use this method you´ll have to execute
    gis_params.set_bounds(-3,40,-2.9,40.1) ;
    before doing the select.
    SELECT GEOM
    FROM INTERSTATES
    WHERE MDSYS.SDO_FILTER(GEOM,
    MDSYS.SDO_GEOMETRY(2003,
    8307,
    NULL,
    MDSYS.SDO_ELEM_INFO_ARRAY(1, 1003, 3),
    MDSYS.SDO_ORDINATE_ARRAY(sys_context ('gis_ctx', 'minx'),
    sys_context ('gis_ctx', 'miny'),
    sys_context ('gis_ctx', 'maxx'),
    sys_context ('gis_ctx', 'maxy'))),
    'querytype=WINDOW') = 'TRUE' ;
    I f you are in a web environment, read about GLOBAL CONTEXT ACCESSED GLOBALLY .
    Regards, Nico.

  • Spatial View Issue

    I had been using the following view for many years and then switching from binary storage to sql geometry storage has caused it to break
    SELECT     MAX(GIS.PARCELS.PID) AS PID, MIN(GIS.PROPERTY.NAME1) AS Name, MIN(GIS.PROPERTY.NAME_ADD2) AS AddtlName, MIN(GIS.PROPERTY.LOCN) AS MnAddress, 
                          MAX(GIS.PROPERTY.LOCN) AS MxAddress, MIN(GIS.PROPERTY.FULLSTREET) AS FullName, MIN(GIS.PROPERTY.LOCS) AS Street, MIN(GIS.PROPERTY.LOCD) 
                          AS Direction, MIN(GIS.PROPERTY.LOCCITY) AS City, MIN(GIS.PROPERTY.STCD) AS StateCode, GIS.PARCELS.Shape, GIS.PARCELS.OBJECTID
    FROM         GIS.PARCELS LEFT OUTER JOIN
                          GIS.PROPERTY ON GIS.PARCELS.PID = GIS.PROPERTY.GISPID
    GROUP BY GIS.PROPERTY.GISPID, GIS.PARCELS.Shape, GIS.PARCELS.OBJECTID

    from binary storage to sql geometry storage has caused it to break
    Hello Michael,
    Could you explain a Little more detailed the issue, please? Table design (DDL) would be also helpful.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to create spatial views in sqldeveloper

    Hi,
    I've installed an oracledatabase with spatial. until now I used mapviewer with the jsp's of it, and oracle apex (formerly htmldb) to show maps.
    now i've installed sqldeveloper with georaptor included . my database is up and running, I have made a connection to my database, use the same sdo metadata, have mapviewer started and added the datasource (as admin).
    if I try to see the map in sqldeveloper I get a message : no layer selected
    can anyone tll me what I have forgotten or what I do wrong ?
    Thanks in advance !

    Hi GeoRaptor users,
    The current version of GeoRaptor does not work for SQL Developer 1.1
    For this version of Oracle SQL Developer, i made the CVS head revision (1.7) of GeoRaptor available till the GA is being released.
    Select Help -> Check for Updates...
    Select Add, enter GeoRaptor and http://testnext.com/oracle/sqldeveloper/georaptor-20070207/install.xml, and click OK.
    Cheers,
    Jeroen van Schaijk

  • Spatial query on join view in another schema

    Background:
    I have a schema with tables containing four spatial columns per table. I have a second schema that contains join views of the tables in the first schema. The join view consists of the attributes and any other tabular data that is joined via foreign key to non-spatial tables and one of the four geometry columns. I have a third schema that owns no database objects of its own, but has select privilege to the second schema's view objects.
    We are using Oracle 10.2.0.2 on a windows platform.
    This worked in 9i, the problem only presented itself when we migrated to 10g.
    Problem:
    When I run a spatial query on a join view in the second schema(the schema that owns the object), it runs and returns results in about a second. When I run the exact same query in the third schema it routinely takes 20-30 seconds.
    Here is the query that I run in both schemas with varying query times:
    SELECT COUNT(*)
    FROM two.join_view_a A
    WHERE (MDSYS.SDO_FILTER(A.GEOM, SDO_GEOMETRY(2003,8307,NULL,SDO_ELEM_INFO_ARRAY(1,1003,3),SDO_ORDINATE_ARRAY(26.6396,26.5708,43.346,34.4083)),'QUERYTYPE=WINDOW')='TRUE');
    Question:
    Why does this happen?
    What can I do to fix this problem?
    Thanks,
    John

    Have a read of this posting: Oracle spatial view runing slow as different user
    There are details there about the 'optimizer_secure_view_merging' parameter and the effect it can have on cross schema views in 10.2

  • Ora-13226 when performing spatial query on view

    Hi,
    in my database I have a view with spatial column. The view is based on UNION ALL select. When I try to run spatial query on the view, the database returns ora-13226 error. When I recreate the view to consist only one select (without UNION ALL) the spatial query return correct result. Could you pls help me how to do a spatial query on spatial view whose definition contains UNION ALL select?
    Thanks
    Andrew

    Hi,
    it's quite simple:
    create view test_view as
    select id, geometry from table_a
    union all
    select id, geometry from table_b;
    When I try for example:
    select *
    from test_view
    where sdo_relate(geometry, (select geometry from table_c where id=1316),'mask=anyinteract') = 'TRUE';
    it throws ora-13226 error.
    Interesting is that following query where the geometry is directly included runs well:
    select *
    from test_view
    where sdo_relate(geometry, MDSYS.SDO_GEOMETRY (....),'mask=anyinteract') = 'TRUE';
    also when I recreate the test_view as
    create view test_view as
    select id, geometry from table_a;
    then also the first query (with inner select) returns no error.
    It's a little bit strange isn't it?
    Andrew

  • Spatial Index Problem in View

    Hello everyone.
    I have a table (A) that stores point locations (X,Y) and contains the following fields:
    ID NUMBER(10,0) No 1
    CD_CODIGO_EMA VARCHAR2(10 BYTE) Yes 2
    TX_NOMBRE_EMA VARCHAR2(50 BYTE) Yes 3
    CD_PROVINCIA_EMA NUMBER(5,0) Yes 4
    CD_MUNICIPIO_EMA NUMBER(5,0) Yes 5
    NU_UTMX_EMA NUMBER(10,2) Yes 6
    NU_UTMY_EMA NUMBER(10,2) Yes 7
    NU_HUSO_EMA NUMBER(5,0) Yes 8
    NU_TIPO_EMA NUMBER(3,0) Yes 9
    TX_URL_EMA VARCHAR2(255 BYTE) Yes 10
    I have created a view (V) with a field of type SDO_GEOMETRY values based on longitude (NU_UTMX_EMA) and latitude columns (NU_UTMY_EMA) in Table A, as follows:
    CREATE VIEW A_VIEW (ID, SHAPE)
    AS SELECT
    ID, MDSYS.SDO_GEOMETRY(2001, 83030, MDSYS.SDO_POINT_TYPE(NU_UTMX_EMA, NU_UTMY_EMA, NULL), NULL, NULL)
    FROM A
    I have updated the view USER_SDO_GEOM_METADATA:
    insert into user_sdo_geom_metadata values (
    'A_VIEW',
    'SHAPE',
    MDSYS.SDO_DIM_ARRAY(
    MDSYS.SDO_DIM_ELEMENT('Longitude',90000,630000,0.005),
    MDSYS.SDO_DIM_ELEMENT('Latitude',3980000,4300000,0.005)
    83030
    I can see the spatial view in differentes clientes (for example, Geoserver and ArcMap). The problem is when I try to Zoom into the View I receive the message: Interface not supported without a spatial index+
    If I try to make an spatial index on the view, I receive the message:
    create index V_idx on A_VIEW(SHAPE) indextype is MDSYS.SPATIAL_INDEX;
    ORA-01702 A view is nos appropiate here.
    How can I fix it? The original table (A) has a spatial index and it works fine.
    Thanks in advance

    This should be answered in your other post:
    View with SDO_GEOMETRY column

  • Is it possible to create a spatial index on a view?

    Hi
    Is it possible to create a spatial index on a view?
    We would like to link our spatial tables to each other (using only one of the SDO_GEOMETRY fields) in a view & make it very easy so that anybody can work with the data.
    Thanks Caroline.

    Simon,
    In order for autoregistration to work, you first need to make sure that all entries in mdsys.sdo_geom_metadata_table are registered with SDE. All tables not just one schema. None of our spatial tables or views exist in the SDE schema.
    Also make sure all Oracle Spatial tables in sde.table_registry are held in mdsys.sdo_geom_metadata_table.
    When a user makes a database connection in ArcCatalog, all Oracle Spatial tables will be registered with SDE automatically. Also, entries will be inserted into mdsys.sdo_geom_metadata_table and indexes will be created. If you do not have primary key fields, you will have to Register with Geodatabase and it will create the OBJECTID field.
    This did not work for us originally. but after cleaning up metadata and installing SP1, it is working now and it is very convenient.
    VIEWS:
    You have to create the view thru SDE. You cannot register foreign views. There are bugs in support of views containing SDO_GEOMETRY objects. I have been told some problems will be fixed in SP2 and there may be a patch out to address some others.
    Here are the incidents I have filed in reference to views:
    1.
    I created a view consisting of a geometry column from a "foreign" Oracle
    Spatial table (SDO_GEOMETRY) and corresponding attribution in another table.
    I used the following command to create the view through SDE:
    C:\arcgis\arcexe81\BIN>sdetable -o create_view -T gis_v_traffic -t
    "trims_traffi c_geom,traffic" -c
    "trims_traffic_geom.geometry,trims_traffic_geom.fid,traffic.i
    d_number,traffic.aadt" -w "trims_traffic_geom.mslink = traffic.mslink" -u
    gis -p spatial -i esri_sde -s JJ0DN10
    ArcSDE 8.1 Build 832 Thu Mar 22 14:08:07 PST 2001 Attribute Administration
    Utility ----------------------------------------------------- Successfully
    created view gis_v_traffic.
    I can preview the geometries in ArcCatalog without error.
    However, when I try to select a feature in ArcMap I get the following error:
    The instruction at "0x125222dd" referenced memory at "0x00000000". The
    memory could not be "read".
    I click ok.
    Then I get this error:
    The insruction at "0x5f8012d3" referenced memory at "0x00000004". the memory
    could not be "read".
    I click ok and ArcMap terminates.
    I can select features from the spatial table the view is pointing to, but
    not from the view itself.
    2.
    I need to create views utilizing database links to tie attribution in other
    databases to geometries created for that data in a spatial database.
    I issued the following command from command prompt and got this error:
    C:\arcgis\arcexe81\BIN>sdetable -o create_view -T link_v_traffic -t
    "trims_traff ic_geom,[email protected]" -c
    "trims_traffic_geom.geometry,trims_traffic_ge
    om.fid,[email protected],[email protected]" -w
    "trims_t raffic_geom.mslink = [email protected]" -u gis -p
    spatial -i esri_sd e -s JJ0DN10
    ArcSDE 8.1 Build 832 Thu Mar 22 14:08:07 PST 2001 Attribute Administration
    Utility ----------------------------------------------------- Error:
    Underlying DBMS error (-51). Error: Unable to create view link_v_traffic
    ORA-00957: duplicate column name (link_v_traffic)
    3.
    Spatial Views created on Oracle Spatial LRS layers containing SDO_GEOMETRY
    objects are not recognized as feature classes unless they are created with
    the sdetable -o create_view command.
    Here is typical SQL for the view creation:
    create or replace view trims_v_traffic as select a.geometry,
    b.nbr_tenn_cnty, b.nbr_rte, b.spcl_cse, b.cnty_seq, b.tr_beg_log_mle,
    b.tr_end_log_mle, b.yr_trfc, b.aadt, b.pct_peak_hr, b.dhv_pct, b.drct_distr,
    b.vhcl_pass_pickups, b.vhcl_su_trk, b.vhcl_mu_trk, b.actl_cnt, b.updt_by,
    b.updt_on, b.mslink, b.mapid, b.id_number, b.sta_nbr from
    gis.trims_traffic_geom a, gis.traffic b where a.mslink = b.mslink;
    The table containing the SDO_GEOMETRY object is registered with SDE in the
    following manner:
    C:\arcgis\arcexe81\BIN>sdelayer -o register -l trims_traffic_geom,geometry
    -e slM -k SDO_GEOME
    TRY -s JJ0DN10 -i esri_sde -u gis -p spatial -c fid -C SDE
    A feature class is successfully created for this layer and the data can be
    added successfully to a map.
    However, there is no way of adding data to a map from a spatial database
    view containing an SDO_GEOMETRY object which was created externally from
    SDE.
    We are using Oracle Spatial 8.1.7 on NT 4.0. We are also using ArcGIS 8.1
    and ArcSDE 8.1.1.
    4.
    SDE does not support spatial database views which reference snapshot
    objects.
    I was unable to create a view using sdetable -o create_view which referenced
    a snapshot object.
    The snapshot was created using the following sql syntax:
    CREATE SNAPSHOT SNP_TEST
    BUILD IMMEDIATE
    REFRESH FAST
    ON DEMAND
    AS
    SELECT * FROM [email protected]
    We are using ArcSDE 8.1.1 with Oracle 8.1.7 on NT 4.0.
    Here are the permissions I granted, they need to be the same for every schema:
    for sde (these are all the permissions that might be needed for any type of
    activity - new install or upgrade)..lets just step through and go ahead and
    grant them all...
    grant create session to sde;
    grant create table to sde;
    grant create procedure to sde;
    grant create sequence to sde;
    grant create trigger to sde;
    grant unlimited tablespace to sde;
    grant select any table to sde;
    grant create any sequence to sde;
    grant create any procedure to sde;
    grant execute any procedure to sde;
    grant drop any procedure to sde;
    grant select any sequence to sde;
    grant create any view to sde;
    grant drop any view to sde;
    grant create any trigger to sde;
    grant drop any sequence to sde;
    each Oracle user will also need the following privileges...
    grant create session to gis;
    grant create table to gis;
    grant create procedure to gis;
    grant create sequence to gis;
    grant create trigger to gis;
    grant unlimited tablespace to gis;
    Viewer
    The viewer is allowed to connect to an ArcSDE database. Other users grant
    select privileges on their tables and feature classes to the viewer or to
    the public role. The DBA can create a role that can be granted select
    privileges on data objects owned by other users. The role can be granted to
    the viewer.
    create session
    select on other user's data objects
    Editor
    The editor is allowed to connect to an ArcSDE database. Other users grant
    select and insert, update, or delete on data objects they own to editor. The
    DBA may create a role that can be granted select, insert, update, and delete
    privileges on data objects owned by other users. The role can be granted to
    the editor.
    create session
    select, insert, update, or delete on other user's data objects
    Creator
    The creator is allowed to connect to an ArcSDE database and create data
    objects. The creator may grant privileges on their
    objects to other users or roles. Other users can grant select and insert,
    update, or delete on data objects they own to creator. The DBA may create a
    role that can be granted select, insert, update, and delete privileges on
    data objects
    owned by other users. The role can be granted to the creator:
    create session
    create table
    create procedure
    create sequence
    create trigger
    unlimited tablespace
    select, insert, update, or delete on other user's objects
    It might be worthwhile to rebuild your SDE metadata. I can walk you thru that if you need help.
    Hope this helps.
    Dave
    null

  • Using Map  Builder to view Spatial data

    Is anyone using XE for Spatial/Locator work? I have created a schema in XE from a spatial dmp file. I know the dmp file creates a valid schema as we use it all the time for testing. After import, I can't view any spatial layers using Oracle's Map Builder, or with any other spatial viewer for that matter. The tables look valid, have geom columns, are populated, are registered in the metadata... Does anyone have any ides why I can't access my spatial layers from XE?

    Looks like mdsys is alive in my XE 11gR2 instance ...... which doesn't mean all Spatial features will work. As mentioned before, Oracle Spatial is among the "Options and Major Features Not Included" according to the [url http://docs.oracle.com/cd/E17781_01/license.112/e18068/toc.htm#BABJIJCJ]Licensing Information.
    A few lines below, you'll find Oracle Locator to be available in XE anyway. Locator needs the MDSYS schema, but that schema obviously doesn't comprise everything you need for Spatial features. Spatial is an EE option. It could actually be that XE still carries everything you'd need but it's simply disabled... See the [url http://www.oracle.com/technetwork/database/options/spatial/overview/introduction/spatial-locator-features-100445.html]OTN Locator/Spatial features overview to get ... an overview. ;)
    -Udo

Maybe you are looking for

  • Configuração de página

    Acessando www.cruzeiro.org/blog pelo smartphone e selecionando a versão para desktop, ao clicar no link dos comentários, a página fica toda desconfigurada na tela, a menos que o tamanho do texto esteja configurado como "minúsculo". Em qualquer outra

  • Open and configure serial port

    Hi, when i use the function configured serial port, i can work with it. for which case i need the function open port. do i need both an in which order? thanks florian 

  • When on the internet cannot receive calls !!

    Is there something I can do to fix this? When I am on the internet, I can not receive calls it goes to voicemail. Thanks

  • Problem with saving/loading a file

    hi everyone, i hav a program that consists of animal that are jlabels with icons and i put these animals in an array and save them. when i save the file i catch this error message: sun.awt.image.ToolkitImage when i try to load the file i catch this e

  • 1600x900 external resolution

    just posting this for anyone else who has been waiting for 1600 x 900 resolution capabilities, the newest t400s BIOS addresses this, and works perfectly. it is like my computer is brand new to me again