ThinkGeo.com    |     Documentation    |     Premium Support

Integrate Mapserver+Tilecache with Thinkgeo

Hi,


In order to improve the performance of my app, I am trying to integrate Mapserver+Tilecache  with ThinkGeo. I have tried many method to to that, but got little progress.


I set url mycomputer/cgi-bin/mymap.exe? in mapfile of Mapserver,


and set url "url=mycomputer/cgi-bin/mymap.exe?" in tilecache.cfg of Tilecache.


If I want to make use of the advantage of Tilecache, shall I do like below?


WmsRasterLayer wmsImageLayer = new WmsRasterLayer(new Uri("url=mycomputer/cgi-bin/mymap.exe?"


I tried this, but failed.


Is there anybody has experence with this subject?


Senlin



Senlin,


We tested against MapServer 5.2.1 and it works fine.
 
Could you try set different URL as following way ( the difference is that we set the Map), hope it helps.
OnlineResource:
...hostname.../cgi-bin/mapserv.exe?MAP=C:/ms4w/apps/gmap/htdocs/gmap75_wms.map
 
GetCapabilities:
...hostname.../cgi-bin/mapserv.exe?MAP=C:/ms4w/apps/gmap/htdocs/gmap75_wms.map&SERVICE=wms&VERSION=1.1.1&REQUEST=GetCapabilities
 
Any more question just feel free to let me know.
Thanks.
 
Yale

Yale, 
 I know how to integrate ThinkGeo and Mapserver, and it works well, but I don’t know how to use TileCache(another open source software) to enhance performance by using the tiles pre-created. 
 Do you have any idea? 
  
 Senlin

Senlin, 
  
 I think it depends on the TileCache of open source software, as mentioned in your post, we do not support the WMS-C standards now. Just curious that why you do not use the built in TileCache system of MapSuite component? 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale 


Yale, 
 Thank you for your time. 
 TileCache system of MapSuite component works only when I have created local cache(by panning/zooming etc.), and it works not bad if there is cache on local disk, but at the first time we use the system, we have no local cache yet. My customer can not accept the peformance when there is still no local cache. 
 More information about my requirement: 
 We are using C/S archetechre, we put the map data on serve. At first, we tried to access map data directly, but found bad performance during map manipulation. then we use Mapserver as WMS server. it’s better, but it took too long to create WMS aftermy client application(with ThinkGeo) send request. because Mapserver created WMS directly, so I want to pre-create the tiles on the server, then we can improve the server side’ performance. 
 What’s more, the data on server may be updated frequently.  
  
 Do you have some suggestion to our requirement? 
  
 Senlin

Senlin,


It is my fault; I forget that we can pre-generate those tiles in advance with Map Suite componentJ.
 
Following posts contains some sample code which you probably can reuse to generate tiles in server side in advance.
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/21/aft/6169/afv/topic/Default.aspx
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/6274/afv/topic/afpgj/1/Default.aspx#11328
 
Also this one talked about one potential bug when setting the MapUnit to Meter & Feet:
gis.thinkgeo.com/Support/Dis...fault.aspx
 
Besides, every time your data on server have been updated, your have to re-generate those tiles to match up your updated data.
 
Any more questions just feel free to let me know.
 
Thanks.
 
Yale

Yale, 
 Thank you. 
 I pre-generated 9 zoom levels cache as sacles following: 
 1000,000 
 500,000 
 250,500 
 100,000 
 50,000 
 25,000 
 10,000 
 5,000 
 2,500 
 But some times my client application don’t use the scales I pre-generated as above, for example, when I zoom to 50,000, client application may generate new cache directory named 50,000.00001,  So my pre-generated cache will not be used. 
 my code: 
 this.winformsMap1.ZoomLevelSnapping =ThinkGeo.MapSuite.DesktopEdition.ZoomLevelSnappingMode.None; 
 this.winformsMap1.ExtentOverlay.MouseWheelMode =ThinkGeo.MapSuite.DesktopEdition.MapMouseWheelMode.Disabled; 
 this.winformsMap1.MouseWheel += new System.Windows.Forms.MouseEventHandler(winformsMap1_MouseWheel); 
  
 long[] m_Scales = new long[] { 1000000, 500000, 250000, 100000, 50000,25000, 10000, 5000, 2500 }; 
 private int m_zoomIndex = 1; 
  
  
 public void ZoomIn() 
 { 
 if (m_zoomIndex < m_scales.GetLength(0)) 
 { 
 ++m_zoomIndex; 
 } 
 else 
 { 
 return; 
 } 
 this.winformsMap1.ZoomToScale(m_scales[m_zoomIndex - 1]); 
 this.winformsMap1.Refresh(); 
  
  
 } 
  
 public void ZoomOut() 
 { 
 if (m_zoomIndex >= 2) 
 { 
 --m_zoomIndex; 
 } 
 else 
 { 
 return; 
 } 
 this.winformsMap1.ZoomToScale(m_scales[m_zoomIndex - 1]); 
 this.winformsMap1.Refresh(); 
 } 
  
 private void winformsMap1_MouseWheel(object sender,System.Windows.Forms.MouseEventArgs e) 
 { 
 if (e.Delta > 0) 
 { 
 ZoomIn(); 
 } 
 else 
 { 
 ZoomOut(); 
 } 
 } 
  
  
 Senlin 
  
  


Senlin, 
  
 Thanks for your post.  
  
 What your map unit, is it in Meter & Feet instead of DecimalDegrees?  If yes, I think that is because there was a potential bug hidden there. 
  
 About the MouseWheel solution, this solution is only a temporary way to go around the problem, while in next public release with this problem solved, there is a better way for it. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale 


Yale,


My map unit is  Meter ,I think maybe there is a bug  in function ZoomToScale . But I also tried to  zoom my map to a certain scale  by following the sample code. tWHeelWheelgis.thinkgeo.com/S...fault.aspx


So I think maybe the problem is the scale is a double type. I hope it will help you. I wanto to when you can release the next  version with this problem  is solved?


I 'm excepting your reply,thanks very much !


Senlin



Thanks for your post, Senlin. 
  
 The next public release is expected out before the end of next week, hope it is not too late. 
  
 Any more questions just feel free to let me know. 
  
 Thanks. 
  
 Yale