msCopyShape partially implemented???

Steve Lime Steve.Lime at DNR.STATE.MN.US
Mon Jun 26 15:10:50 EDT 2006


I should be committing the C-API version of the GEOS support tonight and will
take care of this at that point. I think I'd opt for just setting the geometry to 
NULL since it will be built automatically if needed...

Steve

>>> Tamas Szekeres <szekerest at GMAIL.COM> 6/24/2006 3:48:27 PM >>>
Developers,

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 */

  return(0);
}

Without copying GEOS geometry will we run into unexpected problems?

Tamas



More information about the mapserver-dev mailing list