ThinkGeo.com    |     Documentation    |     Premium Support

GeoTiffRasterLayer displays as black rectangle

I would like to display a Tiff image (USGS Quad) as a LayerOverlay.  Below is the sample code I'm using.  The Tiff image displays as a black rectangle over the top of the shapefile data also added to the LayerOverlay.  The x,y position of the image is correct.  The border of the image displays as white strips offset in the rectangle.  I've verified the image is valid by using the same files and displaying them with ArcMap.  ArcMap displays the same border but also displays the green and white quad sheet with contours, roads, section lines, etc.   I'm new to Map Suite so please point out and suggest code changes that I should use to display the Tiff image as an overlay.  The shapefile data displays correctly on the overlay.  I'm running Map Suite Desktop Full Edition 3.0 on Windows Vista 6.0 using Visual Studio 2008.


Thank you!



 //Shapefile overlay example
 string ShapeFilePath = @"W:\Engineering\Sample Datasets\Ammonite Louisiana\WGS84\A_Unpaved_Roads_polyline_WGS84.shp";
 GeoColor GColor = GeoColor.StandardColors.Gray;
 float size = float.Parse("0.2");
 ShapeFileFeatureLayer FLayer = new ShapeFileFeatureLayer(ShapeFilePath);
 FLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
 FLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.CreateSimpleLineStyle(GColor, size, true); FLayer.Open();
 basemapOverlay.Layers.Add(FLayer);
 wpfMap1.CurrentExtent = FLayer.GetBoundingBox();


 //Georeferenced Tiff image overlay example
 GeoTiffRasterLayer ILayer = new GeoTiffRasterLayer(@"W:\Engineering\Sample Datasets\Ammonite Louisiana\Imagery\o32093b8_WGS841.tif", @"W:\Engineering\Sample Datasets\Ammonite Louisiana\Imagery\o32093b8_WGS841.tfw");
 ILayer.Open();
 basemapOverlay.Layers.Add(ILayer);
 wpfMap1.CurrentExtent = ILayer.GetBoundingBox();

 wpfMap1.Overlays.Add("BaseMapOverlay", basemapOverlay);
 RefreshView();



I did a quick test by adding a Tiff image I found on ftp://data.massgis.state.ma.us/pub/. As you can see in the screen shot, the image displays correctly. I suspect that this is something specific with your image. Can you contact support@thinkgeo.com to have them set you pu for sending us your image? With that image, we will have a clearer idea of where the problem is. Thank you.




Val,  The image I was using was in fact responsible.  I obtained an original image and replaced the one I was using and everything then worked fine - the image displayed as expected using the code above with no code changes.  Thank you!

You are welcome. Any other questions, let us know.