Hi,
I’m playing around with GeoTIFFs and some will not be displayed.
Getting an exception
"The input double value is out of range.
Parametername: canvasWidth"
when zooming to the extent of the raster file.
I have attached the tif and tfw.
Displaying with Picture Viewer is ok, also qgis…
Using MapSuite 9.0.160.
Any Clou?
Regards Hardy
neu.zip (830 KB)
GeoTIFF cause exception
Hi Hartwig,
Thanks for your demo data, but seems like it works well on my end with the specified 9.0.160.0. Here as following is the code I used, please take a try:
winformsMap1.MapUnit = GeographyUnit.DecimalDegree;
winformsMap1.BackgroundOverlay.BackgroundBrush =
new
GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
LayerOverlay overlay =
new
LayerOverlay();
winformsMap1.Overlays.Add(overlay);
GeoTiffRasterLayer layer =
new
GeoTiffRasterLayer(@
"C:\neu\039_geo.tif"
, @
"C:\neu\040_geo.tfw"
);
overlay.Layers.Add(layer);
layer.Open();
winformsMap1.CurrentExtent = layer.GetBoundingBox();
layer.Close();
winformsMap1.Refresh();
Thanks,
Johnny
Hi Johnny,
thanks for replay.
Could projection cause the Problem?
We are working with projected data
…
Dim
TiffRasterLayer
As
GeoTiffRasterLayer =
New
GeoTiffRasterLayer(LayerPath)
'TiffRasterLayer.LibraryType = GeoTiffLibraryType.UnmanagedLibTiff
With
TiffRasterLayer
.IsVisible =
False
Dim
ImageProjection
As
New
ManagedProj4Projection
ImageProjection.ExternalProjectionParametersString = ManagedProj4Projection.GetSphericalMercatorParametersString
ImageProjection.InternalProjectionParametersString = ManagedProj4Projection.GetEpsgParametersString(EPSG)
ImageProjection.Open()
.ImageSource.Projection = ImageProjection
.Open()
End
With
Return
TiffRasterLayer
Also the Content of the tif is not complete. The map displays only a part of the whole tif.
It seems to me that tfw is the key to solve the Problem. But in other GIS application the data will be displayed correct…
Any Suggestion?
Hardy
Hi Hardy,
Maybe related to the projection, could you let me know what’s the EPSG you are using? Is it possible to update your demo to us? maybe a screenshot should be better.
Thanks,
Johnny
Hi Johnny,
I have done some Tests.
Using a projection will cause Major Problems:
1. Memory usage (as 32bit exe the application will run into Trouble, because the consumption is very high, think it’s depending on calculating the Rotation…)
2. only one or two tiffs will be loaded. and only parts of them.
Turning off the projection (I use it for rotating the map) fixes all Problems.
All files will be loaded, no Problems with Memory.
So I think there is a Problem within MapSuite to handle rotated raster.
Rotating raster is a function we can’t miss.
Please could you check and get the bug (?) fixed.
Regards
Hardy
Hi Hartwig,
I can’t reproduce your issue, could you please send a reproducible sample and test data to me?
Thanks,
Casper Lee