msCopyShape partially implemented???

Tamas Szekeres szekerest at GMAIL.COM
Sat Jun 24 16:48:27 EDT 2006


The current CVS-HEAD contains the following implementation for msCopyShape:

int msCopyShape(shapeObj *from, shapeObj *to) {
  int i;

  if(!from || !to) return(-1);

  for(i=0; i<from->numlines; i++)
    msAddLine(to, &(from->line[i])); /* copy each line */

  to->type = from->type;

  to->bounds.minx = from->bounds.minx;
  to->bounds.miny = from->bounds.miny;
  to->bounds.maxx = from->bounds.maxx;
  to->bounds.maxy = from->bounds.maxy;

  if(from->text) to->text = strdup(from->text);

  to->classindex = from->classindex;
  to->index = from->index;
  to->tileindex = from->tileindex;

  if(from->values) {
    to->values = (char **)malloc(sizeof(char *)*from->numvalues);
    for(i=0; i<from->numvalues; i++)
      to->values[i] = strdup(from->values[i]);
    to->numvalues = from->numvalues;

  /* TODO add GEOS copy, or at least initialize to->geometry to NULL */


Without copying GEOS geometry will we run into unexpected problems?


More information about the mapserver-dev mailing list