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

Function msGEOSGeometry2Shape_line

mapgeos.c:349–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

347}
348
349static 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
382static shapeObj *msGEOSGeometry2Shape_multiline(GEOSGeom g)
383{

Callers 1

msGEOSGeometry2ShapeFunction · 0.85

Calls 2

msInitShapeFunction · 0.85
msComputeBoundsFunction · 0.85

Tested by

no test coverage detected