ThinkGeo.com    |     Documentation    |     Premium Support

Speed question

Hi all:


I am loading 12 ShapeFileFeatureLayers into my map.  I only have 5 set to visible.  The map is really slow to zoom in and out. Currently I am working with the trial version, but we will be purchasing the software.


We are using this as a MapObjects replacement.  MapObjects was MUCH faster than this.  Any suggestions as to how to speed things up?


Thanks.


Elisa



Elisa, 
  
 Thanks for your post and questions. 
  
 I suggest you use the MapSuite Explorer to load all of your files and have a try to play around with it to see its performance. MapSuite Explorer is developed based on Service Edition, which can reflect the most efficient way to load and unload shape files.  
  
 There are couple of other stuff added to Desktop Edition such as AdormentOverlay, BackgourndOverlay etc, which will somehow slowdown its performance. Besides, can you just add those 5 visible files which means removing those unnecessary files and have a try? 
  
 Thanks. 
  
 Yale 


Yale:



I tried the MapSuite Explorer and it is MUCH faster than my map.  How do I implement its way of loading, etc.?



Will the speed get faster when I switch from the Demo version to the purchased version (no Unlicensed text on map)?



I am attaching my load function, along with a file listing the sizes of my shapefiles.  I have indexes on all of them.


Speed is critical in this application.  Even panning is very slow.


Thanks.


Elisa



1977-loadup.txt (11 KB)

Elisa,


Of course, you could implement the way used in Map Suite Explorer, while it needs much more code. Basically, if you develop your application based on Service Edition instead of Desktop Edition, you are going the right way as it is. While, probably it needs more work to undergo.
 
I reviewed the code provided in the attachment, and I have 2 places not very sure:
1) Why you call the winformsMap1.Refresh() twice in your LoadLayers functionality.
If no special reason, could you remove the first call of the winforms1.Refresh which seems being called after no layer is added?
 
2) There are couple of places calling the DoEvents, is there some special reason? Could you try to comment out those callings?System.Windows.Forms.Application.DoEvents();
 
Following three shapes seem very large in size while all their visibility is set to false:
4,201,604KB OpusTrack-roads.shp
5,828,332KB qs.shp
2,351,232KB section.shp
 
Could you have a try to unload them to see if there is a performance boost?

layerOverlay.Layers.Add("boundary", boundary);
layerOverlay.Layers.Add("rms", rms);
layerOverlay.Layers.Add("irs", irs);
layerOverlay.Layers.Add("townships", townships);
//layerOverlay.Layers.Add("sections", sections);
//layerOverlay.Layers.Add("qsections", qsections);
layerOverlay.Layers.Add("lakes", lakes);
layerOverlay.Layers.Add("rivers", rivers);
layerOverlay.Layers.Add("railways", railways);
//layerOverlay.Layers.Add("roads", roads);
layerOverlay.Layers.Add("urban", urban);
layerOverlay.Layers.Add("privateent", privateent);
layerOverlay.Layers.Add("rural", rural);
winformsMap1.Overlays.Add("maps", layerOverlay);
//System.Windows.Forms.Application.DoEvents();

 
Any more questions please feel free to let me know.
 
Thanks.


Yale

Yale: 
 I have calls to DoEvents because I have an animated "Loading…" gif showing while eveything is loading. 
 I need to checkboxes for each layer to turn them on/off.  The roads layer is initially checked (set to visible). 
 In order to have performs during running of the program, these need to be loaded so that only the visibility changes. 
  
 The issue I have is not the loading - it is in the time to do a pan, zoomin, zoomout etc.  Is there a way to speed 
 these up so that they work with the speed of the Map Suite Explorer? 
  
 What is the difference between Service Edition and Desktop Edition?  Where go I get info on Service Edition? 
  
 Thanks. 
  
 Elisa

Elisa, 
  
 Service Edition is another product in Map Suite product line. It’s kind of a Map Engine, all our other products like Desktop, Web, Silverlight are using this Engine. As a low level assembly, Service Edition is not so easy to use when creating a high level application like Desktop App but it’s more efficient.  
  
 From my experience, Desktop is slower than Service but it’s not that slow. Can you try to find out what is the most slower part in your app? For example you can just add 1 layer to the map to see if it is still slow, it yes, please provide more code to us as maybe other codes have issues except loadlayers. If not, you can keep adding layers to see which is the bottlenect slowing down everything. 
  
 In May 1st, we will have a big release and every of our products will be renewed. There will be a new product called WPF Desktop Edition, which is a WPF Control with much higher performance than the existing WPF control. If in the future you want to switch to WPF, that’s a good product to go with. 
  
 Thanks, 
  
 Ben