FUNCTION  fRegionPredicate

Returns predicate testing if a point (cx,cy,cz) point is inside the region

Parameters:
  • regionID bigint Predicate will be computed for this regionID

    The predicate is of the form:
    ( ( ((1*cx+0*cy+0*cz)>=0.5) AND ((0*cx+1*cy+0*cz)>=0.5)
    AND ((0*cx+0*cy+1*cz)>=0.5) AND ((1*cx+1*cy+1*cz)>=0.5)
    )
    OR (((1*cx+0*cy+0*cz)>=0.6) AND ((0*cx+1*cy+0*cz)>=0.6)
    AND ((0*cx+0*cy+1*cz)>=0.6) AND ((1*cx+1*cy+1*cz)>=0.6)
    ) )
    returns the empty string if the predicate is too large (> 7.8kB).
    Sample call to update all region predicates

    update Region
    set sql = dbo.fRegionPredicate(regionID)
    where regionID != ''

  • Input and output parameters

    nametypelengthinoutpnum
    @regionIDbigint8input1
     varchar8000input0