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

working with raster data example

Topics: Data Access
Jun 7, 2007 at 11:53 AM
Can somebody provide me example code working with raster data

ex Microsoft Windows Device Independent Bitmap (.bmp)*
Jun 19, 2007 at 8:12 AM
To use raster data, you need to use the GDAL extension. You can find info on the GDAL Raster Layer page.

I don't know of any way a bitmap can be used as a raster data source.
Jul 18, 2007 at 12:22 PM
I was able to get some stuff working. I had to copy *.dll from C:\Program Files\FWTools1,3,4 into the bin folder of my test application, and then I could execute the following statement:

SharpMap.Layers.GdalRasterLayer layGdal = new SharpMap.Layers.GdalRasterLayer(layerName, connectionInfo);

where connectionInfo is the filename of a supported raster format. I tried both .sid and .jp2. The GDALRaster Preview method through an exception when I added the layer to a map, but if I stepped by it, it drew a blank map. Then I tried reading the file again, in the same session and it worked. I have not explored why it fails the first time it is being called. Probabably because the map zoom extents are not yet set or something like that.

Not sure if this is the info you were looking for.
Jul 18, 2007 at 3:07 PM
Hi thanks for help .But I cant compile
SharpMap.Layers.GdalRasterLayer layGdal = new SharpMap.Layers.GdalRasterLayer(layerName, connectionInfo);
in my machine.
No dll directly in C:\Program Files\FWTools1,3,4 folder . But there are dll inside. I copied all. But it say invalid reference. Can you tell me what is sharp map version you are using or please
Jul 18, 2007 at 4:25 PM
I downloaded the latest source code zip file (jun 27 or something like that). I opened the SharpMap.sln file in the Trunk folder, which brought in SharpMap and SharpMap.Extensions and items in the external references folder.

You are correct on their being no *.dll's in that folder... they were in the underlying bin folder. I copied them into the WinDemo\Bin\Debug folder. And, it pretty much just worked.
Jul 20, 2007 at 2:24 PM
Thanks Magnum . I got the point . Now it is working.
Also I have problem regarding Image quality. Do u know anyway to improve this?