6 Replies Latest reply: Mar 28, 2014 9:09 AM by navaneet RSS

    Extend lines within extropolated rectangle polygons/regions

    navaneet

      Hello,

      I have a dataset with numerous two small perpendicular separate lines as shown below. Lines I would like to extend the lines only within zones 1 and 2. They are almost expected to form a rectangle polygon. Expecting good ideas from the team.


      ---      ---
      |            |        
      |            |

             1

      |              |        
      |              |
      ---        ---|-


      ---      ---
      |            |        
      |            |

             2

      |           |        
      |           |
      ---     ---|-


      Thanks in advance.

        • 1. Re: Extend lines within extropolated rectangle polygons/regions
          Stefan Jager

          I've looked at this twice now, and still have no idea what it is you are trying to achieve. Should all the small lines around the 1 and the 2 become one rectangle? Do you want to optimize and connect the smaller lines to become one line?

          Trying to do something within a smaller area is easy: just select the stuff within the area of interest and work on your resultset, and nothing else. But what is it you are trying to achieve?

          • 2. Re: Extend lines within extropolated rectangle polygons/regions
            navaneet

            Stefan,

             

            Thanks for looking at it. Yes. All the small lines in 1 and 2 should become one rectangle. Yes. I would like to optimize and connect the smaller lines to a single line or polygon.

             

            Current Data

                |    |                   |    |                  |    |        

                |    |                   |    |                  |    |

            ----     ----            ----     ----           ----     ----

                                                            

            ----     ----            ----     ----           ----     ----

                |    |                   |    |                  |    |

                |    |                   |    |                  |    |

                                                            

                             1                        2    

                                                                 

                |    |                   |    |                  |    |

                |    |                   |    |                  |    |

            ----     ----            ----     ----           ----     ----

                                                            

            ----     ----            ----     ----           ----     ----

                |    |                   |    |                  |    |

                |    |                   |    |                  |    |

               

            Expected Result

            Dotted lines are interpolated and joined as much as possible to a single line or polygon for areas 1 and 2.

             

               |    |                   |    |                  |    |        

               |    |                   |    |                  |    |

            ----     ----........... ----     ----...........----     ----

                                                            

            ----     ----............----     ----...........----     ----

                |    |                   |    |                  |    |

                |    |                   |    |                  |    |

                :    :                   :    :                  :    :

                :    :        1          :    :        2         :    :

                :    :                    :    :                   :    :

                |    |                   |    |                  |    |

                |    |                   |    |                  |    |

            ----     ----............----     ----...........----     ----

                                                            

            ----     ----............----     ----...........----     ----

                |    |                   |    |                  |    |

                |    |                   |    |                  |    |

             

            I understand it will not be a single step but series of optimization.

             

            Best

            Navaneet

            • 3. Re: Extend lines within extropolated rectangle polygons/regions
              Michael C Dunn

              If you can get the cluster of lines that you want to join together into a single multi-line (e.g. using SDO_GEOM.SDO_UNION)

              and their directions are all consistent, for example

               

              SDO_GEOMETRY(2006, null, null,
              sdo_elem_info_array(1,2,1,7,2,1,13,2,1,19,2,1),
              sdo_ordinate_array(
              0,20,0,0,20,0,
              30,0,50,0,50,20,
              50,30,50,50,30,50,
              20,50,0,50,0,30))
              

              you could just manipulate the geometry to turn it into a polygon, i.e.

              - change the GTYPE to a polygon

              - change the ELEM_INFO_ARRAY to indicate an single exterior ring instead of a series of individual lines

              - append the first vertex to the end of the ORDINATE_ARRAY (to close it off)

               

              So for the example multi-line above you'd end up with,

              SDO_GEOMETRY(2003, null, null,
              sdo_elem_info_array(1,1003,1),
              sdo_ordinate_array(
              0,20,0,0,20,0,
              30,0,50,0,50,20,
              50,30,50,50,30,50,
              20,50,0,50,0,30,0,20))
              

               

              I suspect getting all the line segments in the correct order and in the correct direction to form a valid polygon may be harder though. If they're not well-ordered and oriented the result will be a mess!

              • 4. Re: Extend lines within extropolated rectangle polygons/regions
                B Hall

                Navaneet,


                You aren't by chance trying to take a bunch of intersections and make a road grid are you?


                If so - I would highly discourage you from doing this. Where I worked before, they once had nice street polygons - one per street. Then some wise guy decided it would be "better" (I don't know what that criteria was) to union all the roads into a huge multi-polygon/island entity.


                BAD idea - don't go there. You are much better off with street polygons that overlap, merging them on display.


                Bryan

                • 5. Re: Extend lines within extropolated rectangle polygons/regions
                  navaneet

                  Michael,

                   

                  Your direction will be certainly helpful. Yes. Lines are not well ordered.

                   

                  Best

                  Navaneet

                  • 6. Re: Extend lines within extropolated rectangle polygons/regions
                    navaneet

                    Bryan,

                     

                    Thanks for the caution on creating street polygons. I am not trying to make polygon. But my intention is to find the nearest distance of point facilities to these lines. Since part of the inferred lines missing in the legacy data, my distance calculation may not be correct. I thought making them into some kind of polygons or composite lines would be helpful.

                     

                                  o Point
                                  |
                                  | Inferred distance to Line

                      ------.......|.............................---- 

                     

                     

                    Best

                    Navaneet