Original User: vangeloIn order to get help with your code, you need to post it (not just the function which calls that code). The code you did post has questionable use of array allocation (with no obvious need for arrays and undefined MAX_* macros). All the code that contains "long" is incorrect -- ArcSDE uses the"LONG" macro to hide the implementation of "long" on 32-bit platforms and "int" on 64-bit, sousing "long" can cause alignment issues that randomize results. From a 'C' coding standpoint,you should *NEVER* cast the results of malloc (doing so should be unnecessary, and hidespossible warnings or errors which would be returned by the compiler). The function which would perform a Cartesian buffer on a shape should probably look like this(once they get the fixed-width CODE font straightened out): LONG my_buffer(SE_SHAPE shape, LFLOAT distance)
{
LONG nparts = 0;
LONG npoints = 0;
LONG nsubs = 0;
LONG sr;
SE_SHAPE temp = NULL;
sr = SE_shape_get_num_parts(shape,&nparts,&nsubs);
if (sr != SE_SUCCESS) return sr;
sr = SE_shape_get_num_points(shape,SE_ALL,SE_ALL,&npoints);
if (sr != SE_SUCCESS) return sr;
sr = SE_shape_create(NULL,&temp);
if (sr != SE_SUCCESS) return sr;
sr = SE_shape_duplicate(shape,temp);
if (sr != SE_SUCCESS) goto bailout;
npoints += (360 * nsubs) + 500;
sr = SE_shape_generate_buffer(temp,distance,npoints,shape);
bailout:
SE_shape_free(temp);
return sr;
}
But you need quite a bit of validation code to make sure the coordinate references in thesource and destination layers are identical. I strongly suggest you review the way you're using pointers and arrays, because the casting you're doing between SE_SHAPE and char * is not valid and your SE_shape_free invocation is likely to corrupt memory. - V