| 282 | } |
| 283 | |
| 284 | static shapeObj *msGEOSGeometry2Shape_point(GEOSGeom g) |
| 285 | { |
| 286 | GEOSCoordSeq coords; |
| 287 | shapeObj *shape=NULL; |
| 288 | |
| 289 | if(!g) return NULL; |
| 290 | |
| 291 | shape = (shapeObj *) malloc(sizeof(shapeObj)); |
| 292 | msInitShape(shape); |
| 293 | |
| 294 | shape->type = MS_SHAPE_POINT; |
| 295 | shape->line = (lineObj *) malloc(sizeof(lineObj)); |
| 296 | shape->numlines = 1; |
| 297 | shape->line[0].point = (pointObj *) malloc(sizeof(pointObj)); |
| 298 | shape->line[0].numpoints = 1; |
| 299 | shape->geometry = (GEOSGeom) g; |
| 300 | |
| 301 | coords = (GEOSCoordSeq) GEOSGeom_getCoordSeq(g); |
| 302 | |
| 303 | GEOSCoordSeq_getX(coords, 0, &(shape->line[0].point[0].x)); |
| 304 | GEOSCoordSeq_getY(coords, 0, &(shape->line[0].point[0].y)); |
| 305 | /* GEOSCoordSeq_getZ(coords, 0, &(shape->line[0].point[0].z)); */ |
| 306 | |
| 307 | shape->bounds.minx = shape->bounds.maxx = shape->line[0].point[0].x; |
| 308 | shape->bounds.miny = shape->bounds.maxy = shape->line[0].point[0].y; |
| 309 | |
| 310 | return shape; |
| 311 | } |
| 312 | |
| 313 | static shapeObj *msGEOSGeometry2Shape_multipoint(GEOSGeom g) |
| 314 | { |
no test coverage detected