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

Function sdeShapeCopy

mapsde.c:451–575  ·  view source on GitHub ↗

-------------------------------------------------------------------- */ sdeShapeCopy */ -------------------------------------------------------------------- */ Copies a SDE shape into a MapServer shapeObj */ -------------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

449/* Copies a SDE shape into a MapServer shapeObj */
450/* -------------------------------------------------------------------- */
451static int sdeShapeCopy(SE_SHAPE inshp, shapeObj *outshp) {
452
453 SE_POINT *points=NULL;
454 SE_ENVELOPE envelope;
455 long type, status;
456 long *part_offsets = NULL;
457 long *subpart_offsets = NULL;
458 long num_parts = -1;
459 long num_subparts = -1;
460 long num_points = -1;
461
462 lineObj line={0,NULL};
463
464 int i,j,k;
465
466 status = SE_shape_get_type(inshp, &type);
467 if(status != SE_SUCCESS) {
468 sde_error(status,
469 "sdeCopyShape()",
470 "SE_shape_get_type()");
471 return(MS_FAILURE);
472 }
473
474 switch(type) {
475 case(SG_NIL_SHAPE):
476 return(MS_SUCCESS); /* skip null shapes */
477 break;
478 case(SG_POINT_SHAPE):
479 case(SG_MULTI_POINT_SHAPE):
480 outshp->type = MS_SHAPE_POINT;
481 break;
482 case(SG_LINE_SHAPE):
483 case(SG_SIMPLE_LINE_SHAPE):
484 case(SG_MULTI_LINE_SHAPE):
485 case(SG_MULTI_SIMPLE_LINE_SHAPE):
486 outshp->type = MS_SHAPE_LINE;
487 break;
488 case(SG_AREA_SHAPE):
489 case(SG_MULTI_AREA_SHAPE):
490 outshp->type = MS_SHAPE_POLYGON;
491 break;
492 default:
493 msSetError( MS_SDEERR,
494 "Unsupported SDE shape type (%ld).",
495 "sdeCopyShape()",
496 type);
497 return(MS_FAILURE);
498 }
499
500
501 status = SE_shape_get_num_parts (inshp, &num_parts, &num_subparts);
502 if(status != SE_SUCCESS) {
503 sde_error(status, "sdeShapeCopy()", "SE_shape_get_num_parts()");
504 return(MS_FAILURE);
505 }
506 status = SE_shape_get_num_points (inshp, 0, 0, &num_points);
507 if(status != SE_SUCCESS) {
508 sde_error(status, "sdeShapeCopy()", "SE_shape_get_num_points()");

Callers 1

sdeGetRecordFunction · 0.85

Calls 5

sde_errorFunction · 0.85
msSetErrorFunction · 0.85
msSmallMallocFunction · 0.85
msAddLineFunction · 0.85
msFreeFunction · 0.85

Tested by

no test coverage detected