WL#9449: Restrict range of geographic coordinates in import functions

Affects: Server-8.0   —   Status: Complete

Geographic coordinates are longitudes and latitudes, which have known bounds. This WL restricts input to a valid range.

In all geometry import functions, raise an error if a geographic SRS is used and the coordinates are outside the legal range of (-180, 180] for longitude and [-90,90] for latitude.

This applies to functions:

  • ST_GEOMCOLLFROMTEXT
  • ST_GEOMCOLLFROMTXT
  • ST_GEOMCOLLFROMWKB
  • ST_GEOMETRYCOLLECTIONFROMTEXT
  • ST_GEOMETRYCOLLECTIONFROMWKB
  • ST_GEOMETRYFROMTEXT
  • ST_GEOMETRYFROMWKB
  • ST_GEOMFROMTEXT
  • ST_GEOMFROMWKB
  • ST_LINEFROMTEXT
  • ST_LINEFROMWKB
  • ST_LINESTRINGFROMTEXT
  • ST_LINESTRINGFROMWKB
  • ST_MLINEFROMTEXT
  • ST_MLINEFROMWKB
  • ST_MPOINTFROMTEXT
  • ST_MPOINTFROMWKB
  • ST_MPOLYFROMTEXT
  • ST_MPOLYFROMWKB
  • ST_MULTILINESTRINGFROMTEXT
  • ST_MULTILINESTRINGFROMWKB
  • ST_MULTIPOINTFROMTEXT
  • ST_MULTIPOINTFROMWKB
  • ST_MULTIPOLYGONFROMTEXT
  • ST_MULTIPOLYGONFROMWKB
  • ST_POINTFROMTEXT
  • ST_POINTFROMWKB
  • ST_POLYFROMTEXT
  • ST_POLYFROMWKB
  • ST_POLYGONFROMTEXT
  • ST_POLYGONFROMWKB

There are a few import functions that are not affected by this WL:

  • ST_GEOMFROMGEOJSON (restriction is already implemented)
  • ST_LATFROMGEOHASH (can't represent out-of-range values)
  • ST_LONGFROMGEOHASH (can't represent out-of-range values)
  • ST_POINTFROMGEOHASH (can't represent out-of-range values)
F-1
If any parameter 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 functions MUST raise ER_LONGITUDE_OUT_OF_RANGE.(*)
F-2
If any parameter 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 functions MUST raise ER_LATITUDE_OUT_OF_RANGE.(*)

(*) 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: The geometry import functions will raise an error if one or more coordinate values are out of range.
I-6
No new errors or warnings.