POST
|
I have an XY event source layer, added to ArcMap with the option File > Add Data > Add XY Data, but when trying to change the spatial reference of this layer with ArcObjects I get a E_NOINTERFACE error. The code snippet that manages the change of the spatial reference is like: Dim spatialRef As ISpatialReference = ...
Dim geoDataset As IGeoDataset = fl.FeatureClass
Dim geoDatasetSchemaEdit As IGeoDatasetSchemaEdit = geoDataset
If (geoDatasetSchemaEdit.CanAlterSpatialReference) Then
geoDatasetSchemaEdit.AlterSpatialReference(spatialRef)
End If Previous code works fine for other type of layers. Also from the ArcMap UI is possible to change the spatial reference of an XY event source layer, so I guess should be possible with ArcObjects. I found these related posts: http://forums.arcgis.com/threads/74625-casting-igeodataset-to-igeodatasetschemaedit-gives-e_nointerface-error and http://forums.arcgis.com/threads/7607-Is-it-possible-to-change-spatialreference-by-arcobjects?highlight=change+feature+class+spatial+reference, but didn't succeed. Any idea how can be change the spatial reference of XY event source layers with ArcObjects? Thanks in advance.
... View more
05-28-2014
12:14 AM
|
0
|
1
|
520
|
POST
|
Hi Finally seem clear the problem. If ArcGIS 10 has no permissions to update the metadata file (installed in Program Files folder) is returning this bizarre exception instead of a understandable exception that can be managed correctly to provide useful feedback about the problem. In ArcGIS 9 same configuration seem working ok. Regards, Jose
... View more
10-29-2010
05:44 AM
|
0
|
0
|
161
|
POST
|
Hi When updating metadata in ArcObjects 10 using a code similar to this:
Dim lyr As ILayer = ...
Dim pDLayer As IDataLayer
Dim pName As IName
pDLayer = CType(lyr, IDataLayer)
pName = pDLayer.DataSourceName
metadata = CType(pName, IMetadata)
Dim metadataPropSet As ESRI.ArcGIS.esriSystem.IPropertySet
Dim metadataXPS As IXmlPropertySet2
metadataPropSet = metadata.Metadata
metadataXPS = CType(metadataPropSet, IXmlPropertySet2)
' Set some properties
metadataXPS.SetPropertyX(metadataProperty1, value1, esriXmlPropertyType.esriXPTText, esriXmlSetPropertyAction.esriXSPAAddOrReplace, False)
metadataXPS.SetPropertyX(metadataProperty2, value2, esriXmlPropertyType.esriXPTText, esriXmlSetPropertyAction.esriXSPAAddOrReplace, False)
' Save metadata
metadata.Metadata = metadataXPS
I'm getting an exception:
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
at ESRI.ArcGIS.Geodatabase.IMetadata.set_Metadata(IPropertySet ppPropertySet)
This only happens when i install the extension i'm creating and use it from ArcGIS 10. Running from Visual Studio IDE the same code executes correctly. Any help is welcome. Thanks in advance, Jose
... View more
10-28-2010
06:10 AM
|
0
|
1
|
876
|
POST
|
Hi Creating a ESRI.ArcGIS.Catalog.ExportXML object in ArcObjects Beta 10 SDK I'm getting the next error: [INDENT]Retrieving the COM class factory for component with CLSID {D3579939-F8FD-4574-87BD-8E97E81055BE} failed due to the following error: 80040154.[/INDENT] Dim metadataExport As IMetadataExport metadataExport = New ExportXML <-- FAIL LINE metadataExport.Export(...) Same code work for 9.X versions. I checked the solution in (http://forums.esri.com/thread.asp?t=219248&f=1707&c=159) about configuring destination CPU to x86, but no success. Any help about the problem? Thanks and regards, Jose Garcia
... View more
06-03-2010
07:43 AM
|
0
|
3
|
336
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|