laptop and a wrench

Bug

IExtractionOp::Rectangle or Polygon returns the incorrect extent on the resulting geodataset.

Last Published: August 25, 2014 No Product Found
Bug ID Number NIM011634
SubmittedSeptember 12, 2007
Last ModifiedJune 5, 2024
Applies toNo Product Found
Version found9.2
Program languageAll
StatusWill Not Be Addressed

Additional Information

No Public Explanation

Workaround

Using IRasterProps::Extent and then saving out the resulting raster with modified extentSub ImageClip()Dim pDoc As IMxDocumentDim pEnv As IEnvelopeSet pDoc = Application.DocumentDim pMap As IMapSet pMap = pDoc.FocusMapDim pGCS As IGraphicsContainerSelectSet pGCS = pMapDim pElement As IElementSet pElement = pGCS.SelectedElement(0)Set pEnv = pElement.Geometry.EnvelopeDim pRaster As IRasterDim pLayer As ILayerSet pLayer = pDoc.FocusMap.Layer(1) ' Image is second layer in the map' If pLayer in not a raster layer then exitIf Not TypeOf pLayer Is IRasterLayer Then Exit SubDim pRasterLayer As IRasterLayerSet pRasterLayer = pLayerSet pRaster = pRasterLayer.Raster' Get Raster from RasterLayerSet pRaster = pRasterLayer.RasterDim pProp As IRasterPropsSet pProp = pRasterDim pDataSet2 As IDatasetDim pGeoDataset As IGeoDataset2' Clip the raster to the extent of the graphicpProp.Extent = pEnv' Save the clip to a new raster datasetDim pDataset As IDatasetSet pDataset = pLayerDim pWS As IWorkspaceSet pWS = pDataset.WorkspaceDim pSaveAS As ISaveAsSet pSaveAS = pProp 'pRaster'Dim pDataSet2 As IDatasetSet pDataSet2 = pSaveAS.SaveAs("test.jpg", pWS, "JPG")Set pGeoDataset = pDataSet2Debug.Print pGeoDataset.Extent.XMin & " - " & pGeoDataset.Extent.XMaxEnd Sub

Steps to Reproduce

Bug ID: NIM011634

Software:

  • No Product Found

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options