Select to view content in your preferred language

Buffer Measure Actions

662
1
01-25-2011 06:29 AM
WilliamKimrey
Emerging Contributor
Hello all,

Got a strange problem here.  I'm trying to implement a buffer tool that buffers all current graphics in a GraphicsLayer.  Normally, this works fine as most of the graphics are simple points, lines, or polygons.  However, there is an option to buffer the results of a Measure Action.  Here is where things get strange.

Buffering the polygon result of a MeasureArea is fine, but when I try to buffer a polyline result from a MeasureDisatance, I get an odd result.  The line itself does not get buffered, but the points that are placed in the middle and end of a segment get buffered.  Also, the very end of the polyline has 2 buffers on top of each other.

I know that the polyline graphic is a collection of graphics all working together to perform the measure action, but so is the polygon measure action and it has no trouble buffering.  Why then doesn't the polyline buffer correctly?
0 Kudos
1 Reply
WilliamKimrey
Emerging Contributor
I've delved a bit more into the issue and have discovered several things.

1) When you have multiple types of geometries in the BufferParameters, the Geometry Service will only buffer the first type of geometry it sees.

2) MeasureActions such as polygons and polylines automatically generate the graphic for the next segment when you finish drawing.  So, a 3 segment polyline will have 4 polyline graphics in it, but the last one will have no Height or Width in its Extent (effectively making it a point).

So, it seems that what I have to do now is to figure out what each collection of graphics is after I finish drawing it and then buffer it separately from the other graphics.

I'm not really sure how to accomplish this, especially since I need to be able to buffer multiple graphics at once that are not neccessarily the same geometry types.

So yeah, has anybody else come across this limitation of the buffer functionality of the Geometry Service?
0 Kudos