/
| 384 | |
| 385 | /*****************************************************************************/ |
| 386 | int proj_trans_array (PJ *P, PJ_DIRECTION direction, size_t n, PJ_COORD *coord) { |
| 387 | /****************************************************************************** |
| 388 | Batch transform an array of PJ_COORD. |
| 389 | |
| 390 | Performs transformation on all points, even if errors occur on some points. |
| 391 | |
| 392 | Individual points that fail to transform will have their components set to |
| 393 | HUGE_VAL |
| 394 | |
| 395 | Returns 0 if all coordinates are transformed without error, otherwise |
| 396 | returns a precise error number if all coordinates that fail to transform |
| 397 | for the same reason, or a generic error code if they fail for different |
| 398 | reasons. |
| 399 | ******************************************************************************/ |
| 400 | size_t i; |
| 401 | int retErrno = 0; |
| 402 | bool hasSetRetErrno = false; |
| 403 | bool sameRetErrno = true; |
| 404 | |
| 405 | for (i = 0; i < n; i++) { |
| 406 | proj_context_errno_set(P->ctx, 0); |
| 407 | coord[i] = proj_trans (P, direction, coord[i]); |
| 408 | int thisErrno = proj_errno(P); |
| 409 | if( thisErrno != 0 ) |
| 410 | { |
| 411 | if( !hasSetRetErrno ) |
| 412 | { |
| 413 | retErrno = thisErrno; |
| 414 | hasSetRetErrno = true; |
| 415 | } |
| 416 | else if( sameRetErrno && retErrno != thisErrno ) |
| 417 | { |
| 418 | sameRetErrno = false; |
| 419 | retErrno = PROJ_ERR_COORD_TRANSFM; |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | |
| 424 | proj_context_errno_set(P->ctx, retErrno); |
| 425 | |
| 426 | return retErrno; |
| 427 | } |
| 428 | |
| 429 | |
| 430 |
nothing calls this directly
no test coverage detected