/ msProjectShape() */ /
| 466 | /* msProjectShape() */ |
| 467 | /************************************************************************/ |
| 468 | int msProjectShape(projectionObj *in, projectionObj *out, shapeObj *shape) |
| 469 | { |
| 470 | #ifdef USE_PROJ |
| 471 | int i; |
| 472 | |
| 473 | for( i = shape->numlines-1; i >= 0; i-- ) |
| 474 | { |
| 475 | if( shape->type == MS_SHAPE_LINE || shape->type == MS_SHAPE_POLYGON ) |
| 476 | { |
| 477 | if( msProjectShapeLine( in, out, shape, i ) == MS_FAILURE ) |
| 478 | msShapeDeleteLine( shape, i ); |
| 479 | } |
| 480 | else if( msProjectLine(in, out, shape->line+i ) == MS_FAILURE ) |
| 481 | { |
| 482 | msShapeDeleteLine( shape, i ); |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | if( shape->numlines == 0 ) { |
| 487 | msFreeShape( shape ); |
| 488 | return MS_FAILURE; |
| 489 | } else { |
| 490 | msComputeBounds( shape ); /* fixes bug 1586 */ |
| 491 | return(MS_SUCCESS); |
| 492 | } |
| 493 | #else |
| 494 | msSetError(MS_PROJERR, "Projection support is not available.", "msProjectShape()"); |
| 495 | return(MS_FAILURE); |
| 496 | #endif |
| 497 | } |
| 498 | |
| 499 | /************************************************************************/ |
| 500 | /* msProjectLine() */ |
no test coverage detected