Query on Oracle Spatial Locational Analysis

Hi,
I am working on Oracle Spatial Locational Analysis.
It was very interesting to see an example in this below mentioned URL.
http://technet.oracle.com/products/oracle9i/htdocs/9iober2/obe9ir2/download/obe-cnt_spatial.zip
The procedure mentioned is very clear but have some clarifications in between.
After creating the tables customers and warehouses, there aren't any .sql files where the data is feeded in to these two tables. With out the above mentioned step, in the procedure it is told to execute loc_updates.sql which updates any of the rows since if you look at the syntax in loc_updates.sql file it shows update the table customers whose customer_id=344.
Do we have to manually enetred the customer_id values?
Did Oracle miss uploading any .sql files?
I would very grateful if one could help me in this regard.
Thanks and Regards,
Nandakishore.

Nice to have a EXPERT in this FORUM...!!
Hi Dan, if you look at my reply I mentioned that I had loaded loc_updates.sql
From my previous reply:
execute loc_updates.sql which doenot update any of the rows since if you look at the syntax in loc_updates.sql file it shows update the table customers whose customer_id=344.
Where is this customer_id=344 coming from?
Also the datatype is a number.
Dan, were you able to get the results as desired?
or may be I am missing something...
Thanks and Regards,
Nandakishore.

Similar Messages

  • Basic query in Oracle Spatial

    I'm trying to learn Oracle Spatial working with 11g R2 and with 3D georeferenced data (specifically data describing buildings in a city).
    But I'm having trouble getting a basic query to work on my dataset (it works for the book example), and I'm trying to do it exactly the way it's done in the Spatial Developer's Guide for 11g.
    To learn how spatial queries work, I set up the cola_markets tables used in the book, made the appropriate manual entry in the user_sdo_geom_metadata view and created the index. Having done that, I can run the following simple query (as well as the others in the manual) on the book tables:
    SELECT SDO_GEOM.SDO_DISTANCE(c_b.shape, c_d.shape, 0.005)
    FROM cola_markets c_b, cola_markets c_d
    WHERE c_b.name = 'cola_b' AND c_d.name = 'cola_d';
    but when I try to do the same thing on my own tables (created from citygml data), I get an error. There is the difference that the data is 3D, and the index was created without any PARAMETERS ( ... ), hence is just 2D. But still I don't get why the following query doesn't work:
    SELECT SDO_GEOM.SDO_DISTANCE(c_w.envelope, c_b.envelope, 0.0005)
    FROM cityobject c_w,
         cityobject c_b
    WHERE c_w.id = 50025
         AND c_b.id = 50018;
    The id's for the buildings are valid, and I used the same tolerance used by the software that set up the database.
    Here's the error I get in SQL developer:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.Exception: 54535
    ORA-06512: at "MDSYS.SDO_3GL", line 637
    ORA-06512: at "MDSYS.SDO_GEOM", line 1973
    ORA-06512: at "MDSYS.SDO_GEOM", line 1990
    29532. 00000 - "Java call terminated by uncaught Java exception: %s"
    *Cause: A Java exception or error was signaled and could not be
         resolved by the Java code.
    *Action: Modify Java code, if this behavior is not intended.
    So, thinking it might have something to do with the fact that it's a Java interface, I also tried running it from SQL/PL command line and get essentially the same thing:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.lang.Exception: 54535
    ORA-06512: at "MDSYS.SDO_3GL", line 637
    ORA-06512: at "MDSYS.SDO_GEOM", line 1973
    ORA-06512: at "MDSYS.SDO_GEOM", line 1990
    Any ideas why this isn't working?
    (P.S.: I couldn't find a specific board for Oracle Spatial, hence put this question here--if there's a better place for this question, then, admins, of course, feel free to move the thread to the appropriate spot)

    Hi,
    The SPATIAL forum is here : {forum:id=76}

  • "invalid LRS segment" when querying an Oracle Spatial DB

    I have a table of GIS segments in an Oracle Spatial database. I'm using C# and ODP to connect to the database. For a given measure from the start of a segment, I want to find the GPS coordinates for that point. I'm running the following query:
    select g.geom.sdo_ordinates ord_array from
    *(select sdo_lrs.locate_pt(shape,0.02,0) as geom from test_schema.test_table*
    where route='ABC' and segmentnum='101.1') g
    where shape is of type SDO_GEOMETRY. I'm getting the following error:
    ORA-13331: invalid LRS segment
    Is there a problem with how I'm passing shape to locate_pt()? The Oracle Spatial documentation says the argument should be SDO_geometry, so that seems ok.
    Edited by: 964844 on Oct 11, 2012 2:10 PM

    I'm using C# with ODP.NET.
    Here is the current version of the code that is failing:
    var param = new OracleParameter("geom", OracleDbType.Object);
    param.UdtTypeName = "MDSYS.SDO_GEOMETRY";
    param.Direction = ParameterDirection.Input;
    OracleCommand oCmd = new OracleCommand();
    oCmd.Connection = this.oConn;
    oCmd.CommandText = queryStr;
    oCmd.CommandType = CommandType.Text;
    oCmd.Parameters.Add(param);
    OracleDataAdapter da = new OracleDataAdapter(oCmd);
    DataTable dt = new DataTable();
    da.Fill(dt);
    The exception is generated by the da.Fill(dt) line.

  • Oracle Spatial(Locator) Java Library

    Hello,
    I understand that Oracle Database in XE version includes Oracle Locator (limited version of Oracle Spatial). I would like to access to spatial data in JAVA application.
    As far as I know oracle.spatial.geometry package is included in sdoapi.jar file which I'm unable to find in 11g XE beta installation. Can I download it separately somewhere or it is in different jar?
    Or those functions are not avaible in XE version?
    Thanks

    Hi,
    For this kind of activity, it might be best to use Oracle Spatial (rather than locator) which includes
    LRS (Linear Referncing System). Linear Referencing allows you to use measure information
    (such as start measure/end meaure) to return spatial data without duplicating spatial data in
    multiple tables.
    If you can elaborate on what data you have (do you have a table with geometry data for the highways?),
    we might be able to outline what you need to do.
    Dan

  • Query of Oracle Spatial data in 1.5.4

    I run the below in SQLPLUS and all is well. 1.5.4
    select SDO_gcdr.geocode('ADCI', 2 SDO_keywordArray( '1052 Thomas Jefferson St','Washington,DC 20007'), 'US', 'DEFAULT')
    3 from dual ;
    SDO_GCDR.GEOCODE('ADCI',SDO_KE(ID, ADDRESSLINES, PLACENAME, STREETNAME, INTERSEC
    SDO_GEO_ADDR(0, SDO_KEYWORDARRAY(), NULL, 'THOMAS JEFFERSON ST NW', NULL, NULL,
    'WASHINGTON', NULL, 'DC', 'US', '20007', NULL, '20007', NULL, '1052', 'THOMAS JE
    FFERSON', 'ST', 'F', 'F', NULL, 'NW', 'L', .913793103, 18897889, '????#EN?T?B281
    CP?', 2, 'DEFAULT', -77.060179, 38.9040445)
    I can also get the result in TOAD.
    When I run through SQL Developer I get the below:
    oracle.sql.STRUCT@16433e4

    logged bug 8640482 for this.

  • How to Query Sdo_Geometry Object of ORACLE SPATIAL in PHP?

    Hi,
    I am trying to Query the Oracle Spatial's Geometry object in the PHP page but its giving me the ADT Error. How can i see the GEOMETRY object information on the web using PHP. Thanking you in advance and waiting for ur prompt reply.
    Adnan!

    Hi Ana,
    In the Query below its returning the result as each value of one row in diffrent rows i wanna ask from u is:
    1- May i get all these values in one row ?
    2- Second, i want to query more than one row values from the table? as this is a single row subquery.
    Thanks for your help and i m looking forward for a positive reply from you.
    Regards,
    Adnan!
    The following select lists all ordinate-values from ONE object in the table:
    select *
    from table(select a.<column_name>.sdo_ordinates
    from <table_name> a
    where ID = xxxx
    *******************************************************************

  • Help define the requirements for an Oracle Spatial management tool

    Hi,
    We are developing a tool that, we hope, will be indispensable for all Oracle Spatial and Locator dbas/users. We've released version 1.0, but we need your help to define the requirements for the next version.
    What features would you like to have in a management tool for your spatial databases?
    The features we've got so far:
    1. Viewing of vector data in a map + attributes
    2. Loading from shapefiles
    3. Exporting to shapefiles
    4. Validating metadata, indexes and spatial data.
    We are adding editing of vectors in the next version - basic stuff for add, update and delete.
    But there must be a lot more. What do you find difficult to do in Oracle Spatial/Locator? What would you like in a tool such as this?
    Any feedback either to myself or the forum is much appreciated.
    cheers,
    Andrew
    [email protected]
    PS If you like to have a look at what we have done so far, go to http://www.geometryit.com/products/spatialConsole.php

    Andrew knows what I have asked for but for others to think about and to start
    the ball rolling, here's what they are:
    1. Ability to enter own SQL commands but with PARAMETERS for attributes
    and shapes as in the following examples:
    SELECT ...
    FROM my_spatial_table a
    WHERE a.ATTRIBUTE = :attr
    AND MDSYS.SDO_RELATE(a.shape,:polygon,'mask=anyinteract') = 'TRUE'
    When executed the attribute value is asked for via a input box (data type?)
    and the user is asked to define the SDO_GEOMETRY for the :polgygon parameter via mouse clicks on the screen.
    Similarly, this would work for INSERT, UPDATE and DELETE...
    INSERT INTO my_spatial_table (shape) values(:polygon)
    The data type of an attribute parameter could be determined in two ways:
    a) By querying the Oracle catalog;
    b) By using a "PARAMETERS" command before the query as follows
    PARAMETERS name type [(size)] [, name type [(size)] ...]
    The PARAMETERS declaration has these parts:
    name     The name of the parameter.
    type     The type of the parameter.
    size     The size of the parameter in characters or bytes.
    2. When executing an SQL SELECT statement I would like the tool
    to suggest the HINTS that are needed to improve performance.
    3. Following on from 2, I would like to Tick an option that would return the
    EXPLAIN PLAN that the query optimizer used when executing my query.
    4. The tool has to support ALL Oracle's spatial vector data types.
    5. It would be nice to be able to work with GeoRasters. Since Spatial Console
    imports/exports shapefiles why not the same for rasters. However, the problem
    with supporting foreign data formats is WHERE DO YOU STOP!!!!!
    6. You could allow for the styling of the Spatial Console to be stored in the MapViewer catalogs or use the MapViewer catalogs when styling an Sdo_Geometry if it exists (I note that your tool extracts the SDO_METADATA
    why not the MapViewer metadata as well)?
    regards
    S.

  • Web map server - data in Oracle Spatial

    We are searching for "web map server" which take data directly from Oracle Spatial (Locator). For this project the tools like ESRI ArcSDE, ArcIMS are too expensive. What are other product on the market? It should provide basic map navigation, spatial querying (klick on the map shows atribute data of features in active layers), serching by atributes.
    Regards,
    Sašo

    Oracle's web map server product is the Application Server 10g MapViewer. See www.oracle.com/technology/products/mapviewer/index.html
    For other mapping products that work with Spatial/Locator see
    http://www.oracle.com/technology/products/spatial/spatial_partners.htm

  • Webinar Replay URL: Situational Analysis at OnStar with Oracle Spatial

    A free replay is now available for the Directions webinar Situational Analysis at OnStar with Oracle Spatial, which was held on Feb. 22.
    To view the replay, visit https://www2.gotomeeting.com/register/237138906
    OnStar is the largest telematics solution provider on the globe, with 6 million subscribers in North America and abroad. OnStar uses situational awareness and real-time analysis to deliver fast, accurate emergency services to its customers. At the core of this solution is an Oracle Spatial-based analytical server that supports Google Earth visualization and NAVTEQ data. With this system, OnStar gains better understanding of customer use and behavior and better insight during emergency situations. In hurricanes, wildfires and other disasters, OnStar has developed early warning capabilities for use in near real-time. It can then manage call center resources based on anticipated call volumes and ultimately develop more effective new processes and services.
    Learn from OnStar how the company uses Oracle Spatial to deliver insight, performance and scalability.
    Key learning points include:
    * How OnStar’s Oracle Spatial analytical server supports its real-time call center Advisor application in an environment using Google Earth visualization and NAVTEQ data
    * How spatial analysis allows OnStar to obtain better insight into disaster situations, develop early warning capabilities, and improve call center coverage
    * How Oracle Database 11g (with Oracle Spatial, Real Application Clusters, Partitioning) provides scalability and performance required to process and query OnStar’s large amounts of transactional data
    Speakers include:
    * Jeff Joyner, Emergency Strategy and Outreach, GM OnStar and Injury Research Fellow, University of Michigan Program for Injury Research and Education
    * James Steiner, Vice President, Product Management, Oracle Server Technologies
    Who should attend:
    This webinar is appropriate for CIOs, business and technical managers and analysts involved in the design and management of enterprise systems where spatial analysis can add insight and value to business processes.

    Nice to have a EXPERT in this FORUM...!!
    Hi Dan, if you look at my reply I mentioned that I had loaded loc_updates.sql
    From my previous reply:
    execute loc_updates.sql which doenot update any of the rows since if you look at the syntax in loc_updates.sql file it shows update the table customers whose customer_id=344.
    Where is this customer_id=344 coming from?
    Also the datatype is a number.
    Dan, were you able to get the results as desired?
    or may be I am missing something...
    Thanks and Regards,
    Nandakishore.

  • Free Webinar - Situational Analysis at OnStar with Oracle Spatial Feb. 22

    Join us for the next Directions webinar: Situational Analysis at OnStar with Oracle Spatial
    When:  Wednesday, February 22nd, 2:00 PM - 3:00 PM EST
    Register now:  https://www2.gotomeeting.com/register/237138906
    OnStar is the largest telematics solution provider on the globe, with 6 million subscribers in North America and abroad. OnStar uses situational awareness and real-time analysis to deliver fast, accurate emergency services to its customers. At the core of this solution is an Oracle Spatial-based analytical server that supports Google Earth visualization and NAVTEQ data. With this system, OnStar gains better understanding of customer use and behavior and better insight during emergency situations. In hurricanes, wildfires and other disasters, OnStar has developed early warning capabilities for use in near real-time. It can then manage call center resources based on anticipated call volumes and ultimately develop more effective new processes and services.
    Learn from OnStar how the company uses Oracle Spatial to deliver insight, performance and scalability.
    Key learning points include:
    * How OnStar’s Oracle Spatial analytical server supports its real-time call center Advisor application in an environment using Google Earth visualization and NAVTEQ data
    * How spatial analysis allows OnStar to obtain better insight into disaster situations, develop early warning capabilities, and improve call center coverage
    * How Oracle Database 11g (with Oracle Spatial, Real Application Clusters, Partitioning) provides scalability and performance required to process and query OnStar’s large amounts of transactional data
    Speakers include:
    * Jeff Joyner, Emergency Strategy and Outreach, GM OnStar and Injury Research Fellow, University of Michigan Program for Injury Research and Education
    * James Steiner, Vice President, Product Management, Oracle Server Technologies
    Who should attend:
    This webinar is appropriate for CIOs, business and technical managers and analysts involved in the design and management of enterprise systems where spatial analysis can add insight and value to business processes.
    Register now: https://www2.gotomeeting.com/register/237138906

    Markus,
    Sorry for my late reply it had been awhile since I was here at SDN
    I did it manually in the 'old' way and at that time it did work.
    Kulvir,
    I did get it from SAPnet but when I downloaded it it contained the proper file.But I did had the same with an add-on for the business connector which only contained an empty file.
    Thanks for your answers and again sorry for my late reply back to you all

  • How do I know if a function is included in Oracle Spatial or in Locator ?

    Hi,
    Is there a document that lists which spatial packages are licensed as Locator and which are licence as spatial?
    Tamas

    Its all listed in Appendix B of the Oracle Spatial Developer's Guide. It varies a little from release to release so you'll need to check the guide for the database release you're on.
    John

  • Poor performance with Oracle Spatial when spatial query invoked remotely

    Is anyone aware of any problems with Oracle Spatial (10.2.0.4 with patches 6989483 and 7003151 on Red Hat Linux 4) which might explain why a spatial query (SDO_WITHIN_DISTANCE) would perform 20 times worse when it was invoked remotely from another computer (using SQLplus) vs. invoking the very same query from the database server itself (also using SQLplus)?
    Does Oracle Spatial have any known problems with servers which use SAN disk storage? That is the primary difference between a server in which I see this poor performance and another server where the performance is fine.
    Thank you in advance for any thoughts you might share.

    OK, that's clearer.
    Are you sure it is the SQL inside the procedure that is causing the problem? To check, try extracting the SQL from inside the procedure and run it in SQLPLUS with
    set autotrace on
    set timing on
    SELECT ....If the plans and performance are the same then it may be something inside the procedure itself.
    Have you profiled the procedure? Here is an example of how to do it:
    Prompt Firstly, create PL/SQL profiler table
    @$ORACLE_HOME/rdbms/admin/proftab.sql
    Prompt Secondly, use the profiler to gather stats on execution characteristics
    DECLARE
      l_run_num PLS_INTEGER := 1;
      l_max_num PLS_INTEGER := 1;
      v_geom    mdsys.sdo_geometry := mdsys.sdo_geometry(2002,null,null,sdo_elem_info_array(1,2,1),sdo_ordinate_array(0,0,45,45,90,0,135,45,180,0,180,-45,45,-45,0,0));
    BEGIN
      dbms_output.put_line('Start Profiler Result = ' || DBMS_PROFILER.START_PROFILER(run_comment => 'PARALLEL PROFILE'));  -- The comment name can be anything: here it is related to the Parallel procedure I am testing.
      v_geom := Parallel(v_geom,10,0.05,1);  -- Put your procedure call here
      dbms_output.put_line('Stop Profiler Result = ' || DBMS_PROFILER.STOP_PROFILER );
    END;
    SHOW ERRORS
    Prompt Finally, report activity
    COLUMN runid FORMAT 99999
    COLUMN run_comment FORMAT A40
    SELECT runid || ',' || run_date || ',' || run_comment || ',' || run_total_time
      FROM plsql_profiler_runs
      ORDER BY runid;
    COLUMN runid       FORMAT 99999
    COLUMN unit_number FORMAT 99999
    COLUMN unit_type   FORMAT A20
    COLUMN unit_owner  FORMAT A20
    COLUMN text        FORMAT A100
    compute sum label 'Total_Time' of total_time on runid
    break on runid skip 1
    set linesize 200
    SELECT u.runid || ',' ||
           u.unit_name,
           d.line#,
           d.total_occur,
           d.total_time,
           text
    FROM   plsql_profiler_units u
           JOIN plsql_profiler_data d ON u.runid = d.runid
                                         AND
                                         u.unit_number = d.unit_number
           JOIN all_source als ON ( als.owner = 'CODESYS'
                                   AND als.type = u.unit_type
                                   AND als.name = u.unit_name
                                AND als.line = d.line# )
    WHERE  u.runid = (SELECT max(runid) FROM plsql_profiler_runs)
    ORDER BY d.total_time desc;Run the profiler in both environments and see if you can see where the slowdown exists.
    regards
    Simon

  • Why oracle spatial query execute so slow???

    hi all,
    I have two oracle spatial table CHI_2007r2 and CHI_2008r2, each table has it's own spatial index,and each table has 2000 row record, Now execute this query,I can get the result soon,
    select /*+ ORDERED */ a.link_id from chi_2007r2 a,chi_2008r2 b where a.link_id=b.link_id and sdo_relate(a.geom,b.geom,'mask=INSIDE querytype=WINDOW')='TRUE';
    But I execute the query by geom only,it will take so long time! query(3 more hours):
    select /*+ ORDERED */ a.link_id,b.link_id from chi_2007r2 a,chi_2008r2 b where sdo_relate(a.geom,b.geom,'mask=INSIDE querytype=WINDOW')='TRUE';
    I don't upderstand...
    thanks
    David

    Because in the first statement
    select /*+ ORDERED */ a.link_id from chi_2007r2 a,chi_2008r2 b where a.link_id=b.link_id and sdo_relate(a.geom,b.geom,'mask=INSIDE querytype=WINDOW')='TRUE'; you are joining the two tables while in the second statement
    select /*+ ORDERED */ a.link_id,b.link_id from chi_2007r2 a,chi_2008r2 b where sdo_relate(a.geom,b.geom,'mask=INSIDE querytype=WINDOW')='TRUE';you are doing a cartesian merge first because there is no join between a and b other than te sdo_relate which will be calculated for every row combination you get.
    But I think you'd be better off posting in the {forum:id=76} forum.
    Best regards,
    PP
    Edited by: porzer on Jan 15, 2009 10:34 AM

  • 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';
    ++++++++++++++++++++++++++++++++

  • Location of Oracle Spatial Java Class Library

    Hello All,
    I'm looking for this library and there seems to be no link for it on the download page (http://www.oracle.com/technology/software/products/spatial/index.html). Can someone please help me?
    Thanks!
    --john                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    there is a "jlib" directory under each db component. the oracle spatial Java API is under $ORACLE_HOME/md/jlib.

Maybe you are looking for

  • BlackBerry Storm Not Working Please HELP!

    One day iI was using My BBS like any other day and it turned off unexpectedly. I tryed turning it back on and that did not work. I charged it, that also did not work. Then after that I even bought a Brand New Battery. That also did not work. Then I b

  • SOAP to FILE using BPM to catch exception and save error into the table

    Hi All My scenario SOAP to FILE using BPB is working fine but now I have a requirement to catch an exception if something wrong happened on a runtime and save it into the tracking table, is that possible, if it is please point me to the similar step

  • How to Remove Jar File name from the screen of nokia 40 series

    hi i have the problem with running midlet. the jar file jame is always visible on the screen, how to remove that ?

  • Opening tabs in Safari becomes extremely slow

    I have noticed that after having Safari open (in the background, not always being actively used) for a while that it will eventually become very slow at opening new tabs. I use iStat menus, and when Safari becomes slow, it will max out the CPU when o

  • Long Text tables

    Hi all I have a problem downloading the long text from the BW report to Excel when I export it. I want the entire string(around 1000  chars) to be displayed in a single cell in excell sheet. How can I do it? regards Paul