English

Error: The longitude value <long_value> is invalid and must be within the interval [<long_min>, <long_max>] at function st_transform()

Error Message

This error occurs when performing one of the following spatial operations between datasets originating from SAP HANA 2 SPS3 when the datasets are in different spatial references and one of the datasets is in SAP HANA’s WGS 84 planar spatial reference (HANA SRS_ID=1000004326):

  • Spatial Aggregation
  • Spatial filter
  • Find Nearest
  • Create a join on a spatial field

Cause

SAP HANA 2 SPS3 includes an incorrect SRS definition for it’s WGS 84 planar spatial reference (SRS 1000004326). See SAP HANA issue 210783 for more information.

Solution or Workaround

A DBA needs to fix the faulty WGS 84 planar spatial reference by following this SAP-provided procedure:

  1. Drop all tables with spatial columns stored using SRID 10004326.
  2. Drop current spatial reference system for SRS_ID=1000004326:
DROP SPATIAL REFERENCE SYSTEM "WGS 84 (planar)";
  1. Create a spatial reference system for SRS_ID=1000004326 using the following valid definition:
CREATE SPATIAL REFERENCE SYSTEM "WGS 84 (planar)" 
IDENTIFIED BY 1000004326 
DEFINITION 'GEOGCS["WGS 84" DATUM["WGS_1984" SPHEROID["WGS 84" 6378137 298.2572236 AUTHORITY["EPSG" 7030]] AUTHORITY["EPSG" 6326]] PRIMEM["Greenwich" 0 AUTHORITY["EPSG" 8901]] UNIT["degree" 0.017453293 AUTHORITY["EPSG" 9122]] AUTHORITY["EPSG" 4326]]' 
ORGANIZATION "EPSG" IDENTIFIED BY 4326 
TRANSFORM DEFINITION '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' LINEAR UNIT OF MEASURE "planar degree"
ANGULAR UNIT OF MEASURE "degree" TYPE PLANAR COORDINATE LONGITUDE BETWEEN -180 AND 180 COORDINATE LATITUDE BETWEEN -90 AND 90 TOLERANCE DEFAULT SNAP TO GRID DEFAULT POLYGON FORMAT 'EvenOdd' STORAGE FORMAT 'Internal';
  1. Re-create the spatial tables that were dropped at Step 1.