Dear ESRI developers,
We are developing a simple AddIn for arcMap for the first time using arcObjects in java. The application consists basically on the following steps:
- Obtain a Network layer which was loaded in arcMap
- Construct a graph using the network layer to run graph algorithms on it
- Construct and add a different layer which shows one line for each edge of the graph
- When a new calculation is required by the user run the graph algorithm.
- Refresh graphically the lines of the new layer according to the graph algorithm results
We are asking for your help because we have computation time problems with the step 5. There are more than 27000 lines or edges. To update the color of the lines representing edges we have tried the following strategies:
- Create a Feature layer with polylines, adding a new numerical field with values between 0-10. Assign a ClassBreaksRenderer to this layer. When the user requires a new calculation the numerical field must be updated (27000 updates) so the renderer will use a different color for the lines of the feature layer.
- Create a graphic layer with Line elements. Create a collection of Symbols (20 different colors from a ramp). When the user requires a new calculation a new symbol is assigned to the line Elements (27000 assignments) so they will be painted with new colors according to the calculation.
The process A takes almost 3 minutes and the process B takes almost 2 minutes. This is without using any type of parallelization.
Measuring the computation time for the method A the slow action is to update the rows of the FeatureClass (6 milliseconds per feature). I tried the update cursor and the search cursor with similar results.
Measuring the computation time for the method B the slow action is to assign the symbol to the Line element (5 milliseconds per element).
We think the problem is that there are many communications with the arcMap framework. So if you have any idea how this process can be speeded up it would be very helpful. We’d like this refreshing process can be performed as fast as possible… Maybe 10 seconds? Do you think it is possible?
Thank you very much for your help.