Offset_geom_segment

I have some code using sdo_lrs.offset_geom_segment that is producing results that I can't explain. In a nutshell, I'm just trying to offset a simple straight line in 10.2.0.3.
The first example works fine, the second with a positive offset returns a NULL geometry:
SELECT sdo_lrs.offset_geom_segment
                         (SDO_GEOMETRY (3302,
                                        8307,
                                        NULL,
                                        sdo_elem_info_array (1, 2, 1),
                                        sdo_ordinate_array (141.357782781269,
                                                            40.7192916042001,
                                                            0,
                                                            141.357801395643,
                                                            40.7192841972761,
                                                            1
                          0,
                          1,
                          -0.1524,
                          (.1524 / 8),
                          'arc_tolerance=' || (.1524 / 4)
  FROM DUAL;
SELECT sdo_lrs.offset_geom_segment
                         (SDO_GEOMETRY (3302,
                                        8307,
                                        NULL,
                                        sdo_elem_info_array (1, 2, 1),
                                        sdo_ordinate_array (141.357782781269,
                                                            40.7192916042001,
                                                            0,
                                                            141.357801395643,
                                                            40.7192841972761,
                                                            1
                          0,
                          1,
                          0.1524,
                          (.1524 / 8),
                          'arc_tolerance=' || (.1524 / 4)
  FROM DUAL;

Hi Brian
There seems no problem on my machine when using SQL+:
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> SELECT sdo_lrs.offset_geom_segment
  2                           (SDO_GEOMETRY (3302,
  3                                          8307,
  4                                          NULL,
  5                                          sdo_elem_info_array (1, 2, 1),
  6                                          sdo_ordinate_array (141.357782781269,
  7                                                              40.7192916042001,
  8                                                              0,
  9                                                              141.357801395643,
10                                                              40.7192841972761,
11                                                              1
12                                                             )
13                                         ),
14                            0,
15                            1,
16                            0.1524,
17                            (.1524 / 8),
18                            'arc_tolerance=' || (.1524 / 4)
19                           )
20    FROM DUAL;
SDO_LRS.OFFSET_GEOM_SEGMENT(SDO_GEOMETRY(3302,8307,NULL,SDO_ELEM_INFO_ARRAY(1,2,
SDO_GEOMETRY(3302, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(
141.357784, 40.7192928, 0, 141.357802, 40.7192854, 1))
SQL> SELECT sdo_lrs.offset_geom_segment
  2                           (SDO_GEOMETRY (3302,
  3                                          8307,
  4                                          NULL,
  5                                          sdo_elem_info_array (1, 2, 1),
  6                                          sdo_ordinate_array (141.357782781269,
  7                                                              40.7192916042001,
  8                                                              0,
  9                                                              141.357801395643,
10                                                              40.7192841972761,
11                                                              1
12                                                             )
13                                         ),
14                            0,
15                            1,
16                            -0.1524,
17                            (.1524 / 8),
18                            'arc_tolerance=' || (.1524 / 4)
19                           )
20    FROM DUAL;
SDO_LRS.OFFSET_GEOM_SEGMENT(SDO_GEOMETRY(3302,8307,NULL,SDO_ELEM_INFO_ARRAY(1,2,
SDO_GEOMETRY(3302, 8307, NULL, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(
141.357782, 40.7192904, 0, 141.357801, 40.719283, 1)) However, when trying this through SQL developer interface, SQL developer hangs.
Luc
Edited by: lucvanlinden on Feb 19, 2009 8:52 AM
Edited by: lucvanlinden on Feb 19, 2009 8:54 AM

Similar Messages

  • SDO_LRS.OFFSET_GEOM_SEGMENT

    Hello folks,
    Oracle EE 11gR2 w/spatial
    So I have this geometry that I am working on.  I am using it as a base intersection and I want to be able to offset it in pretty much any direction.  The image ( A screenshot from geoRaptor ) is below:
    As you can see there are nodes and links representing a typing intersection of a roadway.  The arrows indicate direction of flow and the nodes ( pink doughnuts )  indicate points on which to join to other links.  These links are defined as linestrings and the nodes as 2D points.  This is pretty straight forward I believe.
    So I have used offset_geom_segment, doing the requisite conversion to LRS and back.  This all works fine.  I can return a new geometry either left or right which of course follows the direction ( based upon the order of the points). So my question is this:
    Am I missing something or is there an LRS or plain SDO to select either a centroid or a point within the linestring and the point geometry of the node to offset it to a complete new point and have the lats and longs adjusted in a similar fashion as the offset_geom_segment does?  I understand the concept of projecting a point at a bearing & tilt so establishing a new reference point is straight forward.  So am I beaing dense or just not looking deep enough?  I cant seem to find a single was to "move" a geometry and have the vertices updated by the call.  Do I have to manually take each point, project a new point from it then adjust?  Looking for a simple way to do this.

    FlyingGuy wrote:
    I cant seem to find a single was to "move" a geometry and have the vertices updated by the call.  Do I have to manually take each point, project a new point from it then adjust?  Looking for a simple way to do this.
    That's because there isn't one. Oracle never intended Spatial to be an editing tool, so editing geometries is not really part of the package. That said, it isn't that difficult: you've got your offset (or "moved") geometry, so you can simply update the the geometry it came from. That's not that difficult, is it? For a simple moving of a line or point, I think the affine transformation is a bit overkill. But something like this I don't think should be a problem:
    update table t set t.geometry = sdo_lrs.offset_geom_segment(sdo_lrs.convert_to_lrs_geom(t.geometry), <whatever else offset needs>);
    Mind you this is written off the top of my head, so you may need to check a few parameters and such, but I don't see why something like this couldn't work. If neccesary you can even wrap it in a small function.
    HTH,
    Stefan

  • Problem with OFFSET_GEOM_SEGMENT

    I'm having a problem trying to use the LRS offset segment function. Possibly I'm mis-interpreting the docs since I keep getting an incorrect ARC_TOLERANCE specification with both 10.1.0.4.0 and 10.2.0.1.0. What am I missing?
    SELECT SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(
    SDO_GEOMETRY(3302, 8307, NULL, SDO_ELEM_INFO_ARRAY(1,2,1),
                   SDO_ORDINATE_ARRAY(0,0,0, 1,1,1) ),.05) from dual;
    TRUE
    1 row selected.
    SELECT SDO_LRS.OFFSET_GEOM_SEGMENT(
    SDO_GEOMETRY(3302, 8307, NULL, SDO_ELEM_INFO_ARRAY(1,2,1),
                   SDO_ORDINATE_ARRAY(0,0,0, 1,1,1) ), 0, 1, -4, .05) FROM dual;
    SELECT SDO_LRS.OFFSET_GEOM_SEGMENT(
    ERROR at line 1:
    ORA-13292: incorrect ARC_TOLERANCE specification
    ORA-06512: at "MDSYS.SDO_LRS", line 6936

    Ah ha... Thanks!
    I didn't realize the unit parameter was not optional. The documentation is a bit misleading on this (IMHO) since it shows the units item as optional, and even gives a default (although "not" optional - not sure how you do that) tolerance parameter:
    SDO_LRS.OFFSET_GEOM_SEGMENT(
    geom_segment IN SDO_GEOMETRY,
    start_measure IN NUMBER,
    end_measure IN NUMBER,
    offset IN NUMBER,
    tolerance IN NUMBER DEFAULT 1.0e-8
    [, unit IN VARCHAR2]
    ) RETURN SDO_GEOMETRY;
    But... the "fine print" (that I skipped over since I didn't need to mess with units) then goes on to say:
    If the input geometry is geodetic data, this parameter is required, and arc_tolerance must be specified.
    Possibly for these type of sometimes optional type issues, the train-track option approach is better.
    I am still left me wondering exactly what that tolerance parameter is being used for with this function...
    Bryan

  • Mapviewer, parallel lines and custom rendering

    I have been scratching my head a bit on this:
    We have some databases which contains various types of water/sewer-pipes. These lines (pipes) has an attribute connected to them, which describes displacement and ranges from -3 to 3 (where a "normal" centered lines is 0).
    Since we are very interested in the mapviewer WMS-feature, and want to render the map just the way we do in our apps, I am wondering, is there some way I can implement "server-logic" to apply displacement to the lines according to the displacement-attribute ?
    Thanks in advance,
    Oyvind

    Oyvind
    You could use a view that references the original geometry (or just store it back in the same table in a different column), offsetting it to one side or the other using the LRS functions.
    First, you’ll have to add an LRS value (unless you already have them) using SDO_LRS.CONVERT_TO_LRS_GEOM. Start and End could be 0 and 1.
    Then offest that LRS geometry using SDO_LRS.OFFSET_GEOM_SEGMENT.
    Then remove the LRS items (unless that doesn’t make any difference in your app):
    CREATE OR REPLACE VIEW corrected_pipedata
    (geom)
    AS
    SELECT SDO_LRS.CONVERT_TO_STD_GEOM( SDO_LRS.OFFSET_GEOM_SEGMENT( SDO_LRS.CONVERT_TO_LRS_GEOM(a.in_geom, 0, 1),
    0, 1,
    a.in_offset))
    FROM pipedata a
    Example:
    SELECT geometry_l from c_path_segment WHERE rownum < 2;SDO_GEOMETRY(3002, 8307, *, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(-80.5460927551392, 28.4766171261354, 0, -80.5460869608106, 28.4766337523028, 0))
    SELECT SDO_LRS.CONVERT_TO_STD_GEOM(SDO_LRS.OFFSET_GEOM_SEGMENT( SDO_LRS.CONVERT_TO_LRS_GEOM(a.geometry_l, 0, 1),0, 1,
    -1 ,
    0.005,
    'unit=meter arc_tolerance=0.05'))
    FROM c_path_segment a
    WHERE rownum < 2;
    SDO_GEOMETRY(3002, 8307, *, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(-80.5460833610681, 28.4766140113997, 0, -80.5460829955615, 28.4766144706575, 0, -80.546077201
    2316, 28.4766310968245, 0))
    SELECT SDO_LRS.CONVERT_TO_STD_GEOM(SDO_LRS.OFFSET_GEOM_SEGMENT( SDO_LRS.CONVERT_TO_LRS_GEOM(a.geometry_l, 0, 1),0, 1,
    1 ,
    0.005,
    'unit=meter arc_tolerance=0.05'))
    FROM c_path_segment a
    WHERE rownum < 2;
    SDO_GEOMETRY(3002, 8307, *, SDO_ELEM_INFO_ARRAY(1, 2, 1), SDO_ORDINATE_ARRAY(-80.5461024997426, 28.4766189245689, 0, -80.5461025147173, 28.4766197816126, 0, -80.546096720
    3901, 28.4766364077804, 0, -80.546096182864, 28.4766370831801, 0))

Maybe you are looking for

  • HT1657 my movie rental wont download completely

    My rental movie wont download past 1 min 59 secs of play time. what do i do

  • My Apple TV buffers TV content but is fine with Movies

    I can easily watch a movie that I have purchased from the Apple TV with absolutely no buffering, but every time I try and watch a television show that I have purchased from the Apple TV it buffers in a way that I can't bear to watch it. This is clear

  • ACE 4710 breaks single sign-on on IE

    I haven't run into this before and I can't find anything in the documentation regarding it.  (Our 2 4710 were setup prior in a routed configuration although I personally see no reason for it.)  Regardless, we have 2 servers that host 4 websites on th

  • S820 language issue...

    Hi everyone, Having an issue with the s820 model it came through today and was in chinese when I received it, so I looked up how to change the model language to English, I did that successfully, however, the phone's interface and operating system .et

  • Is this a scam/phishing e-mail asking me to re-validate my contacts/calendar with my Google account?

    Hi BB team, I've received apparently a genuine e-mail from : [email protected] , advising me that I should to go into my e-mail account setting to re-validate my gmail account in order that it can synchronize again with my contacts and calendar. So f