| 884 | } |
| 885 | |
| 886 | static int msOCIGet4DOrdinates( msOracleSpatialHandler *hand, SDOGeometryObj *obj, int s, int e, pointObj *pt ) |
| 887 | { |
| 888 | double x, y; |
| 889 | int i, n, success = 1; |
| 890 | boolean exists; |
| 891 | #ifdef USE_POINT_Z_M |
| 892 | double z; |
| 893 | boolean numnull; |
| 894 | #endif /* USE_POINT_Z_M */ |
| 895 | OCINumber *oci_number; |
| 896 | |
| 897 | for( i=s, n=0; i < e && success; i+=4, n++ ) |
| 898 | { |
| 899 | success = TRY( hand, |
| 900 | OCICollGetElem( hand->envhp, hand->errhp, (OCIColl *)obj->ordinates, (sb4)i, (boolean *)&exists, (dvoid *)&oci_number, (dvoid **)0 ) ) |
| 901 | && TRY( hand, |
| 902 | OCINumberToReal( hand->errhp, oci_number, (uword)sizeof(double), (dvoid *)&x ) ) |
| 903 | && TRY( hand, |
| 904 | OCICollGetElem( hand->envhp, hand->errhp, (OCIColl *)obj->ordinates, (sb4)i+1, (boolean *)&exists, (dvoid *)&oci_number, (dvoid **)0 ) ) |
| 905 | && TRY( hand, |
| 906 | OCINumberToReal( hand->errhp, oci_number, (uword)sizeof(double), (dvoid *)&y ) ) |
| 907 | #ifdef USE_POINT_Z_M |
| 908 | && TRY( hand, |
| 909 | OCICollGetElem( hand->envhp, hand->errhp, (OCIColl *)obj->ordinates, (sb4)i+2, (boolean *)&exists, (dvoid *)&oci_number, (dvoid **)0 ) ) |
| 910 | |
| 911 | #endif /* USE_POINT_Z_M */ |
| 912 | ; |
| 913 | #ifdef USE_POINT_Z_M |
| 914 | if (success) |
| 915 | { |
| 916 | success = TRY(hand, OCINumberIsZero( hand->errhp, oci_number, (boolean *)&numnull)); |
| 917 | if (success) |
| 918 | { |
| 919 | success = TRY( hand, OCINumberToReal( hand->errhp, oci_number, (uword)sizeof(double), (dvoid *)&z ) ); |
| 920 | } |
| 921 | else |
| 922 | { |
| 923 | hand->last_oci_status = MS_SUCCESS; |
| 924 | strlcpy( (char *)hand->last_oci_error, "Retrieve z value, but NULL value for z. Setting z to 0.", sizeof(hand->last_oci_error)); |
| 925 | z = 0; |
| 926 | success = 1; |
| 927 | } |
| 928 | } |
| 929 | #endif /* USE_POINT_Z_M */ |
| 930 | if (success) |
| 931 | { |
| 932 | pt[n].x = x; |
| 933 | pt[n].y = y; |
| 934 | #ifdef USE_POINT_Z_M |
| 935 | pt[n].z = z; |
| 936 | |
| 937 | #endif /* USE_POINT_Z_M */ |
| 938 | } |
| 939 | } return success ? n : 0; |
| 940 | } |
| 941 | |
| 942 | /* convert three-point circle to two-point rectangular bounds */ |
| 943 | static int msOCIConvertCircle( pointObj *pt ) |
no test coverage detected