ThinkGeo.com    |     Documentation    |     Premium Support

Stack is null

Hello,


I'm confuse in this Exception.


I use the same Map file.


I input the same coordinate in app, for two computer (OS: XP/ window7)


in w7, the map refresh is correct.


but in XP, it shows error message as follows:


System.InvalidOperationException: Stack is null 


   於 ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)

   於 ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x03e3d48bcfe7bb6c(IEnumerable`1 xa6f0db4f183189f1)

   於 ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xff5b27c00f9678c2(RectangleShape x178b193eec228e6e)

   於 ThinkGeo.MapSuite.DesktopEdition.WinformsMap.xe3cee4adb9c72451()

   於 ThinkGeo.MapSuite.DesktopEdition.WinformsMap.x9ac8c50f434f4b39(Int32 xb565f4681f05557a)

   於 ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()

   於 test.Form1.btn_ZoomIn_Click(Object sender, EventArgs e) 於 C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\test\test\Form1.cs: 行 531


--------------------------------------


Version:


MapSuiteCore:3.1.371.0;  DesktopEdition:3.1.371.0



I have two TextStyle: 
             TextStyle textStyle2 = new CustomTextStyle();// set label’s RotationAngle is 0 
             textStyle2.TextColumnName = “Road”; 
             textStyle2.Font = new GeoFont(“細明體”, 12); 
             textStyle2.TextSolidBrush = new GeoSolidBrush(GeoColor.SimpleColors.Black); 
             textStyle2.HaloPen = new GeoPen(GeoColor.StandardColors.White, 3); 
             textStyle2.SplineType = SplineType.ForceSplining; 
             textStyle2.FittingLineInScreen = true; 
             textStyle2.TextLineSegmentRatio = Double.MaxValue; 
             textStyle2.OverlappingRule = LabelOverlappingRule.NoOverlapping; 
             textStyle2.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; 
  
             TextStyle textStyle4 = TextStyles.CreateSimpleTextStyle(“Road”, “細明體”, 12,      DrawingFontStyles.Regular, GeoColor.StandardColors.Black, GeoColor.StandardColors.White, 2, 0, 3); 
             textStyle4.TextLineSegmentRatio = Double.MaxValue; 
             textStyle4.OverlappingRule = LabelOverlappingRule.NoOverlapping; 
             textStyle4.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels; 
  
 if I use textStyle2 in XP, it will throw exception, but it just happened in some specific coordinates. (if I use textStyle4, Map works correctly) 
 in W7, the map works well… 
 I still don’t know what reason causes this error… 
 please give me some idea. Thanks.

Carol,


Thanks for your inputs, it seems you application depends on the OS somehow.
 
I noticed that the main difference between textStyle2 and textStyle4 is the HaloPen set for the textStyle2, could you have a try to remove the HaloPen to see if it sill throw exception?
 
Also, you mentioned that it will only throw exception in some specific coordinate, could you get one of those coordinates, and I will have a try on a WinXp 32 Chinese OS on this coordinate.
 
Any more questions just feel free to let me know.
 
Thanks.
 
Yale

Thanks for your reply, Yale 
 if I remove the HaloPen, it sill throw exception. 
 Tha main difference between textStyle2 and textStyle4 is textStyle2 set label’s RotationAngle=0  
 TextStyle textStyle2 = new CustomTextStyle();// set label’s RotationAngle is 0  
 textStyle2.SplineType = SplineType.ForceSplining; 
 if I change SplineType to SplineType.StandardSplining/SplineType.Default/SplineType.None 
 it doesn’t throw exception. 
  
 I can give you one specific coordinates that happen exception. 
 121.50926 24.985475  it happen error in zoomlevel 20.

Carol,


Thanks for your response.


I am afraid I need your data to recreate your problem. I use the data attached in our package and it works fine in Windows 2003 Chinese Operating system, while I do not test the WinXp Chinese OS because it is not available now.


Could you have a try to see if this problem still exists on your WinXp environment with the following data?



private void DrawCurvedLabels_Load(object sender, EventArgs e)
        {
            winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
            winformsMap1.BackgroundOverlay.BackgroundBrush =new GeoSolidBrush(GeoColor.FromArgb(255, 233, 232, 214));

            ShapeFileFeatureLayer austinStreetsShapeLayer = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\austinstreets.shp");
            austinStreetsShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
            austinStreetsShapeLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(LineStyles.LocalRoad1);

            ShapeFileFeatureLayer austinStreetsLabelLayer = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\austinstreets.shp");
            austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            //TextStyle textStyle = TextStyles.LocalRoad1("FENAME");
            //textStyle.TextLineSegmentRatio = double.MaxValue;
            //textStyle.SplineType = SplineType.StandardSplining;
            //austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(textStyle);

            TextStyle textStyle2 = new TextStyle();// set label's RotationAngle is 0 
            textStyle2.TextColumnName = "FENAME";
            textStyle2.Font = new GeoFont("細明體", 12);
            textStyle2.TextSolidBrush = new GeoSolidBrush(GeoColor.SimpleColors.Black);
            textStyle2.HaloPen = new GeoPen(GeoColor.StandardColors.White, 3);
            textStyle2.SplineType = SplineType.ForceSplining;
            textStyle2.FittingLineInScreen = true;
            textStyle2.TextLineSegmentRatio = Double.MaxValue;
            textStyle2.OverlappingRule = LabelOverlappingRule.NoOverlapping;
            textStyle2.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;
            austinStreetsLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(textStyle2);

            LayerOverlay staticOverlay = new LayerOverlay();
            staticOverlay.Layers.Add("AustinStreetsShapeLayer", austinStreetsShapeLayer);
            staticOverlay.Layers.Add("AustinStreetsLabelLayer", austinStreetsLabelLayer);
            winformsMap1.Overlays.Add(staticOverlay);

            winformsMap1.CurrentExtent = new RectangleShape(-97.6881803712033, 30.3177912428115, -97.6723016938352, 30.3064615919325);

            //winformsMap1.ZoomIntoCenter(10,new PointShape(121.50926 ,24.985475 ));

            winformsMap1.Refresh();
        }

Any more questions just feel free to let me know.


Thanks.


Yale

 



Thanks for your reply, Yale 
 your code as below wroks well. 
 but I think the problem is strange. 
 1. why it just happen in specific coordinates and zoomlevel 
 ex in currently, i find two coordinate have error message.  
 CoordinateA works error in zoomlevel20 
 CoordinateB works error in zoomlevel19 
 2. why it works well in W7, but doesn’t work in XP…

hello 
 i can give you sample data 
 sharelfu.sytes.net/ting_upload/Road_AL.rar 
 you can try two points 
 ErrorGis:121.50926 24.985475   in zoomlevel 20 
 ErrorGis:121.498817 25.022928   in zoomlevel 19

hello, Yale 

If I remove follows code, this error doesn't show...so..I think you can try it. 

InMemoryBitmapTileCache bitmapTileCache = new InMemoryBitmapTileCach(); 

worldOverlay.TileCache = bitmapTileCache; 

I just let you know that maybe is problem...but i'm not sure.


and I have to set InMemoryBitmapTileCache  to improve my map speed...


your component speed still slow...I hope you can improve it!


if you have any suggesion, please let me know.



Carol,


I am sorry I still cannot recreate your problem.


1. First , I notcied in your code, there is a customzied class called  CustomTextStyle, the code is not attached.

2. In the data you provided, I did not find “Road” column text, only contains two columns “RID” “ADR”. So I am wondering if you are sending a wrong data.

3. I changed the TextColumnName from “Road” to “Adr”, and  I tested in Window Server 2003  Enterprise Edition Service Pack2, Chinese Regin, it works fine.


So, if possible, could you send me a compartively small sample applictaion with data attached to show the problem? That would be much convinient to make us in the same line with the problem.


Any more questions just feel free to let us know.


Thanks.


Yale

 



Thanks for your reply, Yale


I attach a sample as follows.


and I think you have to download font type from: 50rpg.com/upfree/download.php?id=ABA757FD1


this problem still let me confused...I'm not sure where is wrong... :(



2057-testForYale.zip (2.21 KB)

Carol,


Try following sample and get a screenshot for me if possible. See my screenshot which seems working fine.
 

 
Thanks.
 
Yale

2058-Post7510Sample.zip (12.3 KB)

Thank for your reply, Yale


I use my sample and get screenshot as follows:


I want to make sure if you have use the same font type with me?


            TextStyle textStyle2 = new CustomTextStyle();

            textStyle2.TextColumnName = "ADR";

            textStyle2.Font = new GeoFont("華康中圓體", 12);  <<<<you download="" post="" have="" i="" type.="" font="" this="" to=""></you>             textStyle2.TextSolidBrush = new GeoSolidBrush(GeoColor.SimpleColors.Black);

            textStyle2.HaloPen = new GeoPen(GeoColor.StandardColors.White, 3);

            textStyle2.SplineType = SplineType.ForceSplining;

            textStyle2.FittingLineInScreen = true;

            textStyle2.TextLineSegmentRatio = Double.MaxValue;

            textStyle2.OverlappingRule = LabelOverlappingRule.NoOverlapping;

            textStyle2.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;      


 


 


 



2062-testForYale.zip (36.2 KB)

I think "maybe" the problem in InMemoryBitmapTileCache ...


if I remove the follows code...


 //InMemoryBitmapTileCache bitmapTileCache = new InMemoryBitmapTileCache();

  //worldOverlay.TileCache = bitmapTileCache;


it works fine.



 



Carol, 
  
 That probablly the real reason for this problem.  
  
 Could you have a try on the FileBitmapTileCache instead of Inmemory one? 
  
 Thanks. 
  
 Yale 


Thanks for your reply, Yale 
 I try to use FileBitmapTileCatch to show Map. 
 the error still exist. :(

Carol,  
 Thanks for your response.  
  
 Just make sure, When you do not set the TileCache the problem will go away? If so, I think this problem is totally have nothing to do with Font, just a problem hidden in TileCache. 
  
 That is so wield, as you know, I did not have the WinXP Chinese OS on hand. 
 So proablly it will take a few days to prepare for that. 
  
 Wield thing… 
  
 Yale

Thanks for your reply, Yale 
 I’m not sure if TileCatch is main problem…I just say “maybe”… 
 Why I propose this problem…just I set 3700 point to test my Map data in each level. 
  
 another Strange problem… 
 if I set tileCathc in W7… 
 this problem doesn’t happen… but I have no complete test… just input some specific coordinates. 


Carol, 
  
 Thanks for your reply. 
  
 I have no idea what is the real reason for this problem because up to now I could not recreate on my enviroments avaiable. 
  
 If this problem is very urgent to you, we probablly will try to create an enriroment exactly same with you to recrete this problem in the coming weeks. 
  
 Thanks. 
  
 Yale 


Thank for your help, Yale 
 The problem is very urgent…because we will generate new product to our customers. 
  
 in this weekend, we will test more situation to know which reason causes this problem. 
 But, I hope you keep help me to find what is main problem… 
 If you have any new idea, please let me know. 
 Thanks.

Carol,


Just make sure, your Operating system in which the problem is accuring is the Chinese Tradional Operating system 32 bit ? If so, we may need to download this kind of OS to recreate this problem.
 
Any more testing result let me know.
 
Thanks.
 
Yale