Hi,
I’ve got en error when I use tif with no tfw.
I use the classe MultiGeoRaster and the method DrawCore is
protected override void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)
{
double currentScale = ExtentHelper.GetScale(canvas.CurrentWorldExtent, canvas.Width, canvas.MapUnit);
if (currentScale >= lowerScale && currentScale <= upperScale)
{
RectangleShape currentExtent = canvas.CurrentWorldExtent;
Envelope currentExtentEnvelope = new Envelope(currentExtent.UpperLeftPoint.X, currentExtent.LowerRightPoint.X, currentExtent.UpperLeftPoint.Y, currentExtent.LowerRightPoint.Y);
ArrayList rasters = (ArrayList)spatialIndex.Query(currentExtentEnvelope);
foreach (string file in rasters)
{
GeoTiffRasterLayer rasterRasterLayer = new GeoTiffRasterLayer(file);
rasterRasterLayer.LibraryType = GeoTiffLibraryType.UnmanagedLibTiff;
rasterRasterLayer.Open();
rasterRasterLayer.Draw(canvas, labelsInAllLayers);
rasterRasterLayer.Close();
}
}
}
I have this error :
L’exception System.Exception n’a pas été gérée par le code utilisateur
Message=Une exception a été levée par la cible d’un appel.
Source=MapSuiteCore
StackTrace:
à ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à Invivo.Workspaces.Map.MultiGeoRasterLayerTIF.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers) dans … \MultiGeoRasterLayerTIF.cs:ligne 154
à ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
InnerException:
Until now, I had tif’s raster with the tfw, so I hadn’t this problem.
The version of the dll is 6.0.0.275.
Thanks a lot for your help.
Regards.
Steph.
Error with UnmanagedLibTiff
Hi Steph,
Thanks for your posts, we did have the issues when reading some .Tif files without .Tfw in 6.0 versions, sorry that we didn’t notice this kind of issue before.
All these have been fixed in the versions after 7.0.88.0, can you get the latest version and have a try? also please make sure install the .msi in the DLL package.
Thanks,
Johnny
Hi Johnny,
Thanks for your help.
I downloaded the version 7.0.0.92 and I have differents issues :
1) If the tif file is less than 10 Mo and parameters decimal in parameters of computer is ‘.’ so I can see the raster. ==>OK
2) If the tif file is less than 10 Mo and parameters decimal in parameters of computer is ‘,’ so I have an error : (ie ErrorN2_20130930.txt)
3) If the tif file is more than 300 Mo and parameters decimal in parameters of computer is ‘.’, so I have an error (ie : Capture_20130930.jpg)
and the code error is :
L’exception System.AccessViolationException n’a pas été gérée
Message=Tentative de lecture ou d’écriture de mémoire protégée. Cela indique souvent qu’une autre mémoire est endommagée.
Source=MapSuiteCore
StackTrace:
à ThinkGeo.MapSuite.Core.UnmanagedGeoTiffRasterSource.8TY=(Byte[] 8jY=, Int32 8zY=, Int32 9DY=, Int32 9TY=, Int32 9jY=, Int32 9zY=, Int32 /DY=, Int32 /TY=)
à ThinkGeo.MapSuite.Core.UnmanagedGeoTiffRasterSource.6TY=(Int32 6jY=, Int32 6zY=, Int32 7DY=, Int32 7TY=, Int32 7jY=, Int32 7zY=)
à ThinkGeo.MapSuite.Core.UnmanagedGeoTiffRasterSource.GetImageCore(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
à ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
à ThinkGeo.MapSuite.Core.GeoTiffRasterSource.GetImageCore(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
à ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
à ThinkGeo.MapSuite.Core.RasterLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à ThinkGeo.MapSuite.Core.GeoTiffRasterLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à Invivo.Workspaces.Map.MultiGeoRasterLayerTIF.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers) dans …\Classes\Map\MultiGeoRasterLayerTIF.cs:ligne 155
à ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à ThinkGeo.MapSuite.WpfDesktopEdition.LayerTile.DrawCore(GeoCanvas geoCanvas)
à ThinkGeo.MapSuite.WpfDesktopEdition.Tile.8RU=(GeoCanvas 8hU=)
à ThinkGeo.MapSuite.WpfDesktopEdition.Tile.Draw(GeoCanvas geoCanvas)
à ThinkGeo.MapSuite.WpfDesktopEdition.Tile.9hU=(Object 9xU=)
à System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
à System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
à System.Threading.ThreadPoolWorkQueue.Dispatch()
à System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException:
Thanks a lot for your help.
Regards.
Stéphanie.
Capture_20130930.JPG (44.3 KB)
ErrorN2_20130930.txt (6.5 KB)
Hi Steph,
Thanks for your further information, we tried to recreat your problem with our data, but it didn’t show up, would you please provide us your data for a further test, once we get your data, we will debug it immediately.
Waiting for your further information.
Best Regards
Summer
Hi,
I have an example of tif file without the tfw file associated.
So When I use GeoTiffRasterLayer, I have an error message stating that the tfw associated file is not present. (ie code)
var tiffRasterLayer = new GeoTiffRasterLayer(file);
So I changed the code to :
var tiffRasterLayer = new GeoTiffRasterLayer(file);
tiffRasterLayer.LibraryType = GeoTiffLibraryType.UnmanagedLibTiff;
And I have an error message :
à ThinkGeo.MapSuite.Core.UnmanagedGeoTiffRasterSource.TCE=(Byte[] TSE=, Int32 TiE=, Int32 TyE=, Int32 UCE=, Int32 USE=, Int32 UiE=, Int32 UyE=, Int32 VCE=)
à ThinkGeo.MapSuite.Core.UnmanagedGeoTiffRasterSource.QiE=(Int32 QyE=, Int32 RCE=, Int32 RSE=, Int32 RiE=, Int32 RyE=, Int32 SCE=)
à ThinkGeo.MapSuite.Core.UnmanagedGeoTiffRasterSource.GetImageCore(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
à ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
à ThinkGeo.MapSuite.Core.GeoTiffRasterSource.GetImageCore(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
à ThinkGeo.MapSuite.Core.RasterSource.GetImage(RectangleShape worldExtent, Int32 canvasWidth, Int32 canvasHeight)
à ThinkGeo.MapSuite.Core.RasterLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à ThinkGeo.MapSuite.Core.GeoTiffRasterLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à Invivo.Workspaces.Map.MultiGeoRasterLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers) dans C:\Steph_…\Classes\Map\MultiGeoRasterLayer.cs:ligne 268
à ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
à ThinkGeo.MapSuite.WpfDesktopEdition.LayerTile.OBg=(Layer ORg=, ThreadSafetyLevel Ohg=, GeoCanvas Oxg=, Collection`1 PBg=)
à ThinkGeo.MapSuite.WpfDesktopEdition.LayerTile.Mhg=(Layer Mxg=, ThreadSafetyLevel NBg=, GeoCanvas NRg=, Collection`1 Nhg=, Action`4 Nxg=)
à ThinkGeo.MapSuite.WpfDesktopEdition.LayerTile.DrawCore(GeoCanvas geoCanvas)
à ThinkGeo.MapSuite.WpfDesktopEdition.Tile.TBQ=(GeoCanvas TRQ=)
à ThinkGeo.MapSuite.WpfDesktopEdition.Tile.Draw(GeoCanvas geoCanvas)
à ThinkGeo.MapSuite.WpfDesktopEdition.Tile.URQ=(Object UhQ=)
à System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
à System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
à System.Threading.ThreadPoolWorkQueue.Dispatch()
I use the class Multigeoraster.
I can send you (if you want) the tif file.
Thanks for your help.
Regards.
Steph.
Hi Steph,
Please sent us all releated tif files.
Regards,
Don
Hi Don,
Thanks for your help.
The size of the tif file is 125 Mo, so too heavy to send by mail.
Is there a ftp to deposit this file ?
Thanks.
Just one more thing, I managed to extract the coordinates of the tiff file and created tfw file with listgoe.exe (FW Tools).
When I launched our aplication,I have a black screen instead of the raster ;-(
Thanks.
Regards.
Stéph.
Hi Steph,
Please contact your sales for get the detail information about our FTP.
I think the TIFF file don’t contains extent information so how you build the TFW file by utility? Are you type in the bounding box manually?
If you type in coordinates manually, I think maybe you can double check the TFW file, it’s format can be find from internet.
Regards,
Don