1

In SQL Server 2012 I can do this:

-- Construct a new FullGlobe object (a WGS84 ellipsoid)
DECLARE @Earth geography = 'FULLGLOBE'

-- Calculate the area of the earth
SELECT PlanetArea = @Earth.STArea()

Is there a similar construct in Oracle Spatial?

Alternatively what would be the best way to represent the entire earth in an 8307/4326 SRID?

Is there anything in the WKT standard that speaks to this?

1

If you are querying data, you could use an optimized rectangle. But, the Oracle Spatial documentation advises against using these geometries from anything other then query windows.

sdo_geometry(2003, 8307, null, 
    sdo_elem_info_array(1,1003,3), 
    sdo_ordinate_array(-180,-90,180,90))

If need to store the geometry, I would use a multipart polygon that splits the world into three or more parts. In Oracle spatial, you can't create a geometry that is equal to or greater than half the world's surface. You could use four squares:

sdo_geometry(2003, 8307, null, 
    sdo_elem_info_array(1,1003,1,11,1003,1,21,1003,1,31,1003,1), 
    sdo_ordinate_array( -180,-90,0,-90,0,0,-180,0,-180,-90,
                        -180,0,0,0,0,90,-180,90,-180,0,
                        0,-90,180,-90,180,0,0,0,0,-90,
                        0,0,180,0,180,90,0,90,0,0))

Or triangles with a geographic coordinate system (because Oracle Spatial considers the curvature):

sdo_geometry(2003, 8307, null, 
    sdo_elem_info_array(1,1003,1,9,1003,1,17,1003,1,25,1003,1), 
    sdo_ordinate_array( -180,-90,0,0,-180,0,-180,-90,
                        -180,0,0,0,0,90,-180,0,
                        0,-90,180,0,0,0,0,-90,
                        0,0,180,0,180,90,0,0)),0.05)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.