MCPcopy Index your code
hub / github.com/MapServer/MapServer / msGEOSGeometry2Shape_point

Function msGEOSGeometry2Shape_point

mapgeos.c:284–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284static 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
313static shapeObj *msGEOSGeometry2Shape_multipoint(GEOSGeom g)
314{

Callers 1

msGEOSGeometry2ShapeFunction · 0.85

Calls 1

msInitShapeFunction · 0.85

Tested by

no test coverage detected