POST
|
My application is loading data into a series of SDE tables (in an Oracle database). Prior to loading, it uses IWorkspaceEdit like this: if (!workspaceEdit.IsBeingEdited()) { workspaceEdit.StartEditing(false); workspaceEdit.StartEditOperation(); } If something goes wrong along the way, it's meant to rollback changes with: if (workspaceEdit.IsBeingEdited()) { workspaceEdit.StopEditOperation(); workspaceEdit.StopEditing(false); } This works fine on my own Oracle database. But my customer says it's not working for them (the rows inserted prior to failure don't get rolled back). Is anyone aware of some Oracle config setting that may end up producing different results? In both cases, we're inserting into sde.DEFAULT. The tables are marked as versioned, with the option to move edits to base.
... View more
05-14-2013
04:53 AM
|
0
|
0
|
551
|
POST
|
I have an instance of IFeatureRenderer that I've determined is an instance of BiUniqueValueRenderer. To pick out the two renderers involved, I then tried to cast it to IBivariateRenderer, but it says it doesn't implement it. How come? I'm on 10.0, working in C#
... View more
07-03-2012
03:36 AM
|
0
|
1
|
519
|
POST
|
I haven't found any way to specify the quality value for the geoprocessor, so I thought I'd try using ISaveAs to post-process the result that comes out of ProjectRaster. My test code produced 3 results as follows: IWorkspaceFactory wsfac = new RasterWorkspaceFactoryClass();
IWorkspace ws = wsfac.OpenFromFile(@"C:\Data", 0);
IRasterDataset rds = (ws as IRasterWorkspace).OpenRasterDataset("GpOutput.jp2");
IRasterStorageDef sd = new RasterStorageDefClass();
(rds as ISaveAs2).SaveAsRasterDataset("ResultNull.jp2", ws, "JP2", sd);
sd.CompressionType = esriRasterCompressionType.esriRasterCompressionJPEG2000;
sd.CompressionQuality = 50;
(rds as ISaveAs2).SaveAsRasterDataset("Result50.jp2", ws, "JP2", sd);
sd.CompressionQuality = 75;
(rds as ISaveAs2).SaveAsRasterDataset("Result75.jp2", ws, "JP2", sd);
And the results are all the same (and equal to the input). So it looks like SaveAsRasterDataset doesn't do anything with the supplied RasterStorageDef. Has anyone had success with this?
... View more
10-26-2011
12:34 PM
|
0
|
0
|
134
|
POST
|
I'm using the ProjectRaster tool to re-project a JPEG2000 file, and noticed that the file size increased quite a bit (from 18Mb to 117Mb). I've tried using the GeoProcessor.SetEnvironmentValue method to make sure it uses JPEG2000 compression, but I'm not sure how to specify the quality value. Looking at some online help for scripting, it appeared that you can set the quality by appending a number to the compression type, so I tried the following: Geoprocessor gp = new Geoprocessor();
gp.SetEnvironmentValue("Compression", "JPEG2000 50");
However my resultant file is the same size regardless of the number tagged on the end. Looking into one of the xml files that get produced alongside the resultant file, it does appear to have picked up the compression type. But there's no mention of quality. So is there some other way to specify it? P.S. I've seen the IGPRasterGDBEnvCompression interface, but it would appear to relate to rasters in a GDB, and I'm only working with plain old files.
... View more
10-25-2011
02:38 PM
|
0
|
1
|
851
|
POST
|
For the record, it wasn't actually FDO_E_FEATURE_EMPTY_GEOMETRY - error code -2147217383 is also E_RASTER_FAILED_TO_COPY_DATASET (which makes a lot more sense). Looking at archived forums, I see people were having this problem years back. No answer then, no answer now. In the end, I got around it by saving initially to a BMP file, then used System.Drawing.Image.Save to convert that to JPG.
... View more
08-18-2011
12:49 AM
|
0
|
0
|
332
|
POST
|
Hi Neil, Yes, the Inova dll is one of our own low-level DLLs (no ArcGIS in sight) - I couldn't understand why a call to ArcGIS code would end up trying to access it. I can only put it down to the wonders of COM interop. In the end, I applied an ICoordinateXform to my raster (since the output needs to be in the coordinate system of my polygon). Having done that, the problem disappeared.
... View more
07-13-2011
07:40 AM
|
0
|
0
|
199
|
POST
|
Poking around this morning, I found that the following avoided the error: int SplitRaster(IRasterDataset rds, IPolygon extent, ...
{
IRasterProps rasterProps = (IRasterProps)rds.CreateDefaultRaster();
IEnvelope dsExtent = rasterProps.Extent;
// The following leads to weird error
// if (!IsOverlap(extent, dsExtent))
// return 0;
// This avoids the error
IEnvelope testExtent = new EnvelopeClass();
testExtent.PutCoords(dsExtent.XMin, dsExtent.YMin, dsExtent.XMax, dsExtent.YMax);
if (!IsOverlap(extent, testExtent))
return 0;
Unfortunately, the result was incorrect. I then noticed that I'd forgotten to copy over the spatial reference. When I did that (i.e. set testExtent.SpatialReference = dsExtent.SpatialReference), the error came back. So it seems the error is arising during an on-the-fly coordinate conversion (my polygon is NAD27, my raster is NAD83).
... View more
07-13-2011
12:07 AM
|
0
|
0
|
199
|
POST
|
I have a simple piece of code that checks whether an envelope overlaps a polygon: bool IsOverlap(IPolygon p, IEnvelope e)
{
IPolygon pe = new PolygonClass();
(pe as ISegmentCollection).SetRectangle(e);
return (pe as IRelationalOperator).Overlaps(p);
}
It was working for me this morning. But this afternoon, the call to IRelationalOperator.Overlaps causes a weird exception, apparently due to some problem reflecting on assemblies. The message is Could not load file or assembly 'Inova.Core.DataStore.XmlSerializers' or one of its dependencies. I also see Exception from HRESULT: 0x80040215| COM Errorcode -2147220971 [FDO_E_BINDING] My app does reference a DLL called Inova.Core.DataStore.dll (though I don't know where it's getting the XmlSerializers bit from). The stack trace looks like this: at System.Reflection.RuntimeAssembly.nLoad(... at System.Reflection.RuntimeAssembly.LoadWithPartialNameInternal(... at ESRI.ArcGIS.Geometry.PolygonClass.Overlaps(IGeometry other) at Firefly.Spatial.Survey.Database.BlockWriter.IsOverlap(IPolygon p, IEnvelope e) Pity the ArcGIS code is top secret because now I have to ask: what's going on, and what can I do?
... View more
07-12-2011
08:20 AM
|
0
|
3
|
2580
|
POST
|
I'm creating some raster tiles using code like that in http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000001z000000(modified to accept the output file type - JPG or PNG). At first, everything seemed to be working great. However, one of my datasets seems to have a problem writing to JPG. The call to ISaveAs.SaveAs comes back with the error: esriDataSourcesRaster.GdalDriver - Failed to copy raster dataset - COM Errorcode -2147217383 [FDO_E_FEATURE_EMPTY_GEOMETRY]. However, it works if I save to PNG. It doesn't seem to relate to the pixel type (all the files I'm working with are PT_UCHAR). Any ideas?
... View more
07-12-2011
03:38 AM
|
0
|
2
|
1548
|
POST
|
How do I access the path to the image files in an unmanaged raster catalog? And how can I change it if the files have been moved? I'm aware of the ExportRasterCatalogPaths and RepairRasterCatalogPaths in ESRI.ArcGIS.DataManagementTools, but it seems like a lot of jumping through hoops, and documentation of GP tools leaves something to be desired. I had hoped to do it like this: string GetPath(IRasterValue rv) { [INDENT] IDatasetName dsn = (rv.RasterDatasetName as IDatasetName); IWorkspaceName wsn = dsn.WorkspaceName; return wsn.PathName; [/INDENT]} But that just gives me the path of the enclosing geodatabase. Looking at the files in the GDB folder, I see things like *.CatItemsByPhysicalName.atx, which I'm guessing contains the information I'm after. Is there a way to get inside these? I'm working with ArcGIS Engine 10.
... View more
12-10-2010
03:32 AM
|
0
|
1
|
836
|
POST
|
I'm in the process of upgrading our current ArcGIS Engine installation. I started by upgrading to 9.3.1 with: ArcGISEngine931.msp ArcGISEngineSDKNet931.msp Then I ran: ArcGISEngine931sp1.msp However, the download page at http://resources.arcgis.com/content/patches-and-service-packs?fa=viewPatch&PID=79&MetaID=1576 doesn't appear to have anything for upgrading the .Net developer kit. So when I run PatchFinder931.exe, it says I've got SP1 for the run-time, but not for the SDK. Hmmm, doesn't look right. I picked one specific bug (something that release notes suggest should be fixed in 9.3.1 SP1), but the bug is still there. Which makes me think I must be missing something. Can anyone point me in the right direction? P.S. Sorry if this is the wrong forum - the ArcGIS Engine forum seems to have disappeared.
... View more
05-10-2010
07:08 AM
|
0
|
0
|
188
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|