I am trying to draw radar data on top of a map using CoreGraphics. Before, I was trying to draw each data point individually by making a path around each individual data point and then filling the appropriate color. So for this method I had to have 4 location points and a data value for each data point. Doing it this way turned out to be way too costly, as there are between 30,000 and 80,000 data points for each image.
The radar data is stored in a radial format (360 radials, each containing 230 data points). So instead of looping through every data point, I only loop through the radials. And instead of a path around each data point, I have a path around each radial. I then create and draw a linear gradient (CGGradientCreateWithColors) using the array of colors for that particular gradient.
This method is drawing a lot faster than before, but it is still not fast enough. Another issue with it is the "smoothness" of the data when I zoom in. The gradient blends between every data point in the radial so you cannot see the individual pixels. I do not want it to do this. I think this is where my biggest performance hit is coming from (computing the gradient between each data point). I would rather each data point be drawn as a discrete color. This would look better and it should perform better.
Is there a way to provide an array of colors to a path (similar to what I did with the gradient) that will draw them discretely. I need to be able to draw this without having to go back to drawing the individual data points.
Thank you in advance, Ross
EDIT
The first picture is the original way I was doing the drawing (by drawing each data point individually). This is how I want it to look in the end.
The second picture is the gradient, which is more efficient than before (not efficient enough though), but does not look right.