laptop and a wrench

Bogue

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

Dernière publication: August 25, 2014 No Product Found
Numéro d’ID de bogue NIM011634
EnvoiSeptember 12, 2007
Dernière modificationJune 5, 2024
S’applique àNo Product Found
Version trouvée9.2
Langue du programmeAll
StatutWill Not Be Addressed

Informations supplémentaires

No Public Explanation

Solution de contournement

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

Étapes pour reproduire

ID de bogue: NIM011634

Logiciel:

  • No Product Found

Recevoir une notification lorsque le statut d’un bogue change

Télécharger l’application Esri Support

En savoir plus sur ce sujet

Obtenir de l’aide auprès des experts ArcGIS

Contacter le support technique

Télécharger l’application Esri Support

Accéder aux options de téléchargement