# WL#14266: Ellipsoidal ST_Difference

Affects: Server-8.0
—
Status: Complete

ST_Difference currently only supports computations in Cartesian spatial reference systems (SRSs). This WL refactors the current implementation for Cartesian SRSs, and adds support for geograhic SRSs.

ST_Difference(geometry, geometry) takes two geometries, and returns the geometry that covers the difference between the first and the second geometry.

The function is implemented for all geometries in all spatial reference systems, both Cartesian and geographic.

- F-1
- The function MUST return NULL if any of its arguments are NULL.
- F-2
- If any of the geometry arguments are not a syntactically well-formed geometry, the function MUST raise ER_GIS_INVALID_DATA during function evaluation.
- F-3
- If any geometry argument is a syntactically well-formed geometry in an undefined SRS, the function MUST raise ER_SRS_NOT_FOUND during function evaluation.
- F-4
- If the geometry arguments are syntactically well-formed geometries but in different SRSs, the function MUST raise ER_GIS_DIFFERENT_SRIDS during function evaluation.
- F-5
- If any geometry argument is a geometry in a geographic SRS and a longitude value is not in the range (-180,180] (in degrees -- other limits in other units), the function MUST raise ER_GEOMETRY_PARAM_LONGITUDE_OUT_OF_RANGE. (*)
- F-6
- If any geometry argument is a geometry in a geographic SRS and a latitude value is not in the range [-90,90] (in degrees -- other limits in other units), the function MUST raise ER_GEOMETRY_PARAM_LATITUDE_OUT_OF_RANGE. (*)
- F-7
- If one or more geometry arguments are geometrically invalid, the function MUST return a geometry or raise an error. If a geometry is returned then there is no guarantee that this result is correct nor geometrically valid, i.e. it could be any geometry.
- F-8
- If the geometry arguments are syntactically well-formed within a valid SRS, the function MUST return the difference geometry of the two inputs, in the same SRS.

(*) The exact limits will deviate slightly because of floating point arithmetics.

I-1

No new files.

I-2

No new syntax.

I-3

No new commands.

I-4

No new tools.

I-5

The semantics of interface SQL01 are changed: If the geometry is in a geographic SRS, ST_Difference will return a result based on geographical computations. Other computations will remain as they are today.

I-6

No new errors or warnings.

Copyright (c) 2000, 2022, Oracle Corporation and/or its affiliates. All rights reserved.