I downloaded the eval version, and run into problems right away when trying to open a geotiff image. I get a messagebox saying: 'Sorry can not handle images with 32-bit samples'. Is this the case, is the tiff just not compatible with mapsuite? I use:
Dim geotiff As New GeoTiffRasterLayer("geotiff-4919-6-1247526000-dmc_195_S_lai_map.tif") geoTiff.open() Dim staticOverlay As New LayerOverlay() staticOverlay.Layers.Add("GeoTiffRasterLayer", geotiff) winformsMap1.Overlays.Add(staticOverlay) winformsMap1.Overlays.Add(50,New Feature(geotiff.GetBoundingBox))
Unfortunately I am not a geoTiff expert, nor do we generate the tiff ourselves. I would appreciatie it if someone could have a look at the file!
Thanks for your post and thank you for giving us your sample code and data.
We have recreated the exception you mentioned in this post with your data; there may be some issue in our GeoTiff moudule, we will do more research about this problem. As a workaround, you could use GdiPlusRasterLayer instead temporally. The code is like this:
RectangleShape boundingBox = new RectangleShape(5.08081184375624, 51.5199666081462, 5.0966905211244, 51.5086369572673);
Thanks for the quick reply! I will wait for more news, the workaround will work for this image, but not for others since the bounding box will never be the same.
I think we don’t support the kind of your GeoTiff files so far, the exception is thrown by the third component which we using. If the workaround from Sun can’t work with your other files, I am afraid there is not any other way can do it.
The investigation will keep going, if we find anything can help I will let you know.
As the development of managed code support may take a bit long time, could you please use the unmanaged version in the project instead, here below is the demo code:
// It is important to set the map unit first to either feet, meters or decimal degrees.
mapView.MapUnit = GeographyUnit.Meter;
// Create a new overlay that will hold our new layer and add it to the map.
LayerOverlay layerOverlay = new LayerOverlay();
mapView.Overlays.Add(layerOverlay);
// Create the new layer and dd the layer to the overlay we created earlier.
UnmanagedGeoTiffRasterLayer geoTiffRasterLayer = new UnmanagedGeoTiffRasterLayer(@"C:\Users\zhangzhao.APTHINKGEO\Downloads\Q5112B.tif");
layerOverlay.Layers.Add(geoTiffRasterLayer);
// Set the map view current extent to a slightly zoomed in area of the image.
// 500000.0000000000000000,7068000.0000000000000000
// 506000.0000000000000000,7074000.0000000000000000
mapView.CurrentExtent = new RectangleShape(500000, 7074000, 506000, 7068000);
// Refresh the map.
mapView.Refresh();