This project has moved and is read-only. For the latest updates, please go here.

GRID ASC file using GdalRasterLayer class

Sep 19, 2013 at 4:31 PM
I'm trying to load an asc file using GdalRasterLayer class, but I have an error and the image doesn't come into the map.
Actually I tried the example called WinFormSamples, that I found in the source code and debugging GdalSample.cs I find that the problem at line n. 1085:
var color = colorBlend.GetColor(Convert.ToSingle(imageVal));

because colorblend is null.
Is there anybody who can help me? or at least who can tell me how to use GdalRasterLayer for loading an asc file with a plette of colors.
thanks in advance
Sep 19, 2013 at 7:12 PM
You need to wrap your asc grid file in a virutal raster, like this.
See more about virtual raster here.
Hth FObermaier
Sep 20, 2013 at 8:25 AM
Hi FObermaier,
thanks a lot for your prompt feedback.
I didn't know nothing about VRT, so now I'll try it out.
thank you again.