Fixes are available
DB2 Version 9.1 Fix Pack 7 for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 6 for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 6a for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 7a for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 8 for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 9 for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 10 for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 11 for Linux, UNIX and Windows
DB2 Version 9.1 Fix Pack 12 for Linux, UNIX and Windows
APAR status
Closed as program error.
Error description
This is regards to DB2 spatial extender on LUW - version 8.2 and/or 9.1. The use of ST_Difference with this data is basically a square donut and is giving the wrong result. The first polygon is the donut itself and the 2nd polygon is the 'hole' of the donut. ST_Difference appears to miss removing a void in the middle of a polygon, when covered by the second polygon. 'polygon ((1 1, 1 3, 3 3, 3 1, 1 1), (1.5 1.5, 1.5 2.5, 2.5 2.5, 2.5 1.5, 1.5 1.5))' 'polygon ((1.5 1.5, 1.5 2.5, 2.5 2.5, 2.5 1.5, 1.5 1.5))' Should return first polygon again 'polygon ((1 1, 1 3, 3 3, 3 1, 1 1), (1.5 1.5, 1.5 2.5, 2.5 2.5, 2.5 1.5, 1.5 1.5))' Returns only the outer polygon 'polygon ((1 1, 1 3, 3 3, 3 1, 1 1))? ST_Difference takes two geometries of the same dimension as input and returns that portion of the first geometry that is not intersected by the second geometry. With the case above one should return the geometry with the hole in it.
Local fix
Problem summary
Users affected: All Spatial Extender Problem description: The ST_Difference spatial function returns an incorrect geometry in some cases. ST_Difference takes two geometries of the same dimension as input and returns that portion of the first geometry that is not intersected by the second geometry. This is an example of the failing case with a "square" donut: The first polygon is the donut itself and the 2nd polygon is the 'hole' of the donut. ST_Difference misses removing a void in the middle of a polygon, when covered by the second polygon. 'polygon ((1 1, 1 3, 3 3, 3 1, 1 1), (1.5 1.5, 1.5 2.5, 2.5 2.5, 2.5 1.5, 1.5 1.5))' 'polygon ((1.5 1.5, 1.5 2.5, 2.5 2.5, 2.5 1.5, 1.5 1.5))' Should return first polygon again 'polygon ((1 1, 1 3, 3 3, 3 1, 1 1), (1.5 1.5, 1.5 2.5, 2.5 2.5, 2.5 1.5, 1.5 1.5))' Returns only the outer polygon 'polygon ((1 1, 1 3, 3 3, 3 1, 1 1))
Problem conclusion
Recommendation: upgrade to DB2 V9.1 FP6 or V9.5 FP2.
Temporary fix
Comments
APAR Information
APAR number
JR29300
Reported component name
SPATIAL EXT LIN
Reported component ID
5648D6103
Reported release
910
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2008-05-16
Closed date
2009-10-12
Last modified date
2009-10-12
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
SPATIAL EXT LIN
Fixed component ID
5648D6103
Applicable component levels
R910 PSY
UP
R950 PSY
UP
R970 PSY
UP
Document Information
Modified date:
12 October 2021