I have been stumped on this one all day and am hoping for your insight.
I have a VB Script that calls the iExtractionOp.ExtractValuesToPoints
When running, I experience an "Error 010092: Invalid Output Extent".
Research on this error indicates that there may be an issue with the input extents matching up (ie. that the Point Extent is outside of the Raster extent) or that there is a limit to the extents within the Environments.
To resolve the matter of inconsistent extents, the Points were previously created by a clip of the Raster (meaning no Points exceed the mask of the Raster).
In addition, the Environments -> General -> Extent was set to default (as recommended by ESRI).
I appreciate any response, and will be more than happy to answer any questions. I know this issue has been around the ESRI Forums, so with a little help we maybe able to resolve this matter once and for all.
Public Function BA_ExtractValuesToPoint(InputRasterPath As String, InputRasterName, ShapefilePath As String, _
ShapefileName As String) As Integer
Dim pRWS As IRasterWorkspace
Dim pWSF As IWorkspaceFactory
Set pWSF = New RasterWorkspaceFactory
Set pRWS = pWSF.OpenFromFile(InputRasterPath, 0)
Dim pDEMRaster As IRaster
Dim pGDS As IGeoDataset
Set pDEMRaster = New Raster
Set pDEMRaster = pRWS.OpenRasterDataset(InputRasterName).CreateDefaultRaster
Dim pFeatureClass As IFeatureClass
Set pFeatureClass = BA_OpenFeatureClassFromFile(ShapefilePath, ShapefileName)
'Determine if All Ready Has RasterValue
Dim DoesFieldExists As Boolean
DoesFieldExists = BA_IfHasField(pFeatureClass, "RASTERVALU")
If DoesFieldExists = False Then
' Execute Extract Values to Point Function
Dim pExtractionOp As IExtractionOp2
Set pExtractionOp = New RasterExtractionOp
Dim ExtractedGDS As IGeoDataset
Set ExtractedGDS = pExtractionOp.ExtractValuesToPoints(pFeatureClass, pDEMRaster, True, False)
'Remove and Delete Shapefile
Dim response As Integer
Set pFeatureClass = Nothing
response = BA_RemoveLayersInFolder(ShapefilePath)
response = BA_Remove_Shapefile(ShapefilePath, ShapefileName)
'Add Raster Value to Existing Field
Set pFeatureClass = ExtractedGDS
Dim pDataset As IDataset
Set pDataset = pFeatureClass
Dim pWS As IFeatureWorkspace
Set pWSF = New ShapefileWorkspaceFactory
Set pWS = pWSF.OpenFromFile(AOIFolderBase, 0)
Dim CreateFC As IFeatureClass
Set CreateFC = pDataset.Copy(ShapefileName, pWS)
BA_ExtractValuesToPoint = 1