2 Replies Latest reply on Apr 3, 2012 4:02 PM by Paul Dziemiela

    SDO_BUFFER does some very odd things

    Paul Dziemiela
      Hi folks,

      I was writing some front-end tests for a service that accepts geometry inputs. Sometimes we have folks submitting Web Mercator geometries mislabeling them as geodetic. Now Oracle Spatial validation does not seem to care if geodetic data is actually on the earth but simple enough to test if an input is outside the -180/-90 bounds. However I have a service that accepts a point and then buffers it and I thought I'd just look at the buffer to check that its on the earth. So this came to light.

      Given a quite reasonable Web Mercator point, we can mislabel it as NAD83 but it still validates nicely.
         SDO_GEOMETRY(2001,8265,SDO_POINT_TYPE(-9778922.562372, 5219660.84450598,NULL),NULL,NULL),
      ) FROM dual;
      However, if I take this "offworld alien" point and buffer it by 10KM, I get a nice geodetic polygon in the South China Sea!
         SDO_GEOMETRY(2001,8265,SDO_POINT_TYPE(-9778922.562372, 5219660.84450598,NULL),NULL,NULL),
      ) FROM dual
      Can anyone take a stab at that? I thought perhaps I had stumbled upon Dr. Ravada and his team's volcano island hideout but the polygon moves about as you change the inputs. Anyhow its a weird one and I will be moving my tests up in front of the buffer step.


        • 1. Re: SDO_BUFFER does some very odd things
          matt schell
          Hi Paul,

          Are we supposed to be taking a stab at locating the island hideout or figuring out what's going on with the buffer?

          On the latter, I think the geodetic coordinate systems just keep wrapping the earth around and around again as you go past +/- 180/90. I'd translate your longitude, for example, as

          1. Go to -180, the dateline
          2. Then go around X number of 360s
          3. Then stop -62 degrees west of the dateline


          select MOD(-9778922.562372,360) + 360 from dual


          select MOD(5219660, 360) from dual
          --> 20

          There he is: http://www.wholesalehalloweencostumes.com/ELX9200-adult-wheres-waldo-kit.html

          • 2. Re: SDO_BUFFER does some very odd things
            Paul Dziemiela

            Solves it for me though perhaps here is a better illustration

            Thanks Matt!