ThinkGeo.com    |     Documentation    |     Premium Support

GeoTiff DEM Layer not loading

Hi,

I’ve got a tif format DEM file and I’m trying to read it, but it fails using Map Suite. I’ve loaded the file into ArcMap and GlobalMapper and it displays fine in those programs.

Here’s the basic code. I get an error at the open statement.

        GdalRasterLayer gr = new GdalRasterLayer(@"..\..\Data\TestDem.tif");

        gr.Open();

Here’s the stack trace:

at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at ThinkGeo.MapSuite.Core.FdoRasterSource.OpenCore()
at ThinkGeo.MapSuite.Core.RasterSource.Open()
at ThinkGeo.MapSuite.Core.RasterLayer.OpenCore()
at ThinkGeo.MapSuite.Core.Layer.Open()
at DEMImage.Form1.button1_Click(Object sender, EventArgs e) …

I’ve seen some posts where this is supposed to work and it says it’s supported in the formats notes.

Here’s the example file:

TestDem.zip (121.0 KB)

Please would be really good to make this work. Also, I need to know how to access the pixel elevation values if you manage to make it work.

Thanks,
Damian

Hi Damian,

It looks we cannot reproduce that, we hadn’t met exception when open the file.

But it looks we also cannot render this format succeed, I asked our developer, it looks this format hadn’t been supported by our map now.

Regards,

Don

This seems like a recurring request in the community for a number of years. Any ideas if/when it will be supported?

If not, would appreciate your advice on what libraries can support reading it so I can create a translator to GridFeatureLayer type.

Regards,
Damian

Hi Damian,

It looks we don’t have an existing plan to support this special format of TIF.

For you question, our developer think the GDAL library may be helpful. And you can look for some 3rd part utilities to help on data conversion, we don’t have related experience so we cannot list some names here. If the utilities can help you convert your data to other formats for example JPEG2000, you can try to render the new data again.

In fact we have a little confused, it looks our GridFeatureLayer class is work for render grid file, which mainly used when draw ISOLine on map, could you please let us know why you mentioned that here?

Regards,

Don

Hi Don,

DEM = Digital Elevation Map

Many people have asked about how to attain the elevations from such files in your blog. Elevations can be used in all sorts of GIS applications and calculations. It is actually a huge issue for many people and I am really disappointed to hear you don’t plan to support elevations in raster formats. I’m also equally concerned that you couldn’t read the image at all. It is a Tiff format and GeoRasterLayer should have been able to read it even if it couldn’t see the elevations. The file attributes include the datum, projection and world coordinates in order to display the image properly.

I mention GridFeatureLayer because it can be queried by location as with map mouse coordinates or polygon selection. The resultant query can then be used in calculations, etc. I figured that if you don’t support this feature directly since it’s an FDO library, that I would at least be able to get the values and coerce them into a GridFeatureLayer.

See attached example output of what the image I provided should look like.

Regards,
Damian

Hi Damian,

Thanks for your suggestion.

We support TIFF format via some 3rd part library, I guess that’s why we cannot support some special type of TIFF, because which is also not be supported by the 3rd part library. But I have let our developer know your requirement, I think they will do more research or have a plan on that.

And some APIs like ColorMappings maybe useful for your scenario, one of our user who render the colorful raster layer by this API when we don’t support directly read its inner color information. please refer this link as below: Raster image Coloring

Wish that’s helpful.

Regards,

Don