Skip to Content.

mget-help - RE: [mget-help] Problem at predicting GAM from rasters

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


From: "Jason Roberts" <>
To: '葉志慧' <>
Cc: <>
Subject: RE: [mget-help] Problem at predicting GAM from rasters
Date: Thu, 21 Apr 2011 10:31:43 -0400

Hi Ivy,

 

Unfortunately my idea will not work. I checked with the R team and apparently even the latest version of rgdal is built using GDAL 1.7.2, so upgrading R will not solve this problem anyway.

 

I do have another suggestion on how to work around this problem. After looking at the MGET code more carefully, I realized that my analysis of the problem was not quite correct. I said that MGET was creating temporary files in .img format. That is wrong. It is creating temporary files in ArcInfo Binary Grid format. Because the GDAL bug specifically concerns .img files, I am now guessing that one of your input rasters is in .img format and it is not being reprojected by the tool because it has the correct projection, extent, and cell size already. The tool is providing that .img raster directly to R, which rgdal is then failing to read. Does that sound right? If you sent me the full output of the tool, I could confirm this analysis.

 

If it is correct, then you can work around the problem by copying your rasters to a different format before providing them to Predict GAM From Rasters. You can use the Copy Raster tool that comes with ArcGIS. For the output raster, give a name that does not have any file extension. This will create a raster in ArcInfo Binary Grid format. Be sure the name is no longer than 13 characters. Also, it cannot start with a number, and it must only contain letters, numbers, and the underscore character (_). After copying all your rasters to ArcInfo Binary Grid format, try Predict GAM From Rasters again and see if it works.

 

Hopefully the R team will soon start building rgdal with a later version of GDAL. GDAL 1.8.0 was released earlier this year; hopefully they will use that.

 

Jason

 

From: 葉志慧 [mailto:]
Sent: Thursday, April 21, 2011 5:14 AM
To: Jason Roberts
Cc:
Subject: Re: [mget-help] Problem at predicting GAM from rasters

 

Hello Jason,

Thanks for the prompt reply :)

and yes, I use R 2.12.0, and the rgdal package was installed during executing predict GAM from rasters.

So I think I need further instruction from you.

 

Thank again!

Best regards,

Ivy  

 

2011/4/20 Jason Roberts <>

Hi Ivy,

 

Im sorry youre seeing that problem. I have not seen it before but I believe I know what is happening.

 

Predict GAM From Rasters checks the input rasters to make sure they all have a consistent coordinate system, cell size, and extent. If they do not, it creates temporary versions that are consistent. Those temporary versions are in .img format (ERDAS Imagine format). Then Predict GAM From Rasters tool uses an R package called rgdal to read the rasters into R so that the GAM prediction can be done. rgdal itself uses software called GDAL to perform the low-level read operations. A bug was recently discovered in GDAL that caused it to fail to read .img files produced by ArcGIS and report the message you describe. See here. Im fairly certain that is the problem.

 

The solution to this is to update the rgdal package so it is using a newer version of GDAL. The simplest way to do that is to upgrade your version of R:

 

1.    Close all ArcGIS programs.

2.    Uninstall your existing version of R.

3.    Install a newer version of R. Please note that MGET is compatible with R 2.12.0 and earlier versions, but not later versions (2.12.1, 2.12.2, 2.13.0). I recommend you install R 2.12.0. On the R CRAN website, you will have to look carefully to find version 2.12.0.

 

If you already have R 2.12.0 or do not want to upgrade your current version of R, there is a more complicated way to do it. If you prefer that, let me know and Ill give the instructions for that.

 

Best regards,

 

Jason

 

From: 葉志慧 [mailto:]
Sent: Wednesday, April 20, 2011 10:14 AM
To:
Subject: [mget-help] Problem at predicting GAM from rasters

 

Hello, 

Thank you for developing such a useful tool!

However, I've met a problem when predicting GAM from rasters.

Here's the error information: 

 

Obtaining additional debugging information. This may cause this tool to hang. If you do not see any additional messages after one minute, halt its execution.

<class 'rpy.RPy_RException'>: error in .local(.Object, ...) : 

            GDAL Error 1: Unknown base item type : 4

 

Failed to execute (GAMPredictFromArcGISRasters).

 

The coordinate system and cell size for each raster was checked previously by the software,

so I had no idea how to fix this problem.

 

In addition,  I use version 0.8a19.

Thanks for your kindly help!!

 

Best regards, 

Ivy

 

 

< date >
< thread >
Archives powered by MHonArc.
Top of Page