IBM Support

JR29300: ST_DIFFERENCE APPEARS TO MISS REMOVING A VOID IN THE MIDDLE OF A POLYGON, WHEN COVERED BY THE SECOND POLYGON.

Subscribe

You can track all active APARs for this component.

 

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:

    JR29299

  • 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

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSDP5R","label":"InfoSphere Replication Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"910","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
12 October 2021