Select to view content in your preferred language

Handling large Shapefiles

1304
5
11-18-2013 10:37 AM
LouisDeSantis
Emerging Contributor
Hi,

We have an App built using ArcObjects that is asked by end users to - on occasion - open large shapefiles.

When these large (400k features) shapefiles are opened, we notice a significant lag in the performance of the application.

We have determined that part of this is due to the Application having to draw all of the features that fall within the full extent. What is the best way to limit the extent of the Map Control prior to drawing anything? Is there a method that we can use to force the extent of the Map control to a small  area prior to drawing anything?

TIA
0 Kudos
5 Replies
RobertBorchert
Honored Contributor
Double click on the feature in the table of contents to open layer properties.  The click on the General Tab then select a scale at which to become visible.

Start with 1:24,000 and see how that works.

also, do this for as many of your features that do not need to be observed at full scale.  Labels as well.

The more features you have to draw the longer it will take.

A good part of it is also hardware.  Better graphics cards and better CPU's and RAM.

IF it is something that people need to add on occasion then set your desired scale for the shape file and save it as a layer file.  then when someone just needs to add it real quick it will not become visible until the desired scale is reached.
0 Kudos
LouisDeSantis
Emerging Contributor
Thanks for the quick response.

How can we do this programmatically? What methods & properties on which 10.0, 10.1, & 10.2 objects should we be focusing on?

TIA
0 Kudos
AlexanderGray
Honored Contributor
ILayer interface properties: maximumscale minimumscale
0 Kudos
LouisDeSantis
Emerging Contributor
Is there any method (or technique) for preventing the Map Control from drawing any features until:

-The Extent is set (in code), and
-The Layer is fully 'loaded'

In the interest of minimizing the amount of time that a user has to wait for a layer to draw?

TIA
DuncanHornby
MVP Notable Contributor
Another performance boost is to ensure your Shapefile has a spatial index. A spatial index is not always guaranteed, especially if the Shapfile was built by another application.

You can tell if you have an index by simply opening the attribute table and if you see a * in the Shape field header then you know you have a spatial index, goes for attribute indices too.

Duncan
0 Kudos