| 541 | } |
| 542 | |
| 543 | shapeObj *msGEOSGeometry2Shape(GEOSGeom g) |
| 544 | { |
| 545 | int type; |
| 546 | |
| 547 | if(!g) |
| 548 | return NULL; /* a NULL geometry generates a NULL shape */ |
| 549 | |
| 550 | type = GEOSGeomTypeId(g); |
| 551 | switch(type) { |
| 552 | case GEOS_POINT: |
| 553 | return msGEOSGeometry2Shape_point(g); |
| 554 | break; |
| 555 | case GEOS_MULTIPOINT: |
| 556 | return msGEOSGeometry2Shape_multipoint(g); |
| 557 | break; |
| 558 | case GEOS_LINESTRING: |
| 559 | return msGEOSGeometry2Shape_line(g); |
| 560 | break; |
| 561 | case GEOS_MULTILINESTRING: |
| 562 | return msGEOSGeometry2Shape_multiline(g); |
| 563 | break; |
| 564 | case GEOS_POLYGON: |
| 565 | return msGEOSGeometry2Shape_polygon(g); |
| 566 | break; |
| 567 | case GEOS_MULTIPOLYGON: |
| 568 | return msGEOSGeometry2Shape_multipolygon(g); |
| 569 | break; |
| 570 | default: |
| 571 | if (!GEOSisEmpty(g)) |
| 572 | msSetError(MS_GEOSERR, "Unsupported GEOS geometry type (%d).", "msGEOSGeometry2Shape()", type); |
| 573 | return NULL; |
| 574 | } |
| 575 | } |
| 576 | #endif |
| 577 | |
| 578 | /* |
no test coverage detected