I have an elevation TIFF file that comes from another program that seems to have something wrong with its Vertical Coordinate System. The coordinate system is EGM96 Geoid. I cannot open this TIFF in code, but I can open this TIFF in ArcMap. And in ArcMap I can see that the Vertical Datum is "EGM96 geoid".

If I select the predefined EGM96 Geoid coordinate system in ArcMap the Vertical Datum is "EGM96_Geoid". So the datum is the only difference I can see between the two within ArcMap. Also in ArcMap I can use Define Projection to update the TIFF's projection to the predefined EGM96 coordinate system and then I am able to open the TIFF in code without any issues. I do not want to have to run define projection on these TIFF's.

When I try and open the original TIFF in code the program crashes instantly without throwing any exceptions or logging any errors. Here is the code I use to open the TIFF.

IWorkspaceFactory raster_factory = new RasterWorkspaceFactory();
IRasterWorkspace raster_ws = raster_factory.OpenFromFile(ws_path, 0) as IRasterWorkspace;
IRasterDataset raster_ds = raster_ws.OpenRasterDataset("raster_name");
IRaster2 raster = (raster_ds as IRasterDataset3).CreateFullRaster() as IRaster2;

Is there some other way I should be handling this TIFF? Surely if the ArcMap application can open this Tiff, I should also be able to open it in C#.

I am using ArcMap 10.5 and Windows 10.

  • I hate to sound like ESRI support, but you should test this problem in the current version of ArcMap 10.6.1 -- not interested in the bounty unless this fixes it. – JasonInVegas Oct 17 '19 at 21:05
  • I have no control over the version of Arc available – danielm Oct 18 '19 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.