|
POST
|
Hi, I have to convert an image from a raster column in an Oracle SDE feature class to a feature attachment of the same feature class. I am using C# to develop the code. I can read the IRasterValue from the blob column. I can add a feature attachment to the feature class. My problem is: How can I convert the image (IRasterValue) to the right object for the feature attachment (IMemoryBlobStream)? Best regards, Stefan
... View more
03-26-2012
04:50 AM
|
0
|
2
|
1451
|
|
POST
|
if it is an exception then you could add try/catch block to bypass the message. It is not an exception. The message box appears, after my code of the "OnChangeFeature" event handler "EditEventsOnChangeFeature" is fully executed. This is why I am not in the control flow anymore.
... View more
02-06-2012
12:17 AM
|
0
|
0
|
731
|
|
POST
|
I am developing an editor extension for ArcMap. The extension should forbid changes to features, which have a attribute value "deny" in a column to restrict any change to the feature. Therefore I check on every OnChangeFeature event if the feature has the attribute value "deny". If this is the case, the change has to be aborted. But when I call IEditor.AbortOperation(), a message box is displayed, for example "The feature(s) could not be moved. Failed to move related features [FeatureClass]" when moving a feature. Is there a way to get rid of that massage box or at least to customize the text? #region IExtension Implementations
public void Shutdown()
{
_editor = null;
_editEvents = null;
}
public string Name
{
get { return "ValidateFeatures_Extension"; }
}
public void Startup(ref object initializationData)
{
if (initializationData != null && initializationData is IEditor)
{
_editor = (IEditor)initializationData;
//Wire editor events.
_editEvents = (IEditEvents_Event)_editor;
_editEvents.OnStartEditing += EditEventsOnStartEditing;
}
}
#endregion
#region Editor event notification implementation
private void EditEventsOnStartEditing()
{
if (_editor.EditWorkspace.Type == esriWorkspaceType.esriFileSystemWorkspace)
{
return;
}
_editEvents.OnChangeFeature += EditEventsOnChangeFeature;
_editEvents.OnCreateFeature += EditEventsOnCreateFeature;
}
private void EditEventsOnChangeFeature(IObject obj)
{
Validate(obj as IFeature);
}
private void EditEventsOnCreateFeature(IObject obj)
{
Validate(obj as IFeature);
}
#endregion
private void Validate(IFeature inFeature)
{
var fieldIndex = inFeature.Fields.FindField("DENYCHANGES");
if (fieldIndex < 0)
{
return;
}
if (inFeature.Value[fieldIndex].Equals("deny"))
{
_editor.AbortOperation();
}
}
... View more
01-31-2012
06:01 AM
|
0
|
2
|
1250
|
|
POST
|
Try to change platform target from "AnyCPU" to "x86" (see screenshot). If you use AnyCPU, the machine will try to use 64 bit assemblies. But Esri assemblies are 32 bit. This is why the installer cannot find the referenced assemblies from your plugin. You have to constrain your .NET plugin to 32 bit by setting platform target to x86. This issue has taken much time for me to resolve when installing my own plugin on a customers machine some months ago... Best regards, Stefan
... View more
11-13-2011
09:52 PM
|
0
|
0
|
1646
|
|
POST
|
There is one file missing: icu4j_3_2.jar You can get it here: http://forums.esri.com/Thread.asp?c=2&f=1720&t=238432#731759 Regards, Stefan
... View more
10-19-2011
03:56 AM
|
0
|
0
|
907
|
|
POST
|
Thanks fpr your answer, I think I have found a way to simply download the jars. Look for the appropiate service pack (in my case: ArcSDE 9.3.1 SP2) in the support websites: http://resources.arcgis.com/de/content/patches-and-service-packs?fa=viewPatch&PID=66&MetaID=1623 Scroll down to section "ESRI products connecting to ArcSDE", download a tar-file for UNIX, for example sde931-sp2-esri-lx.tar.gz and unpack it to your disk. I have found jsde_sdk.jar and jpe_sdk.jar, may be these 2 files are sufficient. I will check. Best regards, Stefan
... View more
10-19-2011
12:08 AM
|
0
|
0
|
907
|
|
POST
|
Hello, I am looking for the 3 JAR-Files of the ArcSDE Java SDK 9.3.1, but I cannot find them on any DVD. Can someone please point me to the right spot? I must be blind... Best regards, Stefan
... View more
10-17-2011
08:13 AM
|
0
|
3
|
3087
|
|
POST
|
Hi, I have developed a custom geoprocessing function tool using C#. The dll is depending on some other DLLs, all located in one folder called "C:\gp". I have created a toolbox containing the custom gp function, the tbx file is also located in the folder C:\gp. When I try to publish the toolbox to arcgis server (runs local on my windows 7 machine "breton"), I get the following errors: Configuration maintain.GPServer can not be started. Configuration maintain.GPServerSync can not be started. Server Object instance creation failed on machine breton. and Unspecified error I verified that the soc account has full control on folder C:\gp What can go wrong? btw it is possible to publish a toolbox just containing an empty model. Best regards, Stefan
... View more
09-13-2011
07:12 AM
|
0
|
1
|
1159
|
|
POST
|
Thanks for your help! The problem was not directly related to the code mentioned so far. The reason why the cursors were kept open was a reference to the SDE workspace, which has been created some lines above the loop to copy the rasters. When I released the COM object referencing the workspace, all open cursors are closed 🙂 So it was a bad idea to open the workspace once and process all steps afterwards. So I solved my problem by opening the workspace inside the loop and release the reference right at the end of the loop. Secondly, I refactored my code so that references to the workspace are opened and closed many times, to avoid a long-time opened workspace, which keeps open cursors. Best regards, Stefan
... View more
08-07-2011
10:48 PM
|
0
|
0
|
1226
|
|
POST
|
Thanks for your posting, but the cursors stay open 😞 I have moved the declarations of "cpRas" and "gp" just before the foreach-loop. So the references are reused in my code, but the open cursor count still raises and raises in each iteration... i also tried to replace the "var" type by "IGPProcess" and "Geoprocessor", even "IGeoProcessor" from ESRI.ArcGIS.Geoprocessing library, but nothing changed. Damn how can I force ArcObjects to release the database cursors? 😞 ESRI.ArcGIS.Geoprocessor.IGPProcess cpRas;
ESRI.ArcGIS.Geoprocessing.IGeoProcessor gp;
foreach (var file in files)
{
var fullRasterSourcePath = file.Key;
var fullRasterSDE = @"Database Connections\vsdev0920.sde\MARA." + file.Value;
ESRI.ArcGIS.esriSystem.IVariantArray para = new ESRI.ArcGIS.esriSystem.VarArrayClass();
para.Add(fullRasterSourcePath);
para.Add(fullRasterSDE);
gp = new ESRI.ArcGIS.Geoprocessing.GeoProcessorClass();
gp.Execute("CopyRaster_management", para, null);
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(gp);
gp = null;
System.Threading.Thread.Sleep(200);
GC.Collect();
GC.WaitForPendingFinalizers();
System.Threading.Thread.Sleep(200);
GC.Collect();
GC.WaitForPendingFinalizers();
}
... View more
08-02-2011
05:18 AM
|
0
|
0
|
1226
|
|
POST
|
Hi, i have a problem with the CopyRaster geoprocessing tool. When I use the GP-Tool to execute it with the Geoprocessor object, it keeps 2 open cursors on my Oracle SDE. I have to copy many rasters from a local folder to the geodatabase. After some time I get ORA-0100: Maximum open cursors exceeded because the open cursors do not get closed until I close ArcMap (i am developing an ArcMap extension with C#). I have tried some things to free the c#-objects, but this does not close the open cursors. What can I do? Here is the code which I use to copy the rasters from the file system to the Oracle SDE: var files = new Dictionary<string, string>();
/* read directory structure and collect all BMP files */
foreach (var file in files)
{
var fullRasterSourcePath = file.Key;
var fullRasterSDE = @"Database Connections\vsdev0920.sde\MARA." + file.Value;
var cpRas = new ESRI.ArcGIS.DataManagementTools.CopyRaster
{
in_raster = fullRasterSourcePath,
out_rasterdataset = fullRasterSDE,
nodata_value = 0
};
var gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor();
gp.Execute(cpRas, null);
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(gp);
ESRI.ArcGIS.ADF.ComReleaser.ReleaseCOMObject(cpRas);
mygp = null;
cpRas = null;
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
GC.WaitForPendingFinalizers();
} After every execution of the CopyRaster tool, there are 2 more open cursors which I checked with the following SQL statement: select sum(a.value) total_cur, avg(a.value) avg_cur, max(a.value) max_cur,
s.username, s.machine
from v$sesstat a, v$statname b, v$session s
where a.statistic# = b.statistic# and s.sid=a.sid
and b.name = 'opened cursors current'
group by s.username, s.machine
order by 1 desc; Both client and SDE are at ArcGIS level 9.3.1 SP2 Best regards, Stefan
... View more
08-02-2011
02:57 AM
|
0
|
4
|
3146
|
|
POST
|
You have to build a string for the output following the "catalog location scheme", which can be seen when opening an existing feature class in your SDE. It is very easy to build the string when the location of a sde-connection file is known, eg: append.output = @"C:\path\Connection to My SDE.sde\sde.username.outputFeatureClass"; I hope you get my example 🙂 When you create a connection to an SDE, the sde connection file is created in the application data folder of the user. When the users name is "john" for example, the sde connection file is located in C:\Documents and Settings\john\Application Data\ESRI\ArcCatalog\Connection to SDE.sde depending on your Windows Version, this may vary. It may require some logic to point to the connection file, when your code has to be kind of generic for all kinds of users, operating systems, database management system (Oracle, MS SQL, Postgres?), etc. Best regards, Stefan
... View more
05-24-2011
02:52 AM
|
0
|
0
|
1114
|
|
POST
|
There is no exception that I can see being thrown, it just exits the code before running any of it even if the code is in a try-catch. I have found the solution! You have to set your configuration of your Visual Studio project to "x86" to compile 32 bit output. My fault was to use "AnyCPU" which compiles 64 bit output: This does not recognize the ESRI assemblies which are 32 bit. Be sure to recomplie every dependent assembly of your own. I hope this will also work for Keelan 🙂 Best regards, Stefan
... View more
05-18-2011
04:12 AM
|
0
|
0
|
1476
|
|
POST
|
Hi, I have to migrate some code from ArcGIS 9.3.1 to 10.0, there is a class "Foo" which is connecting to ArcGIS server locally by calling this code: using ESRI.ArcGIS.ADF.Core;
using ESRI.ArcGIS.ADF.Local;
using ESRI.ArcGIS.ADF.Connection.Core;
using ESRI.ArcGIS.ADF.Connection.Local;
...
class Foo {
private ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection conn = null;
... I debugged the rest of my code down to exactly this line, which is causing my console application to crash immediatly before executing any of its main method code. The code is fine using ArcObjects 9.3.1, but when built with ArcObjects 10.0 and deployed on a Windows Server 2008 R2 machine, its crashing right at the beginning of execution, leaving not a single hint why my code is broken 😞 When not using the private variable conn and therefore not referencing the AGSServerConnection class, my code works. What the hell is wrong using this class on Windows Server 2008 R2? Is somethin misconfiured? Has something changed in local connections to arcgis server? Just to clarify: The code runs on the same machine as ArcGIS server, thats why it uses a local connection. Its really annoying to debug your codes for hours because a crashing application gives no hint WHY its crashing... bad day for me 😞 time to go home. Best regards, Stefan
... View more
05-17-2011
07:53 AM
|
0
|
6
|
1813
|
|
POST
|
Thanks for your answer, I figured it out already (I had some time since november 2010 *g*)
... View more
04-18-2011
01:28 AM
|
0
|
0
|
4583
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-08-2017 04:46 AM | |
| 1 | 08-08-2017 07:35 AM | |
| 1 | 08-04-2014 06:11 AM | |
| 1 | 08-04-2014 10:18 PM | |
| 1 | 06-02-2016 05:14 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|