POST
|
Are you trying to pull the shapefile into a map? As in, open it as a layer?
... View more
12-09-2013
11:50 AM
|
0
|
0
|
7
|
POST
|
Hi, I'm attempting to iterate through the layers in a MXD and generate euclidean distance rasters for them. This works fine when the layers have no definition query applied to them. I get this generic COMException when there is a def query applied. Any thoughts? I've also included a bit of source code. I've tried calling the gp tool in different ways, so far no luck. I haven't had any luck with searching online either. Error Msg: System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at ESRI.ArcGIS.Geoprocessing.GeoProcessorClass.Execute(String Name, IVariantArray ipValues, ITrackCancel pTrackCancel) at Analust.tool.Dummy(IGeoDataset inFeature) in \\C:\Apps\temp\analyst.cs: line 34
IGeoDataset data = (IGeoDataset)layer;
IGeoDataset EucDistRas = null;
IGeoProcessor gp = new GeoProcessorClass();
IVariantArray parameters = new VarArrayClass();
parameters.Add(@"C:\Apps\NTR_Demo\_inputs\NestingSites");
parameters.Add("1000 Meters");
gp.Execute("EucDistance_sa", parameters, null);
Thank you in advance! Grace
... View more
12-09-2013
11:35 AM
|
0
|
2
|
517
|
POST
|
If anyone still cares this could be a registry problem. That's how i resolved it anyways. There's some info on this page: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Advanced_add_in_concepts/0001000004n7000000/ Basically they tell you to change the BlockAddIns registry to 0. However, I found that the path they provided wasn't where my BlockAddIns registry is located. So if you can't find HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\Desktop10.0\Settings try HKEY_LOCAL_MACHINE > SOFTWARE > Wow6432Node > ESRI > Desktop10.0 > Settings Hope this helps.
... View more
10-09-2013
08:26 AM
|
0
|
0
|
60
|
POST
|
Hi, this might be a total noob question but... does anyone know how to use the GPSAFuzzyFunctionClass to linearly reclassify a raster? I've set the fuzzy function but I have no idea how to apply it to a dataset! IGPSAFuzzyFunction fuzzy = new GPSAFuzzyFunctionClass();
fuzzy.SetLinear(minExt, maxExt); Many thanks
... View more
08-03-2012
09:29 AM
|
0
|
0
|
217
|
POST
|
Here's my code :] String targetWorkspacePath = @"O:\EPScratch\GeomaticsGrace\NTR\TestOutput.gdb"; String targetName = "testOut"; IWorkspace targetWorkspace = (IWorkspace)OpenFeatureWorkspace(targetWorkspacePath); IRasterBand EucDistRas = CreateDistanceOpEucDistanceFullDistanceRaster(FClass as IGeoDataset); EucDistRas.Copy(targetName, targetWorkspace); IFeatureWorkspace OpenFeatureWorkspace(string filePath) { IWorkspaceFactory WorkspaceFactory = new FileGDBWorkspaceFactoryClass(); IWorkspace Workspace = WorkspaceFactory.OpenFromFile(filePath, 0); IFeatureWorkspace featureWorkspace = (IFeatureWorkspace)Workspace; // Explict Cast return featureWorkspace; } public IRasterBand CreateDistanceOpEucDistanceFullDistanceRaster(IGeoDataset geoDataset) { try { if (geoDataset is IRaster | geoDataset is IRasterDataset | geoDataset is IRasterBand | geoDataset is IRasterDescriptor | geoDataset is IFeatureClass) { // Create the RasterDistanceOp object IDistanceOp distanceOp = new RasterDistanceOpClass(); object euc_maxDistance = Type.Missing; object object_missing2 = Type.Missing; IGeoDataset geoDataset_result = distanceOp.EucDistanceFull(geoDataset, true, false, false, ref euc_maxDistance, ref object_missing2); // Access the Euclidean distance raster from the output generated IRasterBandCollection rasterBandCollection = (IRasterBandCollection)geoDataset_result; // Explicit Cast IRasterBand rasterBand = rasterBandCollection.Item(0); IGeoDataset geoDataset_output = (IGeoDataset)rasterBand; // Explicit Cast return rasterBand; } else { //Invalid type of GeoDataset for this process MessageBox.Show("CreateDistanceOpEucDistanceFullDistanceRaster Error: invalid input"); return null; } } catch (Exception e) { MessageBox.Show(e.ToString()); return null; } }
... View more
07-10-2012
12:05 PM
|
0
|
0
|
12
|
POST
|
Oh thank you very much! I've tried .Copy on the IRasterBand but I got the error E_FAIL System.Runtime.InteropService.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component. at ESRI.ArcGIS.DataSourcesRaster.IRasterBand.Copy(String copyName, IWorkspace copyWorkspace)... I'm not sure where to go with that error message... :confused:
... View more
07-10-2012
07:09 AM
|
0
|
0
|
12
|
POST
|
Hi All, I'm new to ArcObjects and C# and currently I'm trying to take an IRasterBand object and write it to file. The IRasterBand has been cast to IGeoDataset before this: ISaveAs saveAs = (ISaveAs)EucDistRas; //this is the line that causes the failure saveAs.SaveAs(targetName, targetWorkspace, "GRID"); The error I'm getting is as follows: System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'ESRI.ArcGIS.Geodatabase.ISaveAs'. This operation failed because the QueryInterface call on the COM component for the interface with IID'{C7A9E97-597E-4A69-A872-29CB60B5E0DB}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)). This procedure seems pretty standard. I've seen ESRI help docs that uses this code. I've read that dll registration might cause E_NOINTERFACE errors. So I've unregistered and then re-registered the ESRI.ArcGIS.Geodatabase dll (which ISaveAs resides in). But it doesn't seem to help. If anyone has any advice that would be much appreciated! Thanks :] Grace
... View more
07-05-2012
09:27 AM
|
0
|
4
|
466
|
POST
|
Ok I know it's been a while but I'm having a similar problem and I didn't want to create a whole new post. I'm able to reference some ESRI.ArcGIS namespaces but not others (which I need). I have access to: using ESRI.ArcGIS.Geometry; using ESRI.ArcGIS.Carto; using ESRI.ArcGIS.ArcMapUI; using ESRI.ArcGIS.Desktop; using ESRI.ArcGIS.esriSystem; using ESRI.ArcGIS.Framework; I'm trying to use SpatialAnalyst at the moment... I'm pretty new to ArcObjects so pardon me if I'm missing something obvious. (I have the SDK installed and .NET framework 3.5) Thanks, Grace
... View more
06-28-2012
02:54 PM
|
0
|
0
|
28
|
POST
|
Hi I'm new to developing add ins for ArcMap. Something I'm really interested in (but have yet to find any solid info on) is the possibility of running a FME workbench via an add in. I'm working in Visual C# and ArcGIS 10. Thanks, Grace
... View more
06-25-2012
09:16 AM
|
0
|
0
|
409
|
POST
|
Hi, I've been having trouble executing the EucDistance tool using arcpy. When I run my script in Python Shell, everything is well. But when I import the script into a tool box and run it from there, things start to fall apart. Currently I'm testing out a smaller script with just EucDistance. Right now I get this message: O:\EPScratch\Grace\data\apda_bc.shp (input) O:\EPScratch\Grace\scratch\test1 (out path) <class 'arcgisscripting.ExecuteError'>: ERROR 999999: Error executing function. The item was not found. [ItemType: {00000000-0000-0000-0000-000000000000}] No spatial reference exists. ERROR 010029: Unable to create the raster \\CAL-S-01005\cag605-f$\Cached\My Documents\ArcGIS\Default.gdb\EucDist_shp2. Distance mapping is failed ERROR 010067: Error in executing grid expression. Failed to execute (EucDistance). Failed to execute (TESTER). Right now I have the following environment settings: arcpy.CheckOutExtension("spatial") env.overwriteOutput=True env.cellSize = 50 env.extent = "O:\EPScratch\Grace\data\Ext.shp" env.outputCoordinateSystem ="O:\EPScratch\Grace\data\Ext.shp" Past errors I've gotten with EucDistance included "Invalid SQL Statements". The funny thing is when I use arcpy.gp.EucDistance_sa(inRas,outRas) I don't get such errors (Currently I'm using x= EucDistance(inRas) then x.save(outRas)) . I'm so confused! Thanks in advance for all of your time! Grace
... View more
07-04-2011
01:33 PM
|
0
|
1
|
1017
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|