0

Can someone please provide an example to show how this would work.

For example, I am trying to convert from .GRD to .ASC, would my MapBasic code look like this:

public void Convert(string "C:\Users\file1.grd", string "C:\Users\Converted", string ESRI ASCII and Float grids)
{
    RasterProcessing.Convert(string "C:\Users\file1.grd", string "C:\Users\Converted", ESRI ASCII and Float grids);
}

Clearly I am doing something wrong here as I get unrecognized command error from MapInfo.

Could someone please explain how to rectify this.

I have looked at a similar post here: mapbasic convert raster to mrr

but was not able to find success. I tried the manual too and I wasnt sure how to address the parameters.

Edit:

I am really new to coding in general. I was under the impression that this code needed to be input into the MapBasic window to run. I tried editing the code to something like this but it failed:

Dim strInFilePath as string
strInFilePath = "C:\New folder\trial.grd"
Dim strOutFilePath as string
strOutFilePath = strInFilePath
Dim strDriver as string
strDriver = "ESRI ASCII and Float grids (*.asc)"

public void Convert(strInFilePath, strOutFilePath, strDriver)
{
RasterProcessing.Convert(strInFilePath, strOutFilePath, strDriver)
}
  • Based on the link you shared it looks like you should be using .NET to do this (either C# or VB) rather than MapBasic. – T_Bacon Apr 16 '18 at 7:28
  • Hi, I changed my code, I was under the impression that this code needed to be put into the MapBasic window? How do I launch raster processing codes? Sorry I am very new to all this and any guidance is appreciated :) – MapInfoNewbie Apr 18 '18 at 1:39
  • If you follow the link you posted, the accepted answer explains where you can find example code along with the documentation. I would start there if I was you. I'm fairly certain you will need to compile your code so it won't be able to be run directly from the MapBasic window anyway. – T_Bacon Apr 18 '18 at 7:23
  • Alright I will try my best, thanks. Will post up a solution here if I figure it out. – MapInfoNewbie Apr 23 '18 at 4:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.