ThinkGeo.com    |     Blog    |     Wiki    |     Support

Need help with GdalRasterLayer for ERDAS IMAGINE layer

We use ThinkGeo MapSuite Desktop for Winforms in our application. I have a new requirement to process an ERDAS Imagine (.IMG/.IGE) file to retrieve data points. We are using the USGS NLCD (National Land Cover Database) data to get the “land use and land cover” values. These values are encoded on the ERDAS IMAGINE file as numeric values for points on the map. I have defined a layer as a GdalRasterLayer and opened the file and I have tried to use the ImageSource from the layer. But I can’t seem to find the way to access the values for the points in the image. Can anyone give me quidance for accessing this type of data. I am hoping for a simple example to show me how to access the data.
Thank you for any help you can give me.
Rstyer

Hi Rstyer,

Our currently GdalRasterLayer don’t have related API to read the value of point in the image.

This layer only read image and draw it on canvas, you can try to override the GetImageCore of GdalRasterSource, then get the color of target point, and try to calculate its value. But I don’t think it’s the accurate value of this point.

In fact in our coming 11 version, we have better support for Gdal, maybe we will have related API to read valud from source.

Regards,

Ethan

Ethan

Thanks for the response. I am working on some code to drop down and use the OSGeo.GDAL libraries to Open the “.IMG” as a dataset and the use a method on the dataset to GetRasterBand. I am not sure if this will work but it seems possible. The GDAL libraries seem to have support for this.

Thanks again

RStyer

Hi Rstyer,

I think you can try it, you can render the data by our layer, and call GDAL api to get the value of target point.

If you have any problem we can helpful please let us know.

Regards,

Ethan