Cannot load GDAL Raster Files

Nov 9, 2011 at 8:10 PM
I have just followed the tutorial 9 to add a GDAL raster file (I am actually trying to load a GeoTIFF). However, after following all the steps, there are no GDAL Raster files in the file type filter when I call the AddRasterLayer() method. If I select 'All Files' so that I can at least choose my GeoTIFF I get an exception 'Object reference not set to an instance of an object'. I assume this exception is because is doesn't know what to do with the geotiff as the GDAL extensions are not loaded. I have copied the 'Data Extensions' folder into the Debug folder. Is there something else I need to do? (I am using VS 2010). Thanks, Andy
Nov 10, 2011 at 11:48 AM

The way I solved this problem is the following: In the solution explorer tab you select view all files. There you will see all the folders. From there you copy the data extensions folder to the bin debug folder.

It should work.

Nov 10, 2011 at 1:18 PM

Thanks for your reply, however it did not solve the problem.

Do I need to add a reference to cause the DLLs to be loaded?

Nov 10, 2011 at 6:33 PM

You need to reference only the dot spatial dlls and not the gdal. By the way, did you bind the application manager, the map,legend and spatialtoolstrip all together?

Nov 10, 2011 at 6:53 PM
OK, I will only reference the DotSpatial.

I have bound the Application Manager to my Map, however my application
doesn't have a legend or spacialtoolstrip. Does it need to have these
to be able to load GDAL rasters?

Thanks,

Andy

On 10/11/2011 2:33 PM, nikchan wrote:
> You need to reference only the dot spatial dlls and not the gdal. By the way, did you bind the application manager, the map,legend and spatialtoolstrip all together?
Nov 10, 2011 at 7:05 PM
Edited Nov 10, 2011 at 7:11 PM

I do not know about spatial tool strip but definitely bind appmanager with the map.

Have you tried to export any layer as a tiff? Do you get all the bands or only black? do you know which version is the gdal in the latest release???

Developer
Nov 10, 2011 at 8:10 PM

You'll also want to call appmanager.LoadExtensions(); so that GDAL is loaded.

Nov 10, 2011 at 9:59 PM
Aha! I've not tried that yet. I'll give that a go on monday. Thanks!

On 10/11/2011, mudnug <notifications@codeplex.com> wrote:
> From: mudnug
>
> You'll also want to call appmanager.LoadExtensions(); so that GDAL is
> loaded.
>
>

--
Sent from my mobile device

Email: [email removed] BlackBerry PIN: 223B436E BlackBerry #:
+1-613-617-6530 Home: +1-613-493-0087
Nov 11, 2011 at 12:50 AM

I do not think that latest version loads gdal plugins. I just gave it a try. andycoder possibly you are correct. In case you manage this, please inform me.

Developer
Nov 16, 2011 at 10:20 PM

It looks like the latest version was broken in this regard. I'll be uploading a fix and RC2 momentarily.

Nov 17, 2011 at 1:42 AM
Great thanks!

On 16/11/2011 6:20 PM, mudnug wrote:
> From: mudnug
>
> It looks like the latest version was broken in this regard. I'll be uploading a fix and RC2 momentarily.
>
>
Nov 17, 2011 at 6:12 PM

Thanks a lot!! It does work!!! Great news!!