| 461 | | else |
|---|
| | 462 | else if( OGRGeometryFactory::haveGEOS() ) |
|---|
| | 463 | { |
|---|
| | 464 | OGRPolygon** tabPolygons = new OGRPolygon*[psShape->nParts]; |
|---|
| | 465 | for( iRing = 0; iRing < psShape->nParts; iRing++ ) |
|---|
| | 466 | { |
|---|
| | 467 | tabPolygons[iRing] = new OGRPolygon(); |
|---|
| | 468 | tabPolygons[iRing]->addRingDirectly(CreateLinearRing ( psShape, iRing )); |
|---|
| | 469 | } |
|---|
| | 470 | |
|---|
| | 471 | int isValidGeometry; |
|---|
| | 472 | poOGR = OGRGeometryFactory::organizePolygons( |
|---|
| | 473 | (OGRGeometry**)tabPolygons, psShape->nParts, &isValidGeometry ); |
|---|
| | 474 | |
|---|
| | 475 | if (!isValidGeometry) |
|---|
| | 476 | { |
|---|
| | 477 | CPLError(CE_Warning, CPLE_AppDefined, |
|---|
| | 478 | "Geometry of polygon of fid %d cannot be translated to Simple Geometry. " |
|---|
| | 479 | "All polygons will be contained in a multipolygon.\n", |
|---|
| | 480 | iShape); |
|---|
| | 481 | } |
|---|
| | 482 | |
|---|
| | 483 | delete[] tabPolygons; |
|---|
| | 484 | } |
|---|
| | 485 | else |
|---|