Skip to Content.

mget-help - RE: [mget-help] Error with Predict Random Forest from Rasters: could not find function "open.SpatialGDAL"

Please Wait...

Subject: Marine Geospatial Ecology Tools (MGET) help

Text archives


RE: [mget-help] Error with Predict Random Forest from Rasters: could not find function "open.SpatialGDAL"


Chronological Thread 
  • From: Jason Roberts <>
  • To: "" <>
  • Cc: "" <>
  • Subject: RE: [mget-help] Error with Predict Random Forest from Rasters: could not find function "open.SpatialGDAL"
  • Date: Mon, 7 Nov 2016 16:45:14 +0000
  • Accept-language: en-US
  • Authentication-results: spf=none (sender IP is ) ;
  • Spamdiagnosticmetadata: NSPM
  • Spamdiagnosticoutput: 1:99

Hi Marc,

This error occurs when MGET tries to use R to call the function
open.SpatialGDAL, which is part of the rgdal package in R. MGET uses rgdal to
read predictor rasters directly from R, where the prediction is carried out.

It sounds like there is a problem with the rgdal package. When MGET runs a
tool that needs it, MGET tried to detect if it is missing and, if so, to
install it. My recommendation is to check to see if it is installed. If it
is, uninstall it and try the tool again, allowing the tool to install it
again. To do this:

1. Close all ArcGIS and R programs.

2. Click your Windows Start button. Press the R key. Windows should search
for programs and documents starting with R. You should see "R i386 X.Y.Z"
where X.Y.Z is your R version number. Click on that program.

3. The R Console (32-bit) starts up. Type the following into the R Console
and press enter:

rownames(installed.packages())

4. Look for the "rgdal" package. If you do not find it, stop here and let me
know. If you do find it, type the following and press Enter to uninstall it:

remove.packages("rgdal")

it should say something like:

Removing package from 'C:/Users/Jason/Documents/R/win-library/3.3'
(as 'lib' is unspecified)

With no error messages.

5. Close the R console and try MGET again. MGET should install the package
again, and it should hopefully work this time.

Best,

Jason

-----Original Message-----
From:
[] On Behalf Of
Sent: Monday, November 7, 2016 11:20 AM
To:
Subject: [mget-help] Error with Predict Random Forest from Rasters: could not
find function "open.SpatialGDAL"

Hi,

When running the Predict Random Forest From Rasters tool I get the following
error message:

Traceback (most recent call last):
File "C:\Program Files\GeoEco\ArcGISToolbox\Scripts
\RandomForestModelPredictFromArcGISRasters.py", line 5, in <module>
ExecuteMethodFromCommandLineAsArcGISTool('GeoEco.Statistics.Modeling',
'RandomForestModel', 'PredictFromArcGISRasters')
File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\ArcGISScripts.py",
line 210, in ExecuteMethodFromCommandLineAsArcGISTool
exec sourceCode in globals(), locals()
File "<string>", line 1, in <module>
File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\Statistics
\Modeling.py", line 776, in PredictFromArcGISRasters
_PredictFromArcGISRasters('randomForest', _(u'Fit Random Forest Model'),
inputModelFile, outputResponseRaster, cutoff, constantPredictors,
predictorRasters, templateRaster, ignoreOutOfRangeValues, None, buildPyramids,
overwriteExisting)
File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\Statistics
\Modeling.py", line 1702, in _PredictFromArcGISRasters
r('PredictModelForArcGISRasters(model, modelMetadata,
rastersForPredictors, constantsForPredictors, "%s",
ignoreOutOfRangeValues=%s, cutoff=%s)' % (tempResponseFile.replace('\\',
'\\\\'), str(ignoreOutOfRangeValues).upper(), cutoff))
File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\R.py", line 1084, in
__call__
value = self._Object(str(statements))
File "C:\Python27\ArcGIS10.3\lib\site-packages\GeoEco\AssimilatedModules\rpy
\rpy.py", line 339, in __call__
return self.eval(self.parse(text=s))
RPy_RException: Error in PredictModelForArcGISRasters(model, modelMetadata,
rastersForPredictors, :
could not find function "open.SpatialGDAL"

Tried running directly from ArcCatalog and received the same error.

Huge thanks in advance,
Marc



Archive powered by MHonArc 2.6.19.

Top of Page