fabpuddu

RasterConversionOpClass ToRasterDataset into Memory

Discussion created by fabpuddu on Jan 26, 2011
Latest reply on Oct 26, 2011 by miguelsouto
Hi,

Is possible to use ToRasterDataset with workspace into memory ?


        Dim pTransformationOp As ITransformationOp = New ESRI.ArcGIS.GeoAnalyst.RasterTransformationOp
        Dim pWSF As IWorkspaceFactory = New InMemoryWorkspaceFactory
        Dim pWS As IWorkspace = Nothing
        Dim pWorkSpaceName As IWorkspaceName
        Dim pName As IName
        Dim pGeoDS As IGeoDataset = Nothing
        Dim rasterWorkspaceFactory As New RasterWorkspaceFactoryClass()
        Dim rasterWorkspace As IWorkspace = Nothing
        Dim rasterConversionOp As New RasterConversionOpClass()
        Dim pRasterEnv As IRasterAnalysisEnvironment = Nothing
        Dim pEnvelopeClip As IEnvelope = Nothing

            pEnvelopeClip = IncreseEnvelope(pPolygon.Envelope, iPercentageIncreseAreaClip)
            pRasterEnv = CType(pTransformationOp, IRasterAnalysisEnvironment)
            pRasterEnv.SetExtent(esriRasterEnvSettingEnum.esriRasterEnvValue, pEnvelopeClip)

            pTransformationOp = pRasterEnv
            pGeoDS = pTransformationOp.Clip(pRasterTerrainSurface, pEnvelopeClip)

            pWorkSpaceName = pWSF.Create("", cFileNameSurfaceAreaClip, Nothing, 0)
            pName = TryCast(pWorkSpaceName, IName)
            pWS = TryCast(pName.Open, IWorkspace)

            ClipLayerSurfaceOnAOI = rasterConversionOp.ToRasterDataset(pGeoDS, "TIFF", pWS, cFileNameSurfaceAreaClip)



thanks at all

fabrizio

Outcomes