How to find the ANGLE b/w two edges in Oracle Spatial

How to find the ANGLE b/w two edges on Oracle Spatial. I have two edge connected on the same node. I wanted to know the angle betwwn them. Can someone help me?

Ok. My first example is an approximation. Further you get North or South of the Ecuador, gets the more vague.
This one should do the trick with some degree of precision.

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

Tags: Database

Similar Questions

  • Find the minimum distance between two SDO_GEOMETRY in Oracle Spatial?

    annular ring edit.png

    A circle (SDO_GEOMETRY)
    B - polygon (SDO_GEOMETRY)

    CASE:
    B contains A (or)
    The Interior of B.

    How to find the minimum distance between A and B in Oracle Spatial

    Hello guuid nameless person.

    What is

    my_answer := MDSYS.SDO_GEOM.SDO_DISTANCE(
       my_circle_geometry
      ,MDSYS.SDO_UTIL.POLYGONTOLINE(my_outer_polygon)
      ,my_tolerance
    );
    

    Now, you may need to pay attention to the holes in your polygon, would you the distance and an inner ring if it was closer to you?

    If the measure is only to outer rings, so something like

    my_answer := MDSYS.SDO_GEOM.SDO_DISTANCE(
       my_circle_geometry
      ,MDSYS.SDO_UTIL.POLYGONTOLINE(
          MDSYS.SDO_UTIL.EXTRACT(my_outer_polygon,1,1)
       )
      ,my_tolerance
    );
    

    And then also beware of the multipolygons as the foregoing only measured against the first polygon in the MultiPolygon.  You need to loop through the polygons of tests just the outer ring in this case.

    See you soon,.

    Paul

  • How to find the ID of a submit button in oracle seeded pages

    Hello

    I tried downloading the page locally and I try to open using jdev, but "oa:popup" is not valid message is coming.

    So I can not open this page so not able to see the ID of the button.

    Can you tell me how to find the ID in another way.

    Hello

    If your cannot open page in jdev, then copy the page (xml file) from the server and save to anywhere on your local computer, which opened in Notepad, here you can find the ID of your button required. However, the norm is to open the page in jdev
    Haroon.

  • How to find the forces in FACT form

    Hi all

    I am new in Oracle EBS, I just add FDF format but could not find the name in FACT of this screen (Misc Transaction inventory). Can you please help me find the de FACTO forces in screen.

    Thank you

    Hello

    Pl.Visit suite of links.

    http://alloracletechnical.blogspot.in/2009/08/how-to-find-DFF-name.html
    How to find the name of de FACTO Standard in oracle apps

    HTH
    Sanjay

  • How to find the port # OEM?

    How to find the port # in the Oracle enterprise Manager URL (http://mydatabase:xxxx / em /). I installed the Oracle long back do not write the URL. How to find the number XXXX in this case?
    Oracle 10g R2.
    Thank you
    Smith

    emctl status dbconsole

    It's probably in 1158 or 5500 (according to the version)

    Kind regards
    Uwe

    http://uhesse.WordPress.com

  • How to find the point of intersection of the two geometry?

    Hello
    Could someone give some suggestions on how to find the point of intersection of the two geometry?
    I need just point. (x, y, z)
    Thank you

    Can you post the full result of geometry returned?

    What you should have as a result:

    MDSYS. SDO_GEOMETRY (2001, 1, NULL, MDSYS.) SDO_ELEM_INFO_ARRAY (1,1,1), MDSYS. SDO_ORDINATE_ARRAY (2.0,2.0))

    Notice the sdo_intersection will use only the sdo_ordinate_array, even if the result is a point! (with the SDO_POINT is NULL.)

    where do you find these x, y, z values of?

    On your other question:

    -using the operator space sdo_relate (with mask = ANYINTERACT) will return in pairs, the result of the intersection of each anyinteracting polygon, line combination.

    -of course, these results will vary from point, multipoint, line or multiline even depending on how the interaction takes place.

    -try to explain a bit more what do you mean 'I want only points to return' of nit.

    Luke

  • find the angle of rotating an image in 8-bit grayscale

    Hi all

    I have an image in grayscale 8 bits of dimension 3969 X 600, the image is slightly tilted. I need to find the rotation angle and apply the rotation before treatment.

    Are there transformation features in LabVIEW to find the angle of rotation?

    Need your suggestions people,

    Hello

    just calculate the slope of the line joining the two points:

    xDiff = p2.x - p1.x

    yDiff = p2.y - p1.y

    [degrees] angle = atan2 (yDiff, xDiff) *(180/pi)

    Best regards

    K

  • How to find the velocity of an incremental encoder

    I use the RE22I encoder which can give up to 8192 pulses per revolution, I have A, B, Z reports that I use an fpga as a controller Please help me.

    How to find the speed of the encoder using these signals I'm going to have a clock in the fpga sysytem will help.

    Start by looking at the information on Wikipedia on the rotary encoders and a book on encoders OR white.  These articles will give you a basic understanding of the encoder and the signals it produces.

    With proper decoding, you can get the direction and momentum of each of the points on your encoder 8192.  If the tree can reverse (same vibration on one point unique all-in-mnearly stationary), full decoding must be used.  If data are only of interest while the tree turns in a direction and speed will not close to zero, a simple decoding can be used.  Decoding of a quadrature encoder is a good way to learn to use a state machine.  Signals A and B can exist in only four possible combinations, but the possible transitions to do interesting things.

    Define DECODING is a purely logical exercise and it is a simple coding in LabVIEW, such as a state machine.  There are examples, Desing Patterns, or project templates (depending on your version of LV) that come with LV to help you get started.

    By using the channels A and B you can update your calculation of velocity 8192 times per turn.  With the help of Z you get only an update by the revolution. You use depends on your application.  The pulse of Z is also useful to define a reference position for the measurement of phase angle.

    Lynn

  • average of k: how to find the data clustred; : or how to assign number t0 each data group

    Hi Member

    I have download the LabVIEW Machine https://decibel.ni.com/content/docs/DOC-19328 learning package

    I want to run the K average algorithm to group the image in a group of two or three or more

    the problem is how to find the result I mean the image of clustred', the image that contain 2 or three threatened value only

    or how aasign a 1 value for all the intesity who

    belong to the cluster a and 255 for data that belongs to group 2

    for the look of the image as binary image?

    a my vi below

    Best regards

    my post before shows how to set the threshold manually using the slider of the graph.

    Here is the version k-means automated help .vi box tools

    Alex

  • How to change the angle of the image?

    Hello everyone

    Before I type my question here, I want you to know that I am a beginner with the Adobe Illustrator program.

    Does anyone know how to change the angle of? 3D Animations

    My goal is that the yellow beam is more visible than it is now.

    Unbenannt.png

    PS: English is not my motherlanguage, so I'd be glad that you would write in easy English words

    Illustrator is not suitable for the modeling of a 3D world.

    You can of course draw this, but it will take the building methods of perspective. The 3D effects help in this.

    You will find tutorials here:

    http://www.automotiveillustrations.com/tutorials/drawing-tutorials.html

    Also: Take a look at working with illustrators perspective grid.

    https://helpx.Adobe.com/Illustrator/using/perspective-grid.html

    (plenty more in the manual, please read all)

  • How to find the name of the Oracle database server?

    People,

    Hello. I installed Oracle Database 11 g 2 OS Oracle Linux 5. The installed directory is/home/user/OracleDB_Home and/home/user/OracleDB_Base.

    Host name is "mylinux". Name of the database instance is PT853.

    I use "mylinux" as the name of the database server, it does not work. I use another way to do as below:

    Export ORACLE_HOME = / home/user/OracleDB_Home

    Can I use "mylinux ORACLE_HOME" as the name of the database server, it does not work either.


    My question is:

    How to find the name of the database server Oracle with Oracle Linux 5 OS?


    Thank you.

    You must learn the basic of database Oracle.

    Please don't regard it not same as SQL server in terms of configuration.

    You never specify the database server name in Oracle.

    You specify the host name in only two places, 1) Tnsnames.ora/JDBC/ODBC (or any client you want to connect) and listener.ora) 2.

    There was nothing called specify the name of the Oracle database from an oracle database server.

    Concerning

    Anurag.

  • How to find the relationship between the tables

    Hello
    I am working in Oracle R12

    How to find the relationship between these tables INV_MIN_MAX_TEMP, po_requisition_lines_all and Per_all_people_f

    These two tables, I joined with po_requisition_lines_all and Per_all_people_f To_person_id of PO and anyone HR table but I can't able to join this table with other tables INV_MIN_MAX_TEMP

    concerning
    Srikkanth

    solved

  • How to find the employee is rehired

    Hello

    How to find the employee is rehired?

    through Front End and back End

    Thank you.

    You're looking to identify if an employee was re-employed, or looking to find all employees who were rehired?

    To determine if an employee was re-employed:
    (1) place you * HRMS Manager > people > enter & maintain
    (2) look at the employee's most recent Start Date field
    (3) compare this to their first Date field engaged in the Services tab

    If the two are different, it means that the employee was re-employed.

    Technically, each period of employment is linked to their period of Service. They will be on the per_periods_of_service table. So, there are 3 rows in per_periods_of_service if an employee was re-employed twice (that is to say, initially engaged and then reembauche twice).

    I hope this helps.

  • says that there is an update of firmware available for my 3 t time capsule. I get "an error occurred when downloading". How to find the problem?

    I said that there is an update of the firmware available for my 3 t time capsule. I get the message "an error occurred when downloading". How to find the problem? I have elcapitan 10.11.6 and capsule version 7.7.3

    Try temporarily, connect your MacBook Pro to your Time Capsule using an Ethernet connection... If not already, then try downloading the firmware again.

  • How to find the serial number of the processor in the MacBook pro s serial number? I have a dead MacBook that was given for service to a third party. I doubt that they have replaced the original parts. Help, please. Thank you

    How to find the serial number of the processor in the MacBook pro s serial number? I have a dead MacBook that was given for service to a third party. I doubt that they have replaced the original parts. Help, please. Thank you

    As far as I KNOW, the serial number of the MacBook does not have the serial number of the processor.

Maybe you are looking for