WL#10927: Ellipsoidal ST_IsSimple
ST_IsSimple currently only supports computations in Cartesian spatial reference systems (SRSs). This WL extends ST_IsSimple to detect that its parameter is in a geographic (ellipsoidal) SRS and to compute on the ellipsoid.
Projected SRSs and SRID 0 will still return the same result as before. If the SRID refers to a geographic SRS, the result will be different.
The ST_IsSimple function will be implemented as described in SQL/MM Part 3 Spatial (ISO/IEC 13249-3:2015), Sect. 5.1.8.
- F-1
- ST_IsSimple MUST return NULL if its argument is NULL.
- F-2
- ST_IsSimple MUST NOT return NULL if its argument is not NULL.
- F-3
- If the argument is not a syntactically well-formed geometry, ST_IsSimple MUST raise ER_GIS_INVALID_DATA during function evaluation.
- F-4
- ST_IsSimple MUST return 1 if its argument is an empty geometry.
- F-5
- If the argument is geometrically simple, ST_IsSimple MUST return 1.
- F-6
- If the argument is not geometrically simple, ST_IsSimple MUST return 0.
- F-7
- If the 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), ST_IsSimple MUST raise ER_LONGITUDE_OUT_OF_RANGE.(*)
- F-8
- If the 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), ST_IsSimple MUST raise ER_LATITUDE_OUT_OF_RANGE.(*)
- NF-1
- The function MUST be non-nullable if the argument is non-nullable.
- NF-2
- The function MUST be nullable if the argument is nullable.
(*) 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_IsSimple will return a result based on geographical computations. Other computations will remain as they are today.
- I-6
- No new errors or warnings.
Modify Item_func_issimple and implement the desired behavior in function val_int(). Update function resolve_type() to set maybe_null only if the parameter is nullable.
Create a functor gis::Is_simple and a function gis::is_simple() in sql/gis/is_simple.{h,cc} after the model of gis::distance(), gis::within(), etc., that computes the result using Boost.Geometry.