                                 text_var2 = PG_EXCEPTION_DETAIL,
                                 text_var3 = PG_EXCEPTION_HINT;
         raise WARNING 'ST_DistanceToNorthPole: exception occured: Msg: %, detail: %, hint: %', text_var1, text_var1, text_var3;
-        RETURN TRUE;
+        RETURN 1000000001;
 
 END
 $$ LANGUAGE 'plpgsql' IMMUTABLE;

                                text_var2 = PG_EXCEPTION_DETAIL,
                                text_var3 = PG_EXCEPTION_HINT;
        raise WARNING 'ST_DistanceToSouthPole: exception occured: Msg: %, detail: %, hint: %', text_var1, text_var1, text_var3;
        RETURN TRUE;

END
$$ LANGUAGE 'plpgsql' IMMUTABLE;

        FOR part IN SELECT (ST_Dump(geom_in)).geom LOOP

            -- AntiMeridian is crossed for sure
            IF ST_IsPolygonCW(part.geom) AND abs(ST_XMax(part.geom) - ST_XMin(part.geom)) > 360 THEN
                --RAISE NOTICE 'Polygon is CW and abs > 360';
                RETURN TRUE;
            -- AntiMeridian is perhaps crossed
            ELSIF ST_Intersects(part.geom::geography, blade) THEN
