| 347 | } |
| 348 | |
| 349 | static shapeObj *msGEOSGeometry2Shape_line(GEOSGeom g) |
| 350 | { |
| 351 | shapeObj *shape=NULL; |
| 352 | |
| 353 | int i; |
| 354 | int numPoints; |
| 355 | GEOSCoordSeq coords; |
| 356 | |
| 357 | if(!g) return NULL; |
| 358 | numPoints = GEOSGetNumCoordinates(g); |
| 359 | coords = (GEOSCoordSeq) GEOSGeom_getCoordSeq(g); |
| 360 | |
| 361 | shape = (shapeObj *) malloc(sizeof(shapeObj)); |
| 362 | msInitShape(shape); |
| 363 | |
| 364 | shape->type = MS_SHAPE_LINE; |
| 365 | shape->line = (lineObj *) malloc(sizeof(lineObj)); |
| 366 | shape->numlines = 1; |
| 367 | shape->line[0].point = (pointObj *) malloc(sizeof(pointObj)*numPoints); |
| 368 | shape->line[0].numpoints = numPoints; |
| 369 | shape->geometry = (GEOSGeom) g; |
| 370 | |
| 371 | for(i=0; i<numPoints; i++) { |
| 372 | GEOSCoordSeq_getX(coords, i, &(shape->line[0].point[i].x)); |
| 373 | GEOSCoordSeq_getY(coords, i, &(shape->line[0].point[i].y)); |
| 374 | /* GEOSCoordSeq_getZ(coords, i, &(shape->line[0].point[i].z)); */ |
| 375 | } |
| 376 | |
| 377 | msComputeBounds(shape); |
| 378 | |
| 379 | return shape; |
| 380 | } |
| 381 | |
| 382 | static shapeObj *msGEOSGeometry2Shape_multiline(GEOSGeom g) |
| 383 | { |
no test coverage detected