| 828 | } |
| 829 | |
| 830 | static int msOCIGet3DOrdinates( msOracleSpatialHandler *hand, SDOGeometryObj *obj, int s, int e, pointObj *pt ) |
| 831 | { |
| 832 | double x, y; |
| 833 | int i, n, success = 1; |
| 834 | boolean exists; |
| 835 | #ifdef USE_POINT_Z_M |
| 836 | double z; |
| 837 | boolean numnull; |
| 838 | #endif /* USE_POINT_Z_M */ |
| 839 | OCINumber *oci_number; |
| 840 | |
| 841 | for( i=s, n=0; i < e && success; i+=3, n++ ) |
| 842 | { |
| 843 | success = TRY( hand, |
| 844 | OCICollGetElem( hand->envhp, hand->errhp, (OCIColl *)obj->ordinates, (sb4)i, (boolean *)&exists, (dvoid *)&oci_number, (dvoid **)0 ) ) |
| 845 | && TRY( hand, |
| 846 | OCINumberToReal( hand->errhp, oci_number, (uword)sizeof(double), (dvoid *)&x ) ) |
| 847 | && TRY( hand, |
| 848 | OCICollGetElem( hand->envhp, hand->errhp, (OCIColl *)obj->ordinates, (sb4)i+1, (boolean *)&exists, (dvoid *)&oci_number, (dvoid **)0 ) ) |
| 849 | && TRY( hand, |
| 850 | OCINumberToReal( hand->errhp, oci_number, (uword)sizeof(double), (dvoid *)&y ) ) |
| 851 | #ifdef USE_POINT_Z_M |
| 852 | && TRY( hand, |
| 853 | OCICollGetElem( hand->envhp, hand->errhp, (OCIColl *)obj->ordinates, (sb4)i+2, (boolean *)&exists, (dvoid *)&oci_number, (dvoid **)0 ) ) |
| 854 | #endif /* USE_POINT_Z_M */ |
| 855 | ; |
| 856 | #ifdef USE_POINT_Z_M |
| 857 | if (success) |
| 858 | { |
| 859 | success = TRY(hand, OCINumberIsZero( hand->errhp, oci_number, (boolean *)&numnull)); |
| 860 | if (success) |
| 861 | { |
| 862 | success = TRY( hand, OCINumberToReal( hand->errhp, oci_number, (uword)sizeof(double), (dvoid *)&z ) ); |
| 863 | } |
| 864 | else |
| 865 | { |
| 866 | hand->last_oci_status = MS_SUCCESS; |
| 867 | strlcpy( (char *)hand->last_oci_error, "Retrieve z value, but NULL value for z. Setting z to 0.", sizeof(hand->last_oci_error)); |
| 868 | z = 0; |
| 869 | success = 1; |
| 870 | } |
| 871 | } |
| 872 | #endif /* USE_POINT_Z_M */ |
| 873 | if (success) |
| 874 | { |
| 875 | pt[n].x = x; |
| 876 | pt[n].y = y; |
| 877 | #ifdef USE_POINT_Z_M |
| 878 | pt[n].z = z; |
| 879 | #endif /* USE_POINT_Z_M */ |
| 880 | } |
| 881 | } |
| 882 | |
| 883 | return success ? n : 0; |
| 884 | } |
| 885 | |
| 886 | static int msOCIGet4DOrdinates( msOracleSpatialHandler *hand, SDOGeometryObj *obj, int s, int e, pointObj *pt ) |
| 887 | { |
no test coverage detected