Hello,
I recently got in my hands some code dealing with Geotiffs from the MapSuite project I work on. The code seemed to work by reading some geotiffs but it needed some "external maths" to perform certain calcuation of distances and bearing between lat/log points. I noticed that the geotiffs were read by using the GdiPlusRasterLayer and although the geotiffs were coming with a proper .prj file, that had been replaced by .tfw(?) for them to be properly (I guess this is an ESRI World File) opened. If I was feeding the original GeoTiff with its associated proj file the code was just crashing with a nullReference exception. So I just replaced the GdiPlusRasterLayer with a GeoTiffRasterLayer and all seems to work fine. I am prety sure though that there were a few good(?) reasons for the previous choices and I am kindly scared to move forward like this. So after reading the forum here are a few questions:
- Are there any more issues with Geotiffs as discussed here
- Is it still recommended to use
tiffRasterLayer.LibraryType = GeoTiffLibraryType.UnmanagedLibTiff;
- When first used the GeoTiffRasterLayer on MapSuite Dekstop edition 4.0 and .net 4.0 I got a: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information. That was resolved by applying useLegacyV2RuntimeActivationPolicy="true". Is this the recommended course of action?
- Finally, are there any good reason for using Gdi layer instead of GeoTIff?
The problem mainly for me was that I had to canibalise a perfectly valid .prj file and create a .tfw that I was not even sure if it was the correct "projection" information as it was just "given". Essentially that approach was creating "MapSuite" only geotifs as most of the other commercial applications had unpredictable behaviour with those files.
Thank you in advnace
Yiannis