This project is read-only.

AddLayer() Performance

Sep 27, 2013 at 5:10 PM
Im adding layers to an AxMap control in VS2010 C#.

Some of the layers are pretty large (300k features).

The AddLayer method is taking nearly 30 seconds.

Any Ideas
Sep 30, 2013 at 8:40 AM
Sep 30, 2013 at 1:24 PM
Thanks for the idea.

Unfortunately I have already created a valid spatial index for this layer.

I am curious as to whether or not using the visible argument in the 'AddLayer ( object Object, bool Visible ) ' method might help?

If I set this flag to false, the Map Redraw time is much faster, but of course it is not visible.

How might I toggle the visibility of the layer later in the application so that I only draw the layer when there are a minimum of features in the current extent? An Example would be great if you have one.

FWIW, I am already using the scale-dependent rendering features in the application such as :
            axMap1.set_LayerMinVisibleScale(handleLayer, 0.0);
            axMap1.set_LayerMaxVisibleScale(handleLayer, 900000);
            axMap1.set_LayerDynamicVisibility(handleLayer, true);

These don't seem to help in speeding up the initial load of the shapefile in the AddLayer method.

Oct 1, 2013 at 6:17 PM
More on this issue:

I think I may have found a way tp speed up the loading and drawing of these large shape files, at least it appears speedier.

By doing the following:
-set axMap1.Visible to False
-setting the axMap1.Extent to a small area within the full extent
-set the axMap1.Visible to true.

This drastically speeds up the rendering of my shapefile data, but there are some questions:
  • If I use the .Hide()/.Show() methods on the control (rather than .Visible) I lose the ability to reference axMap1. Why?
  • If I apply categories or layer-based rendering from a call to axMap1.LoadLayerOptions(), it can take a lot more time. Why?
  • Are there any other strategies that others would like to share to handle large shapefiles?
Oct 2, 2013 at 9:15 AM