Converting Esri grid/ascii grid to .bgd

Nov 30, 2010 at 1:59 PM

I am relativly new to dotspatial and am looking to migrate away from arcobjects.  My current application utilizes multiple esri grid rasters, my question (which may have been answered somwhere, however I have yet to find it) how does one convert from an esri grid to a .bgd binary file?

Thanks in advance

J.

Developer
Nov 30, 2010 at 6:31 PM
You don't really need to convert it to view it, just open the sta.adf file in the grid folder. To do conversion you can do
Raster r = new Raster;
r.Open(...name\sta.adf);
r.SaveAs(...name.bgd);

Ted (on droid)

jsp5568 <notifications@codeplex.com> wrote:

>From: jsp5568
>
>I am relativly new to dotspatial and am looking to migrate away from arcobjects. My current application utilizes multiple esri grid rasters, my question (which may have been answered somwhere, however I have yet to find it) how does one convert from an esri grid to a .bgd binary file?Thanks in advanceJ.
>
>
Dec 1, 2010 at 1:47 PM

Ted,

Thanks for the quick response I tried to open the the raster using the method described above however I received an exception telling me the "file type is not supported". Am I missing something? Below is the portion of my code that deals with opening rasters.

  Private _rasterDataset As Raster = Nothing
.
.
.

 Case "raster"
                    '
                    ' test for exists
                    isOk = System.IO.Directory.Exists(System.IO.Path.Combine(_mapLayerPath, DatasetDiskName))
                    ' test result
                    If Not isOk Then Return False

                    _rasterDataset = New Raster()
                    _rasterDataset.Open(Path.Combine(_mapLayerPath, DatasetDiskName & "\sta.adf"))
  
.
.
.
End select  

                              
Thanks J.
Developer
Dec 1, 2010 at 4:22 PM

I am away at a conference, and so won't be able to do anything now, but try using the DemoMap project to browse to the file directory and try finding the file with that and see if you can open it.  If so then we are in business and we just need to figure out what is wrong in your case.  If not, then could you please zip up either that raster or a small one of the same type, and post a new issue along with the dataset that doesn't work?  Remember, if you are designing your own project, you will need to drag and drop an "AppManager" onto your project, and then copy the GDAL folder into the "Data  Extensions" path before you will be able to open most image and raster formats.

Ted

Dec 2, 2010 at 3:49 PM

Ted,

Thanks again for your help. I tried opening the dataset with Demomap and received an exception so I posted it to issue tracker. My next question is in reference to using the AppManager and copying the gdal folder. I am unfamiliar with the process of including a data extension library within my project. Could you point me to some advantages/disadvantages to this method rather than just including the gdal dll as a reference. Could you also supply the proper procedure of adding a data extension library, or is it just copying it into the debug directory.

Thanks

J.

Developer
Dec 2, 2010 at 6:33 PM

Just having the files copied and dragging an appmanager on your form is enough. Gdal is not .net, and separate versions are needed for every platform and operating system while the .net code is portable with mono without having separate stuff. As an extension it represents functionality that can be built and packaged independently, or replaced with a different data provider library without requiring a recomplile. Mono cannot transate gdal would be the short answer.

On Dec 2, 2010 8:50 AM, "jsp5568" <notifications@codeplex.com> wrote:
> From: jsp5568
>
> Ted,Thanks again for your help. I tried opening the dataset with Demomap and received an exception so I posted it to issue tracker. My next question is in reference to using the AppManager and copying the gdal folder. I am unfamiliar with the process of including a data extension library within my project. Could you point me to some advantages/disadvantages to this method rather than just including the gdal dll as a reference. Could you also supply the proper procedure of adding a data extension library, or is it just copying it into the debug directory.ThanksJ.
>
>

Dec 14, 2010 at 5:13 PM

I was wondering if any progress has been made on this issue? As I have mentioned previously I rely heavily on rasters/ raster operations in my applications, and was excited when I found out about Dotspatial and the potential Dotspatial can play in my application. My colleague and I are willing to help with the development of core raster analysis operations, however we need to be able to open a raster file before we can begin.

 Thanks in advance,

J

Coordinator
Dec 15, 2010 at 6:44 PM
This is a good question. We actually are quickly getting to a point where we are going to need solid raster support in HydroDesktop. I've seen various discussions about the GDAL data provider plugin. JSP, are you not able to get it to work? I personally haven't tried it yet. - Dan

On Tue, Dec 14, 2010 at 11:13 AM, jsp5568 <notifications@codeplex.com> wrote:

From: jsp5568

I was wondering if any progress has been made on this issue? As I have mentioned previously I rely heavily on rasters/ raster operations in my applications, and was excited when I found out about Dotspatial and the potential Dotspatial can play in my application. My colleague and I are willing to help with the development of core raster analysis operations, however we need to be able to open a raster file before we can begin.

Thanks in advance,

J

Read the full discussion online.

To add a post to this discussion, reply to this email (DotSpatial@discussions.codeplex.com)

To start a new discussion for this project, email DotSpatial@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com




--
Daniel P. Ames, Ph.D. PE
Associate Professor, Geosciences
Idaho State University - Idaho Falls
amesdani@isu.edu
geology.isu.edu
www.mapwindow.org


Developer
Dec 20, 2010 at 9:38 AM

Just for continuity this thread resulted in work item 181 - yeah?

Dec 21, 2010 at 11:37 AM

Yes, this thread resulted in work item 181