5 Replies Latest reply: Oct 17, 2012 8:41 AM by navaneet RSS

    Calculate centerline length from polygon

    navaneet
      How to convert polygon to centerline to calculate its length?
        • 1. Re: Calculate centerline length from polygon
          Simon Greener
          I presume that you are not after the length of a polygon's bounday but the length of a medial line after its construction from a polygon?

          Oracle 11gR2 does not have such a capability. It might do in 12c but no one knows what is planned for that release, spatially.

          I have been contacted a number of times about implementing a medial axis algorithm for my Spatial Companion 4 Oracle (SC4O) free software. It can be done as this example from wikipedia shows:

          https://commons.wikimedia.org/wiki/File:Medial_axis_example_2d.svg

          But I am not prepared to implement such an algorithm without 1) real data and, 2) some sort of incentive.

          regards
          Simon
          • 2. Re: Calculate centerline length from polygon
            John O'Toole
            Hi Navaneet,

            As Simon mentioned, there is no native function in Oracle Spatial to generate a centreline for a polygon and I am not aware of any existing implementation that will run in Oracle. There are various implementations in commercial software applications, but I guess I can't list them here.

            If you are interested in reading more about generating polygon centrelines, there is an excellent blog series on the Smathermather's blog:
            http://smathermather.wordpress.com/2011/09/16/what-is-the-center-line-of-a-polygon-or-how-to-change-labeling-in-geoserver/
            http://smathermather.wordpress.com/2011/09/26/what-is-the-center-line-of-a-complex-polygon-cont/
            http://smathermather.wordpress.com/2011/10/08/what-is-the-center-line-of-a-complex-polygon-cont-2/
            http://smathermather.wordpress.com/2011/10/18/what-is-the-center-line-of-a-complex-polygon-cont-3/
            http://smathermather.wordpress.com/2012/01/14/what-is-the-center-line-of-a-complex-polygon-cont-again/
            http://smathermather.wordpress.com/2012/01/17/what-is-the-center-line-of-a-complex-polygon-new-approach/
            http://smathermather.wordpress.com/2012/08/02/what-is-the-center-line-of-a-complex-polygon-routing-as-the-solution/
            http://smathermather.wordpress.com/2012/08/09/what-is-the-center-line-of-a-complex-polygon-routing-stream-and-rivers/
            http://smathermather.wordpress.com/2012/08/10/what-is-the-center-line-of-a-complex-polygon-routing-stream-and-rivers-part-two/

            Regards,
            John
            • 3. Re: Calculate centerline length from polygon
              navaneet
              John

              Nice example. Identification of text angle for parcel boundaries is excellent.

              Best
              Navaneet
              • 4. Re: Calculate centerline length from polygon
                navaneet
                Simon,

                Yes. I was interested in the length of the medial line.

                I searched all the oracle functions and your site and after exhaustion I put down this question.

                Since it is simple sleeve around gas pipes with constant diameter, I devised a workaround to resolve the current problem. But to determine medial line on complex polygon as mentioned in John's example will require more involvement. I also used Safe Software 'CenterLineReplacer' with success.

                It is better we have this as of part of future oracle functions.

                Best
                Navaneet

                Edited by: navaneet on Oct 16, 2012 4:21 PM
                • 5. Re: Calculate centerline length from polygon
                  navaneet
                  Successfully used the Safe Software 'CenterLineReplacer'. Achieved the desired results using classic mode parameter.

                  Edited by: navaneet on Oct 17, 2012 9:41 AM