Problem when I work whit FGDB raster (no whit Folder raster) why?

409
2
05-30-2013 02:46 AM
martinmaretta
Occasional Contributor
Hi i have one problem. I using  code like this:

            Dim pOutputRaster As IRaster
            pOutputRaster = pReclass.Reclass(pLandCover, pReclassTable, "ID", "ID", "MANNING", True)
            pMapAlgebraOp.BindRaster(pOutputRaster, "Mann")
            pOutputRaster = pMapAlgebraOp.Execute("FLOAT([Mann]) / 100.0")
            pMapAlgebraOp.UnbindRaster("Mann")

And when i use raster from Folder everything is OK, BUT whe i Use rasters from FGDB - reclass is running fine, and  i create pOutputRaster (I see it in my TEMP directory). But when i use pMapAlgebraOP.execute  i have error "_message = "ERROR 010316: Unable to open the input raster: C:\USERS\MATTKO\APPDATA\LOCAL\TEMP\ITEMP\G_G402 ERROR 010067: Error in executing grid expression." and my raster is disapear from  TEMP directory.
Do anybody know what´s the problem??  thank a lot.
0 Kudos
2 Replies
DuncanHornby
MVP Frequent Contributor
Martin,

The field deliminters in a file geodatabase are " and not [.

So I'm guessing your line pOutputRaster = pMapAlgebraOp.Execute("FLOAT([Mann]) / 100.0") should become


Dim sQuery as String
sQuery = "FLOAT(" & chr(34) & "Mann" & chr(34) & ") / 100.0"
pOutputRaster = pMapAlgebraOp.Execute(sQuery)


On a side note you can determine the deliminiter using ISQLSyntax Interface.

Duncan
0 Kudos
martinmaretta
Occasional Contributor
Thanks for response, but syntax is OK. this is Raster map algebra syntax no field calculator (or Query) syntax. But i found very strange behaviour of FGDB raster in mapAlgebra.
1) when i use directly FGDB raster to mapAlgebra and then other opration (except MapAlgebra) it runs OK.
Dim pOutputRaster As IRaster
pMapAlgebraOp.BindRaster(pFGDBRaster, "Mann")
pOutputRaster = pMapAlgebraOp.Execute("FLOAT([Mann]) / 100.0")
pMapAlgebraOp.UnbindRaster("Mann")
pOutputRaster = pReclass.Reclass(pOutputRaster , pReclassTable, "ID", "ID", "MANNING", True)


2) when i use FGDB raster first to other operation and then to MapAlgebra it runs whit ERROR
Dim pOutputRaster As IRaster
pOutputRaster = pReclass.Reclass(pFGDBRaster, pReclassTable, "ID", "ID", "MANNING", True)
pMapAlgebraOp.BindRaster(pOutputRaster , "Mann")
pOutputRaster = pMapAlgebraOp.Execute("FLOAT([Mann]) / 100.0")
pMapAlgebraOp.UnbindRaster("Mann")

3) when i use FGDB raster first to other operation then another one except MapAlgebra and then to MapAlgebra it runsOK
Dim pOutputRaster As IRaster
pOutputRaster = pReclass.Reclass(pFGDBRaster, pReclassTable, "ID", "ID", "MANNING", True)
Dim pMapOp As IMathOp
pMapOp = New RasterMathOps
pOutputRaster = pMapOp.Float(pOutputRaster )
pMapAlgebraOp.BindRaster(pOutputRaster , "Mann")
pOutputRaster = pMapAlgebraOp.Execute("FLOAT([Mann]) / 100.0")
pMapAlgebraOp.UnbindRaster("Mann")

4) when i use FGDB raster first to other operation then save this raster to disk and then use it in MapAlgebra it run OK
0 Kudos