This project is read-only.

GDAL Data Extension Load Problem

Nov 22, 2011 at 4:48 PM

Hi All,

I was using an old version of Dotspatial and I was succesfully loading all GDAL files. Today, I downloaded current version of Dotspatial. However it gave "Specified File Type is not supported" exception with the new libraries. I think it can not load GDAL Data Extensions, but I do not know why. ApplicationManager is included in my application ? Did something change or any one knowing about this ?

Nov 22, 2011 at 5:06 PM

 

Dear friends, i cant load more than four jpg images or one big ecw image because i obtain a memory exception.

Hoy can i do it?

I follow all step for load gdal files but i cannot get it.

Anyone can help me? Since i hear about load gdal images in dotspatial apps i cannot get any result.

If anyone can creaste a tutorial for it, i'll great so much.

Thanks in advanced.

Francisco J.

Nov 23, 2011 at 2:21 AM

I've posted an article to http://wp.me/pvy5A-1X

Nov 24, 2011 at 1:02 PM

Dear mudnug,

I read your article and I follow the steps but i cannot get any raster loaded (more of 4 images or ecw images between others).

I get the following error:



Do you help me with this error?

Thanks in advanced.

Francisco J.

Nov 28, 2011 at 11:09 PM

Are you able to post a link to one of the rasters?

Nov 29, 2011 at 11:16 AM

I've had the same problems.

The reason was the GDAL Plugin which tries to create a byte array (width * height). If the picture is very large (in my case 19092 * 26730) allocating a byte array with this size fails. My solution is a custom GDAL Provider which is loading the needed image parts directly into a Bitmap object which has a resolution equal to the viewing rectangle. And to speed the GDAL based file reading up, i use GDAL scripts to create tiles and overview images.

Nov 29, 2011 at 12:09 PM

Dear Kanegou,

Did your solution increase map load performance ?

 

Dec 6, 2011 at 10:42 AM
barisk wrote:

Hi All,

I was using an old version of Dotspatial and I was succesfully loading all GDAL files. Today, I downloaded current version of Dotspatial. However it gave "Specified File Type is not supported" exception with the new libraries. I think it can not load GDAL Data Extensions, but I do not know why. ApplicationManager is included in my application ? Did something change or any one knowing about this ?

Hello,

 

is the issue resorted.

i am having the same problem. GDAL plugins not loading

Dec 6, 2011 at 11:34 PM

Be sure to unblock your download.

I've posted an article to http://wp.me/pvy5A-1X

Mar 8, 2012 at 3:56 PM

Hi mudnug,

I've followed your tutorial but I cannot load the GDAL library, an error appears in the form.designer:

this.appManager1.CompositionContainer = null;

'System.ComponentModel.Composition.Hosting.CompositionContainer' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.ComponentModel.Composition, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.

Can you help me? Thanks.

Joan

Mar 8, 2012 at 8:48 PM
Edited Mar 8, 2012 at 8:49 PM

Do you have .Net 4 and Visual Studio 2010?

It looks like a reference to System.ComponentModel.Composition needs to be added to your project.

Mar 8, 2012 at 11:37 PM
Edited Mar 8, 2012 at 11:38 PM

Joan,

Since I installed the latest version of DS, sometimes it happens to me too (I am using .NET 4 and VS2010).

I just comment this line and it works...

// this.appManager1.CompositionContainer = null;

Mar 9, 2012 at 12:33 PM

I tried again and it works. Thanks!!

Joan

Aug 16, 2012 at 7:15 AM

I can see and load the GDAL extensions  (specifcally ecw) in the IDE (VS 2010)  but when I publish ("one-click publish") and run the exe the extensions are not available.  What do I have to do to get the Extensions packaged with the rest of the code?

 

David

Aug 16, 2012 at 6:58 PM

Look at the MapWindow 6 project for an example.

It does two things

1) Add them (as links) to a folder that will be included with ClickOnce

2) (For others like the Ribbon) download them when needed (on the first run). That code is in the Extension Manager.

Aug 17, 2012 at 4:37 AM

In the MapWindow6 example (6.1.5) there is a folder called Application Extensions which contains a set of DotSpatial.Plugins dlls.  So, following the example,  I set up two folders named Application Extensions/GDAL and Plugins.  To Application Extensions/GDAL I added the GDAL dlls and in Plugins I added the other plugin dlls, including the ExtensionManager.dll).

In my control contstructor I have

        //constructor
        public MapDisplay()
        {
            InitializeComponent();

            DotSpatial.Controls.AppManager appManager1 = new AppManager();

            appManager1.Directories = new List<string> { "Application Extensions", "Plugins" };

            appManager1.LoadExtensions();

            _basicMap = map1;
        }

But when I publish, I still cannot see the GDAL extensions when I run the exe. It is the same behaviour I see in the IDE if I remove the Plugins or DataExtensions folder from my /Debug/bin folder.

Aug 17, 2012 at 4:18 PM

It sounds like your project isn't set up properly. Follow the example carefully and set the Build Action on the dlls to Content.

You can verify these will publish by going to your Project Properties, Clicking the Publish tab and The Application Files button.

 

Obviously, if they are not published, they won't be loaded.

Aug 19, 2012 at 12:29 AM

Thanks, mudnug. My problem is obviously my limited knowledge of VS and nothing to do with DS.  I sorted it by dragging the Plugins\GDAL folder into the project and then publishing. The installed app on the client could then see the ecw extensions. Note that this did not work in the IDE. To see the extensions while running (debugging) in VS, I still had to have the Plugins\GDAL folder under bin\Debug as per your tutorial.

Aug 19, 2012 at 12:00 PM

In response to 'Joandc' : I had that problem too, when I finally tracked it down it was because my app target was .NET4 client profile.  Once I changed it to full .NET4 everything was fine.

 

 

Aug 24, 2012 at 6:42 PM

System.ComponentModel.Composition is included in the client profile. See http://msdn.microsoft.com/en-us/library/ff462634.aspx