AnsweredAssumed Answered

Intersecting raster with geometry polygon

Question asked by juvestruga2 on Dec 1, 2017
Latest reply on Dec 5, 2017 by Hornbydd

Guys, i want all values of pixels of a raster using intersect on a geometry polygon, like spatialfilter...the language is c#.


//Open raster

 string inputWorkspace = @"C:\BASE\GDB.gdb";
 string inputDatasetName = "MDT_5M";

 Type factoryType = Type.GetTypeFromProgID("esriDataSourcesGDB.FileGDBWorkspaceFactory");
 IWorkspaceFactory workspaceFactory = (IWorkspaceFactory)Activator.CreateInstance(factoryType);
 IWorkspace workspace = workspaceFactory.OpenFromFile(inputWorkspace, 0);
 IRasterWorkspaceEx rasterWorkspace = (IRasterWorkspaceEx)workspace;

 IRasterDataset myRasterDataset = rasterWorkspace.OpenRasterDataset(inputDatasetName);
 IRaster pRaster = myRasterDataset.CreateDefaultRaster();