| 1551 | |
| 1552 | |
| 1553 | static int osGetOrdinates(msOracleSpatialDataHandler *dthand, msOracleSpatialHandler *hand, shapeObj *shape, SDOGeometryObj *obj, SDOGeometryInd *ind) |
| 1554 | { |
| 1555 | int gtype, elem_type, compound_type; |
| 1556 | float compound_lenght, compound_count; |
| 1557 | ub4 etype; |
| 1558 | ub4 interpretation; |
| 1559 | int nelems, nords, data3d, data4d; |
| 1560 | int elem, ord_start, ord_end; |
| 1561 | boolean exists; |
| 1562 | OCINumber *oci_number; |
| 1563 | double x, y; |
| 1564 | #ifdef USE_POINT_Z_M |
| 1565 | double z; |
| 1566 | #endif /* USE_POINT_Z_M */ |
| 1567 | int success; |
| 1568 | lineObj points = {0, NULL}; |
| 1569 | pointObj point5[5]; /* for quick access */ |
| 1570 | shapeObj newshape; /* for compound polygons */ |
| 1571 | |
| 1572 | /*stat the variables for compound polygons*/ |
| 1573 | compound_lenght = 0; |
| 1574 | compound_type = 0; |
| 1575 | compound_count = -1; |
| 1576 | data3d = 0; |
| 1577 | data4d = 0; |
| 1578 | |
| 1579 | if (ind->_atomic != OCI_IND_NULL) /* not a null object */ |
| 1580 | { |
| 1581 | nelems = nords = 0; |
| 1582 | success = TRY( hand, OCICollSize( hand->envhp, hand->errhp, (OCIColl *)obj->elem_info, &nelems ) ) |
| 1583 | && TRY( hand, OCICollSize( hand->envhp, hand->errhp, (OCIColl *)obj->ordinates, &nords ) ) |
| 1584 | && TRY( hand, OCINumberToInt( hand->errhp, &(obj->gtype), (uword)sizeof(int), OCI_NUMBER_SIGNED, (dvoid *)>ype ) ); |
| 1585 | /*&& (nords%2==0 && nelems%3==0);*/ /* check %2==0 for 2D geometries; and %3==0 for element info triplets */ |
| 1586 | |
| 1587 | if (success && osCheck2DGtype(gtype)) |
| 1588 | { |
| 1589 | success = (nords%2==0 && nelems%3==0)?1:0; /* check %2==0 for 2D geometries; and %3==0 for element info triplets */ |
| 1590 | } |
| 1591 | else if (success && osCheck3DGtype(gtype)) |
| 1592 | { |
| 1593 | success = (nords%3==0 && nelems%3==0)?1:0; /* check %2==0 for 2D geometries; and %3==0 for element info triplets */ |
| 1594 | data3d = 1; |
| 1595 | |
| 1596 | } |
| 1597 | else if (success && osCheck4DGtype(gtype)) |
| 1598 | { |
| 1599 | success = (nords%4==0 && nelems%3==0)?1:0; /* check %2==0 for 2D geometries; and %3==0 for element info triplets */ |
| 1600 | data4d = 1; |
| 1601 | } |
| 1602 | |
| 1603 | |
| 1604 | if (success) |
| 1605 | { |
| 1606 | /* reading SDO_POINT from SDO_GEOMETRY for a 2D/3D point geometry */ |
| 1607 | if ((gtype==2001 || gtype==3001 || gtype==4001 ) && ind->point._atomic == OCI_IND_NOTNULL && ind->point.x == OCI_IND_NOTNULL && ind->point.y == OCI_IND_NOTNULL) |
| 1608 | { |
| 1609 | |
| 1610 |
no test coverage detected