MultiPartShapeBuffer -- Multiple Polylines?

3296
1
03-24-2014 04:01 AM
EvanLortie
New Contributor
I am trying to construct a MultiPartShapeBuffer with multiple polyline segments because I need to handle polylines that cross the 180/-180 boundary.  I see that the MultiPartShapeBuffer has the setup configuration to support multiple parts but there does not appear to be a way to specify the index or which part you are applying a set of points against?

//init buffer geom for row insertion
Multipartshapebuffer tempGeom = new multipartshapebuffer();
tempGeom.setup(ShapeType.Polyline, 2, totalPoints);

list<Point> beforeBreak = new List<Point>();
list<Point> afterBreak = new List<Point>();

//build lists
for{...build point arrays}

//setpoints
tempRowGeom.Parts = new int[2] {1,2};
tempGeom.Points = beforeBreak.ToArray();

...here is where it runs into problems, the only way to apply a point array to a Geometry is through the property assignment, there is not method to specify multiple or add points to a unique segment.  It either adds the points to the existing points list (which causes the same problem as only having a single point list) or overwrites the previous list.

Any ideas other than creating a separate row in the gdb for each segment?

Thanks
E
0 Kudos
1 Reply
VinceAngelo
Esri Esteemed Contributor
The shapefile format (on which this transfer buffer is based) just has an
array of part offsets and an array of points.  The parts offsets specify where
to break the shape (starting with zero, unfortunately).  So, for a two part
shape, you only need one point array (with all the points) and a correct
parts buffer, with offsets of 0 and {number_of_points_in_part1}.

It is not ever legal to specify an offset of 1, or to use consecutive values
in the parts array, since lines must have at least two vertices, and polygons
must have at least four.

- V
0 Kudos