ThinkGeo.com    |     Documentation    |     Premium Support

The problem of GeoTiff image display

Hi,

I want to draw a GeoTiff image on my map, I use the GeoTiffRasterLayer class to open a GeoTIFF image.

 the GeoTiff image that display on my map is a gray image. But my GeoTiff image is a 24bit colour image.

How can I display a GeoTiff imageon as a 24bit colour image on my map.would you please help me?

thank you very much?

The following is my code:


            winformsMap1.MapUnit = GeographyUnit.Meter;

            winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);


            GeoTiffRasterLayer Layera = new GeoTiffRasterLayer(@"C:\OSGeo4W\apache\htdocs\images\tile_2_2.tif");

            Layera.UpperThreshold = double.MaxValue;

            Layera.LowerThreshold = 0;

            Layera.IsGrayscale = true;


            LayerOverlay ImageOverlay = new LayerOverlay();

            ImageOverlay.Layers.Add("WorldImageLayer", Layera);

            winformsMap1.Overlays.Add(ImageOverlay);

       

            Layera.Open();

            winformsMap1.CurrentExtent = Layera.GetBoundingBox();

            Layera.Close();

            winformsMap1.Refresh();      



Senlin,


Can you try setting the GrayScale to false as following to see it works?

Layera.IsGrayscale = false;

 

If it still not works, could you upload the data?
 
Any more questions please feel free to let me know.
 
Thanks.
 
Yale


Yale,  
   thanks very much for your help. 
   I have tried  to set the GrayScale to false,but it doesnit work.the GeoTiff image that display on my map is  still a gray image. 
 my data is too big,So I canot upload the data . my data including the following files: 
 tile_2_2.aux 
 tile_2_2.rrd 
 tile_2_2.tif. 
  
  I  prepared the iamge ,coverted the GeoTiff image  to a  bmp image ,  then use GdiPlusRasterLayer class,it works very well. 
  
  senli 


Senlin, 
  
 Thanks for letting us know your status! 
  
 Hmm, this is very interesting, we tested against some tif file and it works fine. I am not sure why this happens in your GeoTiff file. 
  
 If you still need to solve this problem, you can contact our support to see how you can send us your data. 
  
 Thanks! 
  
 Yale