How to find ANGLE B/W two edges in Oracle Spatial

How to find ANGLE B/W two edges in Oracle Spatial. I have two edge connected on same node. I wanted to know the angle betwwn them. Can somebody help me out????

Ok. My first example was an approximation. The farther you get north or south of equator, the more inacurate it gets.
This one should do the trick with some degree of accuracy.
declare
  PI constant number := 3.14159265358979;
  g1 sdo_geometry;
  g2 sdo_geometry;
  g3 sdo_geometry;
  angle1 number;
  angle2 number;
  FUNCTION POINT(P_LAT  IN number
                ,P_LONG IN number)
    RETURN MDSYS.SDO_GEOMETRY IS
  BEGIN
    -- we load both the ordinate array and the point type because some spatial functions show inconsistent behavior
    -- it is not important for this example, just something to be aware of
    return(mdsys.sdo_geometry(2001,8307 -- WGS84
                             ,mdsys.sdo_point_type(p_long,p_lat,null)
                                                  ,mdsys.sdo_elem_info_array(1,2,1)
                                                  ,mdsys.sdo_ordinate_array(p_long,p_lat)));
  END;
begin
  -- For the example, project in WGS84
  -- g1,g2,g3 could also come straight out of the database as sdo_geometry
  g1 := point(50, 7);          -- Point A
  g2 := point(51, 7);          -- Point B
  g3 := point(50,10);          -- Point C
  angle1 := atan2(g2.sdo_point.x - g1.sdo_point.x,
                  g2.sdo_point.y - g1.sdo_point.y);
  angle2 := atan2(g3.sdo_point.x - g1.sdo_point.x,
                  g3.sdo_point.y - g1.sdo_point.y);
  -- depending on rotation and where we are on the planet, adjustments may be needed
  if angle1 < 0      then angle1 := angle1 + 2 * PI; end if;
  if angle2 < 0      then angle2 := angle2 + 2 * PI; end if;
  if angle2 < angle1 then angle2 := angle2 + 2 * PI; end if;
  dbms_output.put_line('Angle between the lines A-B and A-C: '||
                       round(sdo_util.convert_unit(angle2-angle1,'Radian','Degree'),1));
end;
Angle between the lines A-B and A-C: 90

Similar Messages

  • How to find out the tables effected information from oracle from

    can any one tell me how to find out the tables effected information from oracle form

    Hi,
    Please refer to the following documents.
    Note: 259722.1 - HOWTO Determine Table and Column Name from a field in a form in 11i
    Note: 241628.1 - How to Find the Query That Succeeded Recently?
    Regards,
    Hussein

  • How to find the number of ODBC connections to Oracle Database

    Hi All,
    How to find the number of ODBC connections and all connections to the Database in last week. Are there any views to get this information?
    Thanks in advance,
    Mahi

    What Ed said is true that Oracle doesn't note which type of protocol is connecting to the database, however, you can see which program is accessing the database.
    For example: if you already know of a user using ODBC, you can verify as:
    select username, osuser, terminal, program from v$session where username = 'SCOTT'
    USERNAME                 OSUSER          TERMINAL   PROGRAM
    SCOTT                    IUSR_SRV231     SRV231     w3wp.exe
    SCOTT                    IUSR_SRV231     SRV231     w3wp.exe
    2 rows selected.Assuming that you can confirm the progam noted in the above (example) is the one using ODBC, then you can change the query such as:
    SQL> select username, osuser, terminal, program from v$session where program = 'w3wp.exe';
    USERNAME                 OSUSER          TERMINAL   PROGRAM
    SCOTT                    IUSR_SRV231     SRV231     w3wp.exe
    SCOTT                    IUSR_SRV231     SRV231     w3wp.exe
    2 rows selected.Just for kicks, I checked our listener.log file, but there was no reference of odbc in it either.
    Hope this helps...

  • How to find GUI SQL*Plus command tool in Oracle 8i (version 8.1.7)

    I had installed Oracel 8i Enterprise Edition (version 8.1.7) on my server machine (Windows NT 4.0), I'd like to use Oracle Navigator (GUI SQL*PLUS command tool), but I can not find it from the menu. I know Oracle Navigator is available in Oracle 7. Can anyone tell me where and how to use GUI SQL*PLUS command tool in Oracle 8i Enterprise Edition (version 8.1.7) ?
    thanks a lot.
    David Zhu

    Hi
    Oracle Navigator is part of Personal Oracle7 and Oracle Lite. I don't know is it available in 8i Personal Edition but I am sure that it is not part of Standard and Enterprise Edition.
    Regards
    null

  • Do someone knows how to create a cluster with two nodes on oracle VM Ware

    dear members,
    can someone guide us through creating a cluster with two nodes on oracle VM. it will be nice if we can virtualiza RAC, atleast for education purposes.
    Thank you all in advance

    Here is an excellent article that explains how to do this:
    http://startoracle.com/2007/09/30/so-you-want-to-play-with-oracle-11gs-rac-heres-how/

  • How to add coordinate system SVY21(SRID: 3414) to Oracle Spatial 11g/12c

    Can any one please help me for "How to add coordinate system SVY21(SRID: 3414, for Singapore) to Oracle Spatial 11g/12c'?

    Why don't you start with the documentation: Coordinate Systems (Spatial Reference Systems)
    Especially paragraph 6.9 (6.9 Creating a User-Defined Coordinate Reference System ) should be helpful for you.
    HTH,
    Stefan

  • How to find different rows in two tables which have same schema.

    There are two tables t1 and t2, they have same schema. Table t1 includes the informtion of students last month,table t2 incude the information of the students this month. I want to find the difference of the same student between two months. What should I do and How to do?

    Look a the following example:
    Table TEST_1 TEST_2
    ID ID_TX        ID ID_TX
    1 a                   1 a
    2 b                   2 b
    4 d                   4 d
    6 f                    6 f
    7 g                   7 g
    10 j                  10 j
    10 Z                10 x --- DIFFERENT
    12 x                         --- DIFFERENT
                           20 x ---- DIFFERENT
    Query:
            Select * FROM
                 ( (SELECT '1', ID, ID_TXT FROM TEST_1 MINUS SELECT '1', ID, ID_TXT FROM TEST_2)
                  UNION
                   (SELECT '2', ID, ID_TXT FROM TEST_2 MINUS SELECT '2', ID, ID_TXT FROM TEST_1) )
            Order By ID
    RESULTS:
    '        ID ID_TXT
    1        10 Z
    2        10 x
    1        12 x
    2        20 x

  • How to find the difference between two date?

    Hi,
    I currently writing a date comparision program. Below is the idea analogy,
    Currently i need to find how many day differences between 30 July 2003 and 22 June 2004. How can i use java to code it?
    Thanks.

    there doesn't seem to be a direct way but try this:int daysBetween = 0;
    Calendar c = new GregorianCalendar(2004, Calendar.JULY, 30);
    Calendar d = new GregorianCalendar(2003, Calendar.JUNE, 22);
    while (c.get(Calendar.YEAR) != d.get(Calendar.YEAR)) {
        daysBetween += 360;
        d.add(Calendar.DAY_OF_YEAR, 360);
    daysBetween += c.get(Calendar.DAY_OF_YEAR) - d.get(Calendar.DAY_OF_YEAR);This gives the correct result of 404 (= 8 days from June 22 to June 30 + 366 days between July 1 of 2003 and 2004 + 30 days from July 1 to July 30)

  • How to find structural differences between two tables?

    I want to find the difference in structure between objects in two 11g databases:
    Here I want to identify:
    tables/ Views with same columns, same datatype, precision and constraints
    Identify if the same indexes and triggers are present.
    I do not want to compare the data.
    can someone give suggestions on this please?

    my first resource for SQL Developer questions is (That) Jeff Smith: http://www.thatjeffsmith.com/archive/2012/09/sql-developer-database-diff-compare-objects-from-multiple-schemas/.

  • How to find the difference of two columns in deski

    Hi Everyone,
    I have a deski report which is build from a single query. The report contains two tables.
    Table-1:MTK Loc
               MTKnet
    Table-2:WTK Loc
                WTKnet
    Now i need to find the difference of the columns WTKnet and MTKnet.
    These two are report level variables.Their definitins are as  below:
    MTKnet:=Sum((<Fees Collected by Per Collected>) In Body) ForEach <vMTKLocation>
    WTKnet:=Sum((<Fees Collected by Per Collected>) In Body) ForEach <vWTKLocation>
    Where <Fees Collected by Per Collected> is universe variable.
    Please help...
    Thanks in Advance......

    Hi Bol,
    As I understand you are taking MTK_Loc and WTK_Loc together in  the report which have common values under Fees Collected by Per Collected  column.
    Please follow the steps mentioned below:
    1.  Calculate the Variables MTK_Net as
           =Sum(<Fees>) IN <MTK_Loc>
    2.  Calculate the Variables WTK_Net as
           =Sum(<Fees>) IN <WTK_Loc>
    3. You will get the values based on the Locations MTK_Loc and WTK_Loc .
    You are using combination of values for MTK_Loc and WTK_Loc hence you will get the variable values in combination.
    Insert new column right to the WTK_Net and  write the formula name it Variance.
    =<MTK_Net>- <WTK_Net>
    The values look like :
    MTK_Loc      WTK_Loc             MTK_Net                 WTK_Net             Variance
    Chicago           Chicago                16,696,274.43      157,168.26            16,539,106.17
    Chicago           Madison               16,696,274.43       274,396.12            16,421,878.31
    Chicago           Milvaki                 16,696,274.43       16,622,870.97       73,403.46
    Chicago           Pennsylvania        16,696,274.43        4,299.35               16,691,975.08
    Chicago           Waukesha             16,696,274.43        22,067.08             16,674,207.35
    Here you will see values for MTK_Net are repeated because these are based on the MTK_Loc which is same for all rows i.e. Chicago , same is the case with remaining values of MTK_Loc.
    We can not calculate variabnce based on the values like Canada,Pennsylvania for all values as these values come in combination of each other and as these are all connected columns WEBI groups  Measure data based on the Dimension  and variable columns associated with it.
    MTK_Loc   WTK_Loc          MTK_Net         WTK_Net          Variance.
    Chicago        Chicago           16696274.43        157168.26           16539106.17
    However you can compare the values based on the values  as :
    1. Drag and Drop MTK_Loc and MTK_Loc separately on the report.
    2. Drag and Drop WTK_Loc and WTK_Loc separately and put it on the report, Connect it to the columns MTK_Loc and MTK_Loc columns already dragged. Then you can compare the values
    MTK_Loc                MTK_Net                         WTK_LOC                    WTK_Net
    Chicago                    16,696,274.43                 Chicago                       157,168.26
    Madison                   315,705.91                       Madison                      274,396.12
    Manitowoc              362,632.50                        Manitowoc                  359,978.50
    Milvaki                    54,172.84                          Milvaki                       16,622,870.97
    Pennsylvania             2,966.56                           Pennsylvania               4,299.35
    Waukesha                 9,028.03                          Waukesha                      22,067.08
    Here I unchecked the option avoid duplicate row aggregation (select table-> format table) thatu2019s why it is showing all values as a  sum of all MTK_Net and WTK_Net values corresponding to Location values..
    Here we are using MTK_Loc and WTK_Loc separately and not connected because though values seems same but they are used in combination ( Chicago, Pennsylvania)  in 2 separate tables in DB hence we canu2019t synchronize them by liking these 2 location columns using 2 data providers.
    I Hope this is what you want....
    Thanks....
    Pratik

  • How to find varience records in two tables

    Hi,
    i have two tables like emp1, emp2
    data in emp1:
    empname empid add
    alasta 10 ca
    mark 20 nw
    chews 30 jp
    data in emp2:
    empname empid add
    alasta 10 ca
    mark 20 nw
    chews 30 jp
    burgess 45 ngm
    if u observe the above two tables data you can easily identify there is repeated data/duplicated data in both tables.
    as there any way find out using comparison same records in two tables..........
    if i write a query then i can easily understand the same data is existed in two tables
    Thanks in advance....

    >
    as there any way find out using comparison same records in two tables..........
    >
    >
    if i write a query then i can easily understand the same data is existed in two tables
    >
    So, what is your problem now?
    You can join both the tables using a simple query and get the records.
    select e1.empname, e2. empname from emp1 e1, emp2 e2 where
    e1.empname = e2.empname and e1.empid = e2.empid

  • How to find the hours between two timing

    Hai All
    I had a problem that i need to calculate a working hours
    For example
    Intime outtime
    0815 1715
    so i need to calculate a time between these two timing
    how can i do using function for 100 nos
    Regards
    Srikkanth.M

    Srikkanth.M wrote:
    Hai Man
    I think i got half a way, But the time is not coming exactly. so how can i do the same code that u have give inside a function is it possible to do a function with these three requirementThis can be done in the following way, but a function should always return a value.
    Here I have just returned a dummy value of 1.
    create or replace
    function testingFunction (<paramters if any>) return number
    as
    begin
    update testTable set (wtime,ltime,etime)=(select extract(hour from (to_date('0930','HH24:MI')-to_date('1200','HH24MI')) day to second),
    case when extract(hour from (to_date('0930','HH24:MI')-to_date('1200','HH24MI')) day to second) > 0830
    then extract(hour from (to_date('1200','HH24:MI')-to_date('0830','HH24MI')) day to second)
    else 0 end,
    case when To_number('0900') > to_number('0815') then extract(hour from (to_date('0900','HH24:MI')-to_date('0815','HH24MI')) day to second)
    else 0 end from dual);
    return 1;
    end;
    A better option would be to create a stored procedure and call that. Just like the way I have done below
    create or replace
    procedure testingprocedure (<paramters if any>)
    as
    begin
    update testTable set (wtime,ltime,etime)=(select extract(hour from (to_date('0930','HH24:MI')-to_date('1200','HH24MI')) day to second),
    case when extract(hour from (to_date('0930','HH24:MI')-to_date('1200','HH24MI')) day to second) > 0830
    then extract(hour from (to_date('1200','HH24:MI')-to_date('0830','HH24MI')) day to second)
    else 0 end,
    case when To_number('0900') > to_number('0815') then extract(hour from (to_date('0900','HH24:MI')-to_date('0815','HH24MI')) day to second)
    else 0 end from dual);
    end;
    and call the procedure
    testingprocedure(<parameters if any>);
    Naveen

  • How to find the ratio of two frequencie​s in fft

    Hi i am john,
    I need to find the ratio of 1st and 2nd frequencies in fft graph.
    Already i got information from this site only. Mr. Alten helped me.
    Now i have to continue the same problem and need to find the ratio of the frequencies.
    Please someone help me guys....
    I will attach my vi file and text file.
    Solved!
    Go to Solution.
    Attachments:
    Excel 2.lvm.txt ‏7 KB
    Excel 1.lvm.txt ‏7 KB
    To find fft_MODCA.vi ‏14 KB

    Thanks a lot  Mr.JohnSold. 
    But i need to find fft for the other sample of datas. i cant be able to get it through the vi which u have posted. please check it and send me the new program. Sorry for disturbing u. 
    PFA
    Attachments:
    C2 50hz 7kv 00000.lvm.txt ‏24 KB
    C2 50hz i 00001.lvm.txt ‏24 KB

  • How to find common fields between two tables

    Hi friends,
    Is there any way to find out common fields between tables and linking the tables based on common fields.
    Thanks and Regards,
    Chitty.

    Hi Chitty,
      Try using joins it will give the fields which are only common to both the fields.
    Here s an example,
    SELECT mara~matnr
           marc~werks
    INTO   TABLE t_material
    FROM   mara AS mara INNER JOIN marc AS marc
    ON     maramatnr = marcmatnr
    WHERE  mara~mtart = p_mtart.
    Much Regards,
    Amuktha.

  • How to find memory diffrence between two programs

    Hi all,
    i want some clarification
    i have one which is occuping more memory
    then i copied that  program to antoher program
    now i want to check memory diffrence between these two program.
    ASAP
    Regards
    Venu

    Use SE30 Transaction ,run ur first program and then second program..
    For better results use ST05 (SQL Trace ) .
    goto ST05 and then trace on...
    use first transaction...
    then trace off and see list.
    use one more session and then use ST05 Again,
    Trace on ,use second transaction see the list.
    compare both list and you will have some idea now.
    Reward Points if it is helpful
    Thanks
    Seshu

Maybe you are looking for

  • In FBL5N report user wants the sales document number to be displayed,

    HI, Guys Need ur help to sort out the problem In FBL5N report user wants the sales document number to be displayed, but the sales ducument number column is coming blank and this needs to pick from VBRP table As I discussed with Abaper, he reqiures a

  • How to automate the Acrobat Reader plugin in Internet Explorer

    Hi, I have been trying to figure out how to automate the Acrobat Reader plugin in Internet Explorer. My goal is to find a way to allow users of our web application to print PDFs to the default printer without having to go through the plugin's GUI. Ou

  • Query in XMLType

    I have stored a typical Purchase Order List as XMLType in Oracle. The structure looks roughly as - <polist> <po> <customer> <lineitems> <lineitem> <item> <price> <quantity> So my polist has multipe po's and each po's has multipe items. Now, I want to

  • Update Infotype 1016

    Hi, I have to update Infotype 1016 using the BAPI FM "BAPI_HRMASTER_SAVE_REPL_MULT". Two tables need to get updated, HRP1016 & HRT1016. The Data in the HRT 1016 is a Table Data for Record in HRP1016. Say: Orgunit O 10000001 has two standrd Profiles..

  • Having problem with keyboard/computer

    Suddenly, my keyboard is behaving very strangely. Sometimes, like now, it seems to work fine, then instead of, say, lol, it will type 363. When the keys don't work, neither does the delete button. I usually use Safari, but tried Foxfire. The keyboard